Skip to content

Commit e845420

Browse files
authored
Merge pull request #283 from ie3-institute/df/#281-fix-create-grid
Fix create_grid notebook to psdm changes with respect to em
2 parents cb86d10 + 577ca64 commit e845420

File tree

3 files changed

+32
-27
lines changed

3 files changed

+32
-27
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ All notable changes to this project will be documented in this file.
1919
- Adapt to recent PSDM changes with regard to energy management systems [#164](https://github.com/ie3-institute/pypsdm/issue/164)
2020
- Removed node from create method of energy management systems [#267](https://github.com/ie3-institute/pypsdm/issue/267)
2121
- Changed default value for `cos_Phi` of create method of `ElectricVehicleChargingStations` to 1.0 [#272](https://github.com/ie3-institute/pypsdm/issue/272)
22+
- Fix `create_grid` notebook to PSDM changes with respect to Em [#281](https://github.com/ie3-institute/pypsdm/issues/281)
2223

2324
### Removed
2425

nbs/create_grid.ipynb

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,26 @@
6464
"metadata": {},
6565
"outputs": [],
6666
"source": [
67-
"from pypsdm.models.input.create.participants import create_pvs\n",
67+
"from pypsdm.models.input.create.participants import create_energy_management_systems\n",
68+
"\n",
69+
"em_uuids = [\"74d45b31-c35b-403b-96ac-5210754eb4de\",\"093e03ee-2d38-4e91-9f44-c71d92c07d89\",\"22af972d-19a8-415d-8c0a-50fa1238a7d9\"]\n",
6870
"\n",
69-
"from pypsdm.models.input.participant.pv import PhotovoltaicPowerPlants\n",
71+
"data_dict = {\n",
72+
" \"uuid\": em_uuids,\n",
73+
" \"id\": [\"EMS_NS_02\", \"EMS_NS_03\", \"EMS_NS_04\"],\n",
74+
" \"control_strategy\": [\"PRIORITIZED\", \"PRIORITIZED\", \"PRIORITIZED\"],\n",
75+
"}\n",
76+
"\n",
77+
"emss = create_energy_management_systems(data_dict)"
78+
]
79+
},
80+
{
81+
"cell_type": "code",
82+
"execution_count": null,
83+
"metadata": {},
84+
"outputs": [],
85+
"source": [
86+
"from pypsdm.models.input.create.participants import create_pvs\n",
7087
"\n",
7188
"pv_s_rated = [4, 6, 10]\n",
7289
"\n",
@@ -76,6 +93,7 @@
7693
" \"s_rated\": pv_s_rated,\n",
7794
" \"azimuth\": [90, 0, -90],\n",
7895
" \"elevation_angle\": [40, 45, 30],\n",
96+
" \"em\": em_uuids,\n",
7997
"}\n",
8098
"\n",
8199
"pvs = create_pvs(data_dict)"
@@ -94,6 +112,7 @@
94112
" \"id\": [\"BS_NS_02\", \"BS_NS_03\", \"BS_NS_04\"],\n",
95113
" \"node\": [node_2, node_3, node_4],\n",
96114
" \"e_storage\": [1.5 * pv_power for pv_power in pv_s_rated],\n",
115+
" \"em\": em_uuids,\n",
97116
"}\n",
98117
"\n",
99118
"bs = create_storages(data_dict)"
@@ -114,6 +133,7 @@
114133
" \"id\": [\"EV_NS_02\", \"EV_NS_03\", \"EV_NS_04\"],\n",
115134
" \"node\": [node_2, node_3, node_4],\n",
116135
" \"s_rated\": ev_s_rated,\n",
136+
" \"s_ratedDC\": ev_s_rated,\n",
117137
" \"e_storage\": [80, 70, 100],\n",
118138
" \"e_cons\": [20, 16, 19],\n",
119139
"}\n",
@@ -127,7 +147,6 @@
127147
"metadata": {},
128148
"outputs": [],
129149
"source": [
130-
"from pipes import Template\n",
131150
"from pypsdm.models.input.create.participants import create_ev_charging_stations\n",
132151
"from pypsdm.models.input.participant.evcs import EvcsLocationType\n",
133152
"\n",
@@ -140,6 +159,7 @@
140159
" EvcsLocationType.HOME.value,\n",
141160
" ],\n",
142161
" \"s_rated\": [10, 10, 10],\n",
162+
" \"em\": em_uuids,\n",
143163
"}\n",
144164
"\n",
145165
"evcs = create_ev_charging_stations(data_dict)"
@@ -184,6 +204,7 @@
184204
" \"node\": [node_2, node_3, node_4],\n",
185205
" \"thermal_bus\": list(tbs.uuid),\n",
186206
" \"s_rated\": [4, 3, 6],\n",
207+
" \"em\": em_uuids,\n",
187208
"}\n",
188209
"\n",
189210
"hps = create_heat_pumps(data_dict)"
@@ -223,6 +244,7 @@
223244
" \"s_rated\": [3, 3, 3],\n",
224245
" \"e_cons_annual\": [3000, 3500, 4000],\n",
225246
" \"load_profile\": [\"h0\", \"h0\", \"h0\"],\n",
247+
" \"em\": em_uuids,\n",
226248
"}\n",
227249
"\n",
228250
"loads = create_loads(load_data_dict)"
@@ -238,7 +260,6 @@
238260
"from pypsdm.models.input.participant.bm import BiomassPlants\n",
239261
"from pypsdm.models.input.participant.em import EnergyManagementSystems\n",
240262
"from pypsdm.models.input.participant.fixed_feed_in import FixedFeedIns\n",
241-
"from pypsdm.models.input.participant.load import Loads\n",
242263
"from pypsdm.models.input.participant.wec import WindEnergyConverters\n",
243264
"\n",
244265
"\n",
@@ -281,27 +302,6 @@
281302
" node_connected_assets[node] = participant_uuids"
282303
]
283304
},
284-
{
285-
"cell_type": "code",
286-
"execution_count": null,
287-
"metadata": {},
288-
"outputs": [],
289-
"source": [
290-
"from pypsdm.models.input.create.participants import create_energy_management_systems\n",
291-
"\n",
292-
"\n",
293-
"data_dict = {\n",
294-
" \"id\": [\"EMS_NS_02\", \"EMS_NS_03\", \"EMS_NS_04\"],\n",
295-
" \"node\": [node_2, node_3, node_4],\n",
296-
" \"connected_assets\": [\n",
297-
" node_connected_assets[node] for node in [node_2, node_3, node_4]\n",
298-
" ],\n",
299-
" \"control_strategy\": [\"self_optimization\", \"self_optimization\", \"self_optimization\"],\n",
300-
"}\n",
301-
"\n",
302-
"emss = create_energy_management_systems(data_dict)"
303-
]
304-
},
305305
{
306306
"cell_type": "code",
307307
"execution_count": null,
@@ -354,6 +354,10 @@
354354
"metadata": {},
355355
"outputs": [],
356356
"source": [
357+
"import os\n",
358+
"\n",
359+
"if not os.path.exists(target_grid_path):\n",
360+
" os.mkdir(target_grid_path)\n",
357361
"updated_grid.to_csv(target_grid_path, include_primary_data=False)\n",
358362
"tg.to_csv(target_grid_path)"
359363
]
@@ -362,7 +366,7 @@
362366
"cell_type": "markdown",
363367
"metadata": {},
364368
"source": [
365-
"# EV Mobility Points of Interest"
369+
"# EV Mobility Points of Interest\n"
366370
]
367371
},
368372
{

pypsdm/models/input/create/participants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ def create_heat_pumps_data(
300300
"s_rated": s_rated,
301301
"cos_phi_rated": cos_phi_rated,
302302
"p_thermal": p_thermal,
303-
"em=": em,
303+
"em": em,
304304
}
305305
).rename(uuid)
306306

0 commit comments

Comments
 (0)