Coverage for backend/django/flowsheetInternals/unitops/config/objects/mixer_config.py: 100%

4 statements  

« 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 * 

4 

5mixer_config: ObjectType = ObjectType( 

6 displayType="Mixer", 

7 displayName="Mixer", 

8 ports={ 

9 "inlet": PortType( 

10 many=True, 

11 displayName="Inlet", 

12 type=ConType.Inlet, 

13 default=2, # default number of inlets 

14 minimum=2, # minimum number of inlets 

15 streamName="S", 

16 ), 

17 "outlet": PortType( 

18 displayName="Outlet", 

19 type=ConType.Outlet, 

20 streamName="S", 

21 ) 

22 }, 

23 # TODO: ensure this will work with n number of inlets & outlets 

24 propertyPackagePorts=default_property_package_ports(), 

25 graphicObject=unitop_graphic(), 

26 properties=PropertiesType({}), 

27 propertySetGroups={}, 

28 idaes_adapter=UnitModelAdapter( 

29 args=ArgAdapter({ 

30 "property_package": PropertyPackageAdapter(), 

31 "num_inlets": NumInletsAdapter(), 

32 }), 

33 properties=SerialisePropertiesAdapter(), 

34 ports=MixerPortListAdapter() 

35 ), 

36) 

37 

38# We can't use the normal PortListAdapter because we don't know ahead of time which ports are on the mixer. 

39# there could be any number of inlet and outlet ports. 

40# So we will have to make our own PortListAdapter that has custom code to generate the list of ports. 

41