Skip to content

Commit a171e3b

Browse files
Merge branch 'main' into df/#360-vector-traces
# Conflicts: # poetry.lock
2 parents 09d27b1 + 4cc4814 commit a171e3b

29 files changed

+97
-92
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ All notable changes to this project will be documented in this file.
1717

1818
### Fixed
1919
- Removed `q_characteristics` from `create_energy_management_systems_data` [#326](https://github.com/ie3-institute/pypsdm/issues/326)
20-
- Fix emInput from parent_em to controlling_em [#333](https://github.com/ie3-institute/pypsdm/issues/333)
20+
- Fix `emInput` from `parent_em` to `controlling_em` [#333](https://github.com/ie3-institute/pypsdm/issues/333)
21+
- Fix also from `em` to `controlling_em` for all `SystemParticipants` [#337](https://github.com/ie3-institute/pypsdm/issues/337)
2122

2223

2324
## 0.0.6

nbs/create_grid.ipynb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
" \"control_strategy\": [\"PRIORITIZED\", \"PRIORITIZED\", \"PRIORITIZED\"],\n",
7979
"}\n",
8080
"\n",
81-
"emss = create_energy_management_systems(data_dict)"
81+
"controlling_emss = create_energy_management_systems(data_dict)"
8282
]
8383
},
8484
{
@@ -97,7 +97,7 @@
9797
" \"s_rated\": pv_s_rated,\n",
9898
" \"azimuth\": [90, 0, -90],\n",
9999
" \"elevation_angle\": [40, 45, 30],\n",
100-
" \"em\": em_uuids,\n",
100+
" \"controlling_em\": em_uuids,\n",
101101
"}\n",
102102
"\n",
103103
"pvs = create_pvs(data_dict)"
@@ -116,7 +116,7 @@
116116
" \"id\": [\"BS_NS_02\", \"BS_NS_03\", \"BS_NS_04\"],\n",
117117
" \"node\": [node_2, node_3, node_4],\n",
118118
" \"e_storage\": [1.5 * pv_power for pv_power in pv_s_rated],\n",
119-
" \"em\": em_uuids,\n",
119+
" \"controlling_em\": em_uuids,\n",
120120
"}\n",
121121
"\n",
122122
"bs = create_storages(data_dict)"
@@ -163,7 +163,7 @@
163163
" EvcsLocationType.HOME.value,\n",
164164
" ],\n",
165165
" \"s_rated\": [10, 10, 10],\n",
166-
" \"em\": em_uuids,\n",
166+
" \"controlling_em\": em_uuids,\n",
167167
"}\n",
168168
"\n",
169169
"evcs = create_ev_charging_stations(data_dict)"
@@ -208,7 +208,7 @@
208208
" \"node\": [node_2, node_3, node_4],\n",
209209
" \"thermal_bus\": list(tbs.uuid),\n",
210210
" \"s_rated\": [4, 3, 6],\n",
211-
" \"em\": em_uuids,\n",
211+
" \"controlling_em\": em_uuids,\n",
212212
"}\n",
213213
"\n",
214214
"hps = create_heat_pumps(data_dict)"
@@ -248,7 +248,7 @@
248248
" \"s_rated\": [3, 3, 3],\n",
249249
" \"e_cons_annual\": [3000, 3500, 4000],\n",
250250
" \"load_profile\": [\"h0\", \"h0\", \"h0\"],\n",
251-
" \"em\": em_uuids,\n",
251+
" \"controlling_em\": em_uuids,\n",
252252
"}\n",
253253
"\n",
254254
"loads = create_loads(load_data_dict)"
@@ -268,7 +268,7 @@
268268
"\n",
269269
"\n",
270270
"participants = SystemParticipantsContainer(\n",
271-
" ems=EnergyManagementSystems.create_empty(),\n",
271+
" controlling_ems=EnergyManagementSystems.create_empty(),\n",
272272
" loads=loads,\n",
273273
" pvs=pvs,\n",
274274
" storages=bs,\n",
@@ -313,7 +313,7 @@
313313
"outputs": [],
314314
"source": [
315315
"updated_participants = SystemParticipantsContainer(\n",
316-
" emss,\n",
316+
" controlling_emss,\n",
317317
" participants.loads,\n",
318318
" participants.fixed_feed_ins,\n",
319319
" participants.pvs,\n",

nbs/enrich_simbench_grid.ipynb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3104,7 +3104,7 @@
31043104
" \"s_rated\": load_input_params[3],\n",
31053105
" \"e_cons_annual\": load_input_params[4],\n",
31063106
" \"load_profile\": load_input_params[5],\n",
3107-
" \"em\": load_input_params[6],\n",
3107+
" \"controlling_em\": load_input_params[6],\n",
31083108
"}\n",
31093109
"\n",
31103110
"loads = create_loads(load_data_dict)"
@@ -3131,7 +3131,7 @@
31313131
" \"azimuth\": pv_input_params[2],\n",
31323132
" \"elevation_angle\": pv_input_params[3],\n",
31333133
" \"uuid\": pv_input_params[5],\n",
3134-
" \"em\": pv_input_params[6],\n",
3134+
" \"controlling_em\": pv_input_params[6],\n",
31353135
"}\n",
31363136
"\n",
31373137
"pvs = create_pvs(data_dict)"
@@ -3172,7 +3172,7 @@
31723172
" \"s_rated\": evcs_params[4],\n",
31733173
" \"uuid\": evcs_params[1],\n",
31743174
" \"v2g_support\": evcs_params[5],\n",
3175-
" \"em\": evcs_params[6],\n",
3175+
" \"controlling_em\": evcs_params[6],\n",
31763176
"}\n",
31773177
"\n",
31783178
"evcs = create_ev_charging_stations(data_dict)"
@@ -3197,7 +3197,7 @@
31973197
" \"uuid\": storage_params[1],\n",
31983198
" \"node\": storage_params[2],\n",
31993199
" \"e_storage\": storage_params[3],\n",
3200-
" \"em\": storage_params[4],\n",
3200+
" \"controlling_em\": storage_params[4],\n",
32013201
"}\n",
32023202
"\n",
32033203
"bs = create_storages(data_dict)"
@@ -3224,7 +3224,7 @@
32243224
" \"control_strategy\": em_params[3],\n",
32253225
"}\n",
32263226
"\n",
3227-
"emss = create_energy_management_systems(data_dict)"
3227+
"controlling_emss = create_energy_management_systems(data_dict)"
32283228
],
32293229
"id": "40b9651a2b2602fb",
32303230
"outputs": [],
@@ -3246,7 +3246,7 @@
32463246
"from pypsdm.models.input.participant.hp import HeatPumps\n",
32473247
"\n",
32483248
"participants = SystemParticipantsContainer(\n",
3249-
" ems=emss,\n",
3249+
" controlling_ems=controlling_emss,\n",
32503250
" loads=loads,\n",
32513251
" pvs=pvs,\n",
32523252
" storages=bs,\n",
@@ -3283,7 +3283,7 @@
32833283
" participant_uuids.extend(list(current.uuid))\n",
32843284
" node_connected_assets[node] = participant_uuids\n",
32853285
"updated_participants = SystemParticipantsContainer(\n",
3286-
" emss,\n",
3286+
" controlling_emss,\n",
32873287
" participants.loads,\n",
32883288
" participants.fixed_feed_ins,\n",
32893289
" participants.pvs,\n",

poetry.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ black = { extras = ["jupyter"], version = "~25.1.0" }
3131
flake8 = "^7.3.0"
3232
flake8-black = "^0.3.6"
3333
flake8-isort = "^6.0.0"
34-
pre-commit = "~=4.2.0"
34+
pre-commit = "~=4.3.0"
3535
PyYAML = "^6.0"
3636
deptry = "^0.23.1" # find unused dependencies
3737

pypsdm/models/gwr.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ def switches(self):
5353
return self.grid.switches
5454

5555
@property
56-
def ems(self):
57-
return self.participants.ems
56+
def controlling_ems(self):
57+
return self.participants.controlling_ems
5858

5959
@property
6060
def loads(self):
@@ -117,8 +117,8 @@ def participants_res(self):
117117
return self.results.participants
118118

119119
@property
120-
def ems_res(self):
121-
return self.participants_res.ems
120+
def controlling_ems_res(self):
121+
return self.participants_res.controlling_ems
122122

123123
@property
124124
def loads_res(self):
@@ -181,10 +181,10 @@ def nodal_result(self, node_uuid: str) -> "GridResultContainer":
181181
participants=participants,
182182
)
183183

184-
def em_results(
184+
def controlling_em_results(
185185
self,
186186
) -> list[Tuple[SystemParticipantsContainer, SystemParticipantsResultContainer]]:
187-
uuid_to_connected_asset = self.ems.uuid_to_connected_assets()
187+
uuid_to_connected_asset = self.controlling_ems.uuid_to_connected_assets()
188188
return [
189189
(
190190
self.participants.subset(connected_assets + [em_uuid]),

pypsdm/models/input/container/grid.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ def switches(self):
5656
return self.raw_grid.switches
5757

5858
@property
59-
def ems(self):
60-
return self.participants.ems
59+
def controlling_ems(self):
60+
return self.participants.controlling_ems
6161

6262
@property
6363
def loads(self):

pypsdm/models/input/container/participants.py

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
@dataclass(frozen=True)
2525
class SystemParticipantsContainer(ContainerMixin):
26-
ems: EnergyManagementSystems
26+
controlling_ems: EnergyManagementSystems
2727
loads: Loads
2828
fixed_feed_ins: FixedFeedIns
2929
pvs: PhotovoltaicPowerPlants
@@ -36,7 +36,7 @@ class SystemParticipantsContainer(ContainerMixin):
3636

3737
def to_list(self, include_empty=False) -> list[Entities]:
3838
participants = [
39-
self.ems,
39+
self.controlling_ems,
4040
self.loads,
4141
self.fixed_feed_ins,
4242
self.pvs,
@@ -74,20 +74,22 @@ def filter_by_nodes(
7474

7575
em_uuids = pd.concat(
7676
[
77-
loads.em,
78-
fixed_feed_ins.em,
79-
pvs.em,
80-
biomass_plants.em,
81-
wecs.em,
82-
storages.em,
83-
evcs.em,
84-
hps.em,
77+
loads.controlling_em,
78+
fixed_feed_ins.controlling_em,
79+
pvs.controlling_em,
80+
biomass_plants.controlling_em,
81+
wecs.controlling_em,
82+
storages.controlling_em,
83+
evcs.controlling_em,
84+
hps.controlling_em,
8585
]
8686
)
87-
ems = EnergyManagementSystems(self.ems.data[self.ems.data.index.isin(em_uuids)])
87+
controlling_ems = EnergyManagementSystems(
88+
self.controlling_ems.data[self.controlling_ems.data.index.isin(em_uuids)]
89+
)
8890

8991
return SystemParticipantsContainer(
90-
ems,
92+
controlling_ems,
9193
loads,
9294
fixed_feed_ins,
9395
pvs,
@@ -101,7 +103,7 @@ def filter_by_nodes(
101103

102104
def get_with_enum(self, sp_type: EntitiesEnum) -> Entities | None:
103105
if sp_type == SystemParticipantsEnum.ENERGY_MANAGEMENT:
104-
return self.ems
106+
return self.controlling_ems
105107
elif sp_type == SystemParticipantsEnum.LOAD:
106108
return self.loads
107109
elif sp_type == SystemParticipantsEnum.BIOMASS_PLANT:
@@ -134,8 +136,8 @@ def find_participant(self, uuid: str) -> Series:
134136
return self.wecs.get(uuid)
135137
elif uuid in self.biomass_plants:
136138
return self.biomass_plants.get(uuid)
137-
elif uuid in self.ems:
138-
return self.ems.get(uuid)
139+
elif uuid in self.controlling_ems:
140+
return self.controlling_ems.get(uuid)
139141
elif uuid in self.storages:
140142
return self.storages.get(uuid)
141143
elif uuid in self.evs:
@@ -156,7 +158,7 @@ def uuids(self):
156158

157159
def subset(self, uuids):
158160
return SystemParticipantsContainer(
159-
self.ems.subset(uuids, intersection=True),
161+
self.controlling_ems.subset(uuids, intersection=True),
160162
self.loads.subset(uuids, intersection=True),
161163
self.fixed_feed_ins.subset(uuids, intersection=True),
162164
self.pvs.subset(uuids, intersection=True),
@@ -178,12 +180,14 @@ def from_csv(
178180
biomass_plants = BiomassPlants.from_csv(path, delimiter, must_exist=False)
179181
wecs = WindEnergyConverters.from_csv(path, delimiter, must_exist=False)
180182
storages = Storages.from_csv(path, delimiter, must_exist=False)
181-
ems = EnergyManagementSystems.from_csv(path, delimiter, must_exist=False)
183+
controlling_ems = EnergyManagementSystems.from_csv(
184+
path, delimiter, must_exist=False
185+
)
182186
evs = ElectricVehicles.from_csv(path, delimiter, must_exist=False)
183187
evcs = EvChargingStations.from_csv(path, delimiter, must_exist=False)
184188
hps = HeatPumps.from_csv(path, delimiter, must_exist=False)
185189
return SystemParticipantsContainer(
186-
ems,
190+
controlling_ems,
187191
loads,
188192
fixed_feed_ins,
189193
pvs,
@@ -198,7 +202,7 @@ def from_csv(
198202
@classmethod
199203
def create(
200204
cls,
201-
ems=EnergyManagementSystems.create_empty(),
205+
controlling_ems=EnergyManagementSystems.create_empty(),
202206
loads=Loads.create_empty(),
203207
fixed_feed_ins=FixedFeedIns.create_empty(),
204208
pvs=PhotovoltaicPowerPlants.create_empty(),
@@ -210,7 +214,7 @@ def create(
210214
hps=HeatPumps.create_empty(),
211215
):
212216
return cls(
213-
ems=ems,
217+
controlling_ems=controlling_ems,
214218
loads=loads,
215219
fixed_feed_ins=fixed_feed_ins,
216220
pvs=pvs,

0 commit comments

Comments
 (0)