Coverage for backend/django/core/auxiliary/methods/copy_flowsheet/models_to_copy.py: 100%

26 statements  

« prev     ^ index     » next       coverage.py v7.10.7, created at 2026-02-11 21:43 +0000

1from PinchAnalysis.models.StreamDataProject import StreamDataProject 

2from PinchAnalysis.models.InputModels import PinchInputs, PinchUtility, Segment, StreamDataEntry 

3from PinchAnalysis.models.OutputModels import ( 

4 PinchOutputs, 

5 PinchTemp, 

6 TargetSummary, 

7 HeatSupplierUtilitySummary, 

8 HeatReceiverUtilitySummary, 

9 PinchGraphSet, 

10 PinchGraph, 

11 PinchCurve, 

12 GraphDataPoint, 

13) 

14from PinchAnalysis.models.OptionModels import TurbineOptions, MainOptions 

15from PinchAnalysis.models.HenNode import HenNode 

16from core.auxiliary.models.ControlValue import ControlValue 

17from core.auxiliary.models.Flowsheet import Flowsheet 

18from core.auxiliary.models.IndexedItem import IndexedItem 

19from core.auxiliary.models.MLModel import MLModel 

20from core.auxiliary.models.PropertyInfo import ( 

21 PropertyInfo, 

22 ProcessPathProperty, 

23 HistoricalValue, 

24) 

25from core.auxiliary.models.PropertyValue import PropertyValue 

26from core.auxiliary.models.Scenario import Scenario, OptimizationDegreesOfFreedom 

27from core.auxiliary.models.DataColumn import DataColumn 

28from core.auxiliary.models.MLColumnMapping import MLColumnMapping 

29from core.auxiliary.models.Note import Note 

30from core.auxiliary.models.ProcessPath import ProcessPath 

31from core.auxiliary.models.PropertySet import PropertySet 

32from core.auxiliary.models.RecycleData import RecycleData, RecycleProperty 

33from core.plots.Plot import Plot, Series 

34 

35from flowsheetInternals.graphicData.models.graphicObjectModel import GraphicObject 

36from flowsheetInternals.graphicData.models.groupingModel import Grouping 

37 

38from flowsheetInternals.propertyPackages.models.SimulationObjectPropertyPackages import SimulationObjectPropertyPackages 

39from flowsheetInternals.unitops.models.Port import Port 

40from flowsheetInternals.unitops.models.SimulationObject import SimulationObject 

41# Note: the order of the models in this list matters, 

42# as it determines the order in which they are copied. 

43# The models that are copied first should not have any foreign keys to models that are copied later. 

44 

45 

46# Custom modules don't need the pinch analysis stuff copied, only the core flowsheet stuff. 

47custom_module_linked_model_types = [ 

48 Flowsheet, 

49 SimulationObject, 

50 PropertySet, 

51 Scenario, 

52 DataColumn, 

53 Grouping, 

54 PropertyInfo, 

55 IndexedItem, 

56 PropertyValue, 

57 Port, 

58 MLModel, 

59 ControlValue, 

60 ProcessPathProperty, 

61 # HistoricalValue, # Don't think these are used any more. 

62 #DataCell, # We probably should copy, but for now we can just re-create them. 

63 #Solution, # Don't need to copy, can just regenerate 

64 OptimizationDegreesOfFreedom, 

65 MLColumnMapping, 

66 Note, 

67 ProcessPath, 

68 RecycleData, 

69 RecycleProperty, 

70 Plot, 

71 Series, 

72 GraphicObject, 

73 SimulationObjectPropertyPackages, 

74] 

75# When you're copying a flowsheet, you need to copy everything. This includes pinch analysis models. 

76linked_model_types = custom_module_linked_model_types + [ 

77 StreamDataEntry, 

78 StreamDataProject, 

79 PinchInputs, 

80 Segment, 

81 PinchUtility, 

82 TurbineOptions, 

83 MainOptions, 

84 PinchOutputs, 

85 PinchTemp, 

86 TargetSummary, 

87 HeatSupplierUtilitySummary, 

88 HeatReceiverUtilitySummary, 

89 PinchGraphSet, 

90 PinchGraph, 

91 PinchCurve, 

92 GraphDataPoint, 

93 HenNode, 

94] 

95 

96