Coverage for backend/common/models/idaes/arc_schema.py: 100%

12 statements  

« prev     ^ index     » next       coverage.py v7.10.7, created at 2025-11-06 23:27 +0000

1from pydantic import BaseModel, Field 

2from typing import Optional 

3from .id_types import PortId, ArcId 

4 

5 

6class TearGuessSchema(BaseModel): 

7 """ 

8 Indicates whether these properties should be fixed 

9 at the tear stream. 

10 """ 

11 flow_mol: bool 

12 pressure: bool 

13 enth_mol: bool 

14 

15 

16class ArcSchema(BaseModel): 

17 """ 

18 Stores the schema required on a JSON object to define an arc in IDAES. 

19 

20 id: The id of the arc, for identification of the return arc. 

21 source_id: The id of the source port. Each port has a unique id. 

22 destination_id: The id of the destination port. Each port has a unique id. 

23 tear_guess: A dictionary mapping variables to whether they should be fixed at the tear stream. 

24 

25 All fields are required. 

26 """ 

27 id: ArcId 

28 source: PortId 

29 destination: PortId 

30 tear_guess: Optional[dict[str, bool]] = None