|
13 | 13 | to_process_inputs = True |
14 | 14 | sim_horizon = 24 |
15 | 15 | model_name = "dummy" |
16 | | -steps_to_run = 3 # Default is None |
| 16 | +steps_to_run = 2 # Default is None |
17 | 17 | do_plot = True |
18 | 18 | ####################### |
19 | 19 |
|
|
81 | 81 |
|
82 | 82 |
|
83 | 83 | # Process the results |
84 | | -output_processor = OutputProcessor(inputs) |
85 | | -node_var_df = record.get_node_variables() |
86 | | -output_processor.load_from_dataframe(node_var_df) |
| 84 | +output_processor = OutputProcessor() |
| 85 | +output_processor.load(inputs) |
| 86 | +node_variables = record.get_node_variables() |
87 | 87 |
|
88 | 88 | # Visualize the results |
89 | 89 | if do_plot: |
90 | 90 | visualizer = Visualizer(inputs.model_id) |
91 | 91 | if steps_to_run <= 3: |
92 | 92 | visualizer.plot_fuelmix_bar( |
93 | | - dispatch=output_processor.get_hourly_dispatch(), |
94 | | - demand=output_processor.get_hourly_demand(), |
| 93 | + dispatch=output_processor.get_hourly_generation(node_variables), |
| 94 | + demand=output_processor.get_hourly_demand(inputs.demand), |
95 | 95 | ) |
96 | 96 | else: |
97 | | - visualizer = Visualizer(inputs.model_id) |
98 | 97 | visualizer.plot_fuelmix_area( |
99 | | - dispatch=output_processor.get_daily_dispatch(), |
100 | | - demand=output_processor.get_daily_demand(), |
| 98 | + dispatch=output_processor.get_monthly_generation(node_variables), |
| 99 | + demand=output_processor.get_monthly_demand(inputs.demand), |
101 | 100 | ) |
102 | | - |
103 | | -# # Save other modeling statistics |
104 | | -# import os |
105 | | -# from pownet.folder_utils import get_output_dir |
106 | | -# import pandas as pd |
107 | | - |
108 | | -# folder_dir = get_output_dir() |
109 | | -# prefix_name = "warmstart" |
110 | | -# df = pd.DataFrame( |
111 | | -# { |
112 | | -# "build_time": build_times, |
113 | | -# "opt_time": opt_times, |
114 | | -# "objval": objvals, |
115 | | -# } |
116 | | -# ) |
117 | | -# df.to_csv( |
118 | | -# os.path.join( |
119 | | -# folder_dir, |
120 | | -# f"branch{prefix_name}_{inputs.model_name}_{sim_horizon}_modelstats.csv", |
121 | | -# ), |
122 | | -# index=False, |
123 | | -# ) |
0 commit comments