@@ -747,12 +747,15 @@ def o(output_param: OutputParameter):
747
747
model .logger .critical (msg )
748
748
raise RuntimeError (msg ) from ex
749
749
750
- self .print_outputs_rich (model )
750
+ Outputs .print_outputs_rich (self . output_file , self . text_output_file , self . html_output_file , model )
751
751
752
752
model .logger .info (f'Complete { __class__ !s} : { sys ._getframe ().f_code .co_name } ' )
753
753
754
- def print_outputs_rich (self , model : Model ):
755
- #data structures and assignments for HTML and Improved Text Output formats
754
+
755
+ @staticmethod
756
+ def print_outputs_rich (output_file : str , text_output_file : strParameter , html_output_file : strParameter , model : Model ):
757
+
758
+ # data structures and assignments for HTML and Improved Text Output formats
756
759
simulation_metadata = []
757
760
summary = []
758
761
economic_parameters = []
@@ -1602,16 +1605,16 @@ def print_outputs_rich(self, model: Model):
1602
1605
if model .economics .DoSDACGTCalculations .value :
1603
1606
sdac_df , sdac_results = model .sdacgtoutputs .PrintOutputs (model )
1604
1607
1605
- if self . text_output_file .Provided :
1606
- Write_Text_Output (self . output_file , simulation_metadata , summary , economic_parameters ,
1608
+ if text_output_file .Provided :
1609
+ Write_Text_Output (output_file , simulation_metadata , summary , economic_parameters ,
1607
1610
engineering_parameters ,
1608
1611
resource_characteristics , reservoir_parameters , reservoir_stimulation_results , CAPEX ,
1609
1612
OPEX ,
1610
1613
surface_equipment_results , sdac_results , addon_results , hce , ahce , cashflow ,
1611
1614
pumping_power_profiles , sdac_df , addon_df )
1612
1615
1613
1616
# Get rid of any trailing spaces in that output file - they are confusing the testing code
1614
- with open (self . output_file , 'r+' ) as fp :
1617
+ with open (output_file , 'r+' ) as fp :
1615
1618
lines = fp .readlines ()
1616
1619
fp .seek (0 )
1617
1620
fp .truncate ()
@@ -1622,18 +1625,18 @@ def print_outputs_rich(self, model: Model):
1622
1625
# uncomment these to allow for testing of the HTML output
1623
1626
# self.html_output_file.value = 'd:\\temp\\test_table_geophires.html'
1624
1627
# self.html_output_file.Provided = True
1625
- if self . html_output_file .Provided :
1626
- Write_HTML_Output (self . html_output_file .value , simulation_metadata , summary , economic_parameters ,
1628
+ if html_output_file .Provided :
1629
+ Write_HTML_Output (html_output_file .value , simulation_metadata , summary , economic_parameters ,
1627
1630
engineering_parameters , resource_characteristics , reservoir_parameters ,
1628
1631
reservoir_stimulation_results , CAPEX , OPEX , surface_equipment_results , sdac_results ,
1629
1632
addon_results , hce , ahce , cashflow , pumping_power_profiles , sdac_df , addon_df )
1630
1633
1631
1634
Plot_Tables_Into_HTML (model .surfaceplant .enduse_option , model .surfaceplant .plant_type ,
1632
- self . html_output_file .value , hce , ahce , cashflow , pumping_power_profiles , sdac_df ,
1635
+ html_output_file .value , hce , ahce , cashflow , pumping_power_profiles , sdac_df ,
1633
1636
addon_df )
1634
1637
# make district heating plot
1635
1638
if model .surfaceplant .plant_type .value == PlantType .DISTRICT_HEATING :
1636
- MakeDistrictHeatingPlot (self . html_output_file .value , model .surfaceplant .dh_geothermal_heating .value ,
1639
+ MakeDistrictHeatingPlot (html_output_file .value , model .surfaceplant .dh_geothermal_heating .value ,
1637
1640
model .surfaceplant .daily_heating_demand .value )
1638
1641
1639
1642
0 commit comments