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

3 statements  

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

1from common.config_types import * 

2from common.config_utils import * 

3 

4energy_splitter_config: ObjectType = ObjectType.model_validate({ 

5 "displayType": "Energy Splitter", 

6 "displayName": "Energy Splitter", 

7 "ports": { 

8 "inlet": { 

9 "many": False, 

10 "displayName": "Power Inlet", 

11 "type": ConType.Inlet, 

12 "streamType": "energy_stream", 

13 "streamName": "PS", 

14 "default": 1, # default number of inlets 

15 "minimum": 1, # minimum number of inlets 

16 }, 

17 "outlet": { 

18 "many": True, 

19 "displayName": "Power Outlet", 

20 "type": ConType.Outlet, 

21 "streamType": "energy_stream", 

22 "streamName": "PS", 

23 "default": 2, # default number of outlets 

24 "minimum": 2, # minimum number of outlets 

25 }, 

26 }, 

27 "propertyPackagePorts": default_property_package_ports(), 

28 "graphicObject": unitop_graphic(), 

29 "indexSets": ["splitter_fraction"], 

30 "properties": { 

31 "split_fraction": { 

32 "displayName": "Split Ratio", 

33 "type": "numeric", 

34 "unitType": "ratio", 

35 "indexSets": ["splitter_fraction"], 

36 "sumToOne": True, 

37 }, 

38 "capacity": { 

39 "displayName": "Capacity", 

40 "type": "numeric", 

41 "unitType": "heatflow" 

42 }, 

43 }, 

44 "splitter_fraction_name": "Outlet", 

45 "propertySetGroups": { 

46 "default": { 

47 "type": "exceptLast", 

48 "displayName": "Properties", 

49 "stateVars": ("split_fraction","capacity"), 

50 } 

51 }, 

52})