Coverage for backend/django/flowsheetInternals/unitops/config/objects/translator_config.py: 100%
4 statements
« prev ^ index » next coverage.py v7.10.7, created at 2026-05-13 02:47 +0000
« prev ^ index » next coverage.py v7.10.7, created at 2026-05-13 02:47 +0000
1from common.config_types import *
2from common.config_utils import *
3from ..spec_helpers import *
5translator_config: ObjectType = ObjectType(
6 displayType="Translator",
7 displayName="Translator",
8 ports={
9 "inlet": PortType(
10 many=False,
11 displayName="Inlet",
12 type=ConType.Inlet,
13 streamName="S",
14 ),
15 "outlet": PortType(
16 displayName="Outlet",
17 type=ConType.Outlet,
18 streamName="S",
19 )
20 },
21 propertyPackagePorts={
22 "Inlet": ["inlet"],
23 "Outlet": ["outlet"]
24 },
25 graphicObject=unitop_graphic(),
26 properties=PropertiesType({
27 "translator_type": PropertyType(
28 displayName="Translator Type",
29 type="dropdown",
30 value="pressure_enthalpy",
31 options={
32 "pressure_enthalpy": "Pressure & Enthalpy",
33 "pressure_vapor_fraction": "Pressure & Vapor Fraction",
34 "pressure_temperature": "Pressure & Temperature",
35 },
36 unitType="dimensionless"
37 ),
38 }),
39 propertySetGroups={
40 "default": {
41 # Keep translator_type editable without widening the whole group.
42 "type": "stateVars",
43 "displayName": "Properties",
44 "stateVars": ("translator_type",),
45 },
46 },
47 idaes_adapter=UnitModelAdapter(
48 args=ArgAdapter({
49 "inlet_property_package": PropertyPackageAdapter("Inlet"),
50 "outlet_property_package": PropertyPackageAdapter("Outlet"),
51 "translator_type": EnumAdapter("translator_type"),
52 }),
53 properties=SerialisePropertiesAdapter(),
54 ports=SerialisePortAdapter()
55 ),
56)