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

5 statements  

« prev     ^ index     » next       coverage.py v7.10.7, created at 2026-05-13 02:47 +0000

1from core.auxiliary.enums.unitsOfMeasure import UnitOfMeasure 

2 

3from common.config_types import * 

4from common.config_utils import * 

5from ..spec_helpers import * 

6 

7grid_config: ObjectType = ObjectType( 

8 displayType="Grid", 

9 displayName="Grid", 

10 

11 ports={ 

12 "inlet": PortType( 

13 displayName="Residual Power in", 

14 type=ConType.Inlet, 

15 streamType="energy_stream", 

16 streamName="PS" 

17 ) 

18 }, 

19 propertyPackagePorts=default_property_package_ports(), 

20 graphicObject=unitop_graphic(), 

21 properties=PropertiesType({ 

22 "n_capacity": PropertyType( 

23 displayName="N-Capacity", 

24 type="numeric", 

25 unitType="heatflow" 

26 ), 

27 "n_minus_one": PropertyType( 

28 displayName="N-1 Capacity", 

29 type="numeric", 

30 unitType="heatflow" 

31 ), 

32 "import_export": PropertyType( 

33 displayName="Power In/Out", 

34 type="numeric", 

35 unitType="heatflow" 

36 ), 

37 }), 

38 propertySetGroups={ 

39 "default": { 

40 "type": "stateVars", 

41 "displayName": "Properties", 

42 "stateVars": ("n_capacity","n_minus_one" ), 

43 } 

44 }, 

45 keyProperties=[ 

46 "import_export", 

47 ], 

48 idaes_adapter=UnitModelAdapter( 

49 args=ArgAdapter({ 

50 "property_package": ConstantSchemaAdapter(PowerPPArgSchema()), 

51 }), 

52 properties=SerialisePropertiesAdapter(), 

53 ports=SerialisePortAdapter(), 

54 ), 

55)