Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions edisgo/flex_opt/battery_storage_operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,41 @@ def apply_reference_operation(
if storage_units_names is None:
storage_units_names = edisgo_obj.topology.storage_units_df.index

if (
edisgo_obj.topology.storage_units_df.loc[
storage_units_names, "efficiency_store"
]
.isna()
.all()
):
logger.warning(
"The efficiency of storage units charge is not specified in the "
"storage_units_df. By default, it is set to 95%. To change this behavior, "
"first set the 'efficiency_store' parameter in topology.storage_units_df."
)

edisgo_obj.topology.storage_units_df.loc[
storage_units_names, "efficiency_store"
] = 0.95

if (
edisgo_obj.topology.storage_units_df.loc[
storage_units_names, "efficiency_dispatch"
]
.isna()
.all()
):
logger.warning(
"The efficiency of storage units discharge is not specified in the "
"storage_units_df. By default, it is set to 95%. To change this behavior, "
"first set the 'efficiency_dispatch' parameter in "
"topology.storage_units_df."
)

edisgo_obj.topology.storage_units_df.loc[
storage_units_names, "efficiency_dispatch"
] = 0.95

storage_units = edisgo_obj.topology.storage_units_df.loc[storage_units_names]
soe_df = pd.DataFrame(index=edisgo_obj.timeseries.timeindex)

Expand Down
8 changes: 7 additions & 1 deletion edisgo/io/storage_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,13 @@ def home_batteries_oedb(
)
batteries_df = pd.read_sql(sql=query.statement, con=engine, index_col=None)

return _home_batteries_grid_integration(edisgo_obj, batteries_df)
names = _home_batteries_grid_integration(edisgo_obj, batteries_df)

edisgo_obj.topology.storage_units_df.building_id = (
edisgo_obj.topology.storage_units_df.building_id.astype(int)
)

return names


def _home_batteries_grid_integration(edisgo_obj, batteries_df):
Expand Down
2 changes: 1 addition & 1 deletion examples/edisgo_simple_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.5"
"version": "3.11.0"
},
"toc": {
"base_numbering": 1,
Expand Down
Loading