Daniel Varga commited on
Commit
cd31c8b
·
1 Parent(s): 97b4bca

comment edits

Browse files
Files changed (1) hide show
  1. v2/app.py +4 -8
v2/app.py CHANGED
@@ -22,9 +22,6 @@ from bess import BatteryParameters, BatteryModel
22
  met_2021_data, cons_2021_data = read_datasets()
23
 
24
 
25
- # TODO move out everything that should not be recalculated.
26
- # TODO actually use uiParameters. (base_price and peak_price were just to mock up the Accordion gui.)
27
- # TODO ui_refresh spawns its own Supplier, which is just dumb.
28
  # TODO some gui to upload consumption data.
29
  # and maybe solar data? but we don't have a solar data -> production model built in. just scale and switch years from a dropdown?
30
  def recalculate(ui):
@@ -67,8 +64,6 @@ def recalculate(ui):
67
  if ui.fixed_consumption_kW is not None:
68
  all_data['Consumption'] = ui.fixed_consumption_kW
69
 
70
- print("Working with", solar_parameters.solar_cell_num, "solar cells, that's a maximum production of", all_data['Production'].max(), "kW.")
71
-
72
  all_data_with_predictions = all_data.copy()
73
  add_dummy_predictions(all_data_with_predictions)
74
 
@@ -90,7 +85,7 @@ def recalculate(ui):
90
 
91
 
92
  # that's very error-prone, sorry. must be kept in sync with the gradio button click call.
93
- # secondarily, with recalculate().
94
  def list_to_namespace(
95
  solar_cell_num, solar_cell_nominal_capacity,
96
  bess_capacity_Ah, bess_voltage_V, bess_charge_kW, bess_discharge_kW,
@@ -112,9 +107,10 @@ def list_to_namespace(
112
 
113
  def create_supplier(ui):
114
  supplier = Supplier(price=ui.base_price_HUFpkWh)
115
- supplier.set_price_for_daily_interval_on_workdays(start=6, end=22, price=ui.peak_price_HUFpkWh)
116
  return supplier
117
 
 
118
  def ui_refresh(
119
  solar_cell_num, solar_cell_nominal_capacity,
120
  bess_capacity_Ah, bess_voltage_V, bess_charge_kW, bess_discharge_kW,
@@ -149,7 +145,7 @@ def ui_refresh(
149
  supplier = create_supplier(ui)
150
 
151
  fee = supplier.fee(results["consumption_from_network"])
152
- html += f"<tr><td>{fee/1e6:.3f} million HUF billed by energy supplier</td></tr>\n"
153
 
154
  html += "</table>"
155
 
 
22
  met_2021_data, cons_2021_data = read_datasets()
23
 
24
 
 
 
 
25
  # TODO some gui to upload consumption data.
26
  # and maybe solar data? but we don't have a solar data -> production model built in. just scale and switch years from a dropdown?
27
  def recalculate(ui):
 
64
  if ui.fixed_consumption_kW is not None:
65
  all_data['Consumption'] = ui.fixed_consumption_kW
66
 
 
 
67
  all_data_with_predictions = all_data.copy()
68
  add_dummy_predictions(all_data_with_predictions)
69
 
 
85
 
86
 
87
  # that's very error-prone, sorry. must be kept in sync with the gradio button click call.
88
+ # with recalculate(), as well.
89
  def list_to_namespace(
90
  solar_cell_num, solar_cell_nominal_capacity,
91
  bess_capacity_Ah, bess_voltage_V, bess_charge_kW, bess_discharge_kW,
 
107
 
108
  def create_supplier(ui):
109
  supplier = Supplier(price=ui.base_price_HUFpkWh)
110
+ supplier.set_price_for_daily_interval_on_workdays(start=6, end=18, price=ui.peak_price_HUFpkWh)
111
  return supplier
112
 
113
+
114
  def ui_refresh(
115
  solar_cell_num, solar_cell_nominal_capacity,
116
  bess_capacity_Ah, bess_voltage_V, bess_charge_kW, bess_discharge_kW,
 
145
  supplier = create_supplier(ui)
146
 
147
  fee = supplier.fee(results["consumption_from_network"])
148
+ html += f"<tr><td>Network energy usage charge:</td><td>{fee/1e6:.3f} million HUF</td></tr>\n"
149
 
150
  html += "</table>"
151