-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Heat pump active power was determined regardless its maximum power. N… #428
base: dev
Are you sure you want to change the base?
Changes from all commits
c85e531
7b3c4f5
9a72fdb
9ddbf08
191bc1c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import copy | ||
import logging | ||
|
||
import pandas as pd | ||
|
@@ -31,11 +32,37 @@ def operating_strategy( | |
if heat_pump_names is None: | ||
heat_pump_names = edisgo_obj.heat_pump.cop_df.columns | ||
|
||
missing = set(heat_pump_names) - set(edisgo_obj.topology.loads_df.index) | ||
if missing: | ||
logger.warning( | ||
f"The following heat pumps are are in the heat pump class but not yet " | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove double "are" |
||
f"integrated into the topology class. Therefore, their maximum capacity " | ||
f"cannot be considered in the operating strategies. {missing=}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a note similar to "For better results, please integrate these heat pumps into the topology before running this function.". |
||
) | ||
|
||
if strategy == "uncontrolled": | ||
ts = ( | ||
edisgo_obj.heat_pump.heat_demand_df.loc[:, heat_pump_names] | ||
/ edisgo_obj.heat_pump.cop_df.loc[:, heat_pump_names] | ||
) | ||
|
||
ts_prev = copy.deepcopy(ts) | ||
|
||
# clips heat pump load at maximum level | ||
in_topology = list(set(heat_pump_names) - set(missing)) | ||
|
||
ts_clipped = ts[in_topology].clip( | ||
upper=edisgo_obj.topology.loads_df.p_set[in_topology].values | ||
) | ||
ts[in_topology] = ts_clipped[in_topology] | ||
|
||
clipped = ts.eq(ts_prev).all()[lambda x: ~x].index | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be more readable py using |
||
logger.warning( | ||
f"Heat pump power at {clipped} was " | ||
f"clipped at its maximum capacity. The heat demand at this bus " | ||
f"should be covered by additional heat sources." | ||
) | ||
|
||
edisgo_obj.timeseries.add_component_time_series( | ||
"loads_active_power", | ||
ts, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -149,6 +149,7 @@ def _get_central_heat_pump_or_resistive_heaters(carrier): | |
<= edisgo_object.config["grid_connection"]["upper_limit_voltage_level_4"], | ||
) | ||
df = pd.read_sql(query.statement, engine, index_col=None) | ||
# Alternativ Code einfügen, falls Tabelle leer ist | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove this temp comment |
||
if not df.empty: | ||
# get geom of heat bus, weather_cell_id, district_heating_id and area_id | ||
srid_etrago_bus = db.get_srid_of_db_table(session, egon_etrago_bus.geom) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs to be correctly formatted