domainiac 4.0.0__tar.gz → 6.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {domainiac-4.0.0 → domainiac-6.0.0}/PKG-INFO +1 -1
- {domainiac-4.0.0 → domainiac-6.0.0}/domainiac/managers/metering_manager.py +1 -1
- {domainiac-4.0.0 → domainiac-6.0.0}/domainiac/managers/nwp_manager.py +4 -1
- {domainiac-4.0.0 → domainiac-6.0.0}/domainiac/managers/plant_manager.py +27 -6
- {domainiac-4.0.0 → domainiac-6.0.0}/pyproject.toml +1 -1
- {domainiac-4.0.0 → domainiac-6.0.0}/domainiac/__init__.py +0 -0
- {domainiac-4.0.0 → domainiac-6.0.0}/domainiac/managers/__init__.py +0 -0
- {domainiac-4.0.0 → domainiac-6.0.0}/domainiac/managers/masterdata_manager.py +0 -0
- {domainiac-4.0.0 → domainiac-6.0.0}/domainiac/managers/resource_manager.py +0 -0
- {domainiac-4.0.0 → domainiac-6.0.0}/domainiac/managers/unit_manager.py +0 -0
- {domainiac-4.0.0 → domainiac-6.0.0}/domainiac/modeling/__init__.py +0 -0
- {domainiac-4.0.0 → domainiac-6.0.0}/domainiac/modeling/nwp.py +0 -0
- {domainiac-4.0.0 → domainiac-6.0.0}/domainiac/modeling/plant.py +0 -0
- {domainiac-4.0.0 → domainiac-6.0.0}/domainiac/wrappers/__init__.py +0 -0
- {domainiac-4.0.0 → domainiac-6.0.0}/domainiac/wrappers/cache_wrapper.py +0 -0
@@ -182,10 +182,13 @@ class NWPManager:
|
|
182
182
|
df = df.drop(
|
183
183
|
columns=[
|
184
184
|
"created_time_utc",
|
185
|
+
"valid_from_time_utc",
|
186
|
+
"valid_to_time_utc",
|
185
187
|
"altitude_m",
|
186
188
|
"longitude",
|
187
189
|
"latitude",
|
188
|
-
]
|
190
|
+
],
|
191
|
+
errors="ignore",
|
189
192
|
)
|
190
193
|
|
191
194
|
return df
|
@@ -41,14 +41,14 @@ class PlantManager(MasterdataManager):
|
|
41
41
|
"is_tso_connected",
|
42
42
|
"valid_from_date_utc",
|
43
43
|
"valid_to_date_utc",
|
44
|
-
"
|
44
|
+
"primary_net_component_id",
|
45
45
|
]
|
46
46
|
if not columns:
|
47
47
|
columns = default_columns
|
48
48
|
|
49
49
|
# TODO: masterdata_plant table doesn't have net_component_id column
|
50
50
|
# Find a better way to do this in future.
|
51
|
-
plant_columns = [col for col in columns if col != "
|
51
|
+
plant_columns = [col for col in columns if col != "primary_net_component_id"]
|
52
52
|
df_plant = self.get_data(
|
53
53
|
"masterdataPlant", filters=filters, columns=plant_columns
|
54
54
|
)
|
@@ -119,14 +119,14 @@ class PlantManager(MasterdataManager):
|
|
119
119
|
|
120
120
|
def _get_power_system_resource(self) -> pd.DataFrame:
|
121
121
|
|
122
|
-
df_unit = self.unit_manager.get_units(
|
122
|
+
df_unit = self.unit_manager.get_units(
|
123
|
+
columns=["masterdata_gsrn", "capacity_min_MW", "capacity_max_MW"]
|
124
|
+
)
|
123
125
|
|
124
126
|
df_psr_mapping = self.db.query("masterdataAggregatedUnit")[
|
125
127
|
["unit_gsrn", "net_component_id"]
|
126
128
|
]
|
127
129
|
|
128
|
-
df_unit = df_unit[["masterdata_gsrn", "plant_id"]]
|
129
|
-
|
130
130
|
df = pd.merge(
|
131
131
|
df_psr_mapping,
|
132
132
|
df_unit,
|
@@ -134,6 +134,27 @@ class PlantManager(MasterdataManager):
|
|
134
134
|
right_on="masterdata_gsrn",
|
135
135
|
how="left",
|
136
136
|
validate="1:m",
|
137
|
-
)
|
137
|
+
)
|
138
|
+
|
139
|
+
# for a small number of plants, the underlying unit can
|
140
|
+
# be associated with different net components. Too avoid
|
141
|
+
# this issue, we choose for each plant, the net component,
|
142
|
+
# for which the underlying units amounts to the largest
|
143
|
+
# capacity
|
144
|
+
df = pdz.group(df, by=["net_component_id", "plant_id"]).agg(
|
145
|
+
{"capacity_min_MW": "sum", "capacity_max_MW": "sum"}
|
146
|
+
)
|
147
|
+
|
148
|
+
df["capacity_range_MW"] = df["capacity_max_MW"] - df["capacity_min_MW"]
|
149
|
+
|
150
|
+
df = df.sort_values(
|
151
|
+
["plant_id", "capacity_range_MW"], ascending=False
|
152
|
+
).drop_duplicates(subset=["plant_id"], keep="first")
|
153
|
+
|
154
|
+
df = df.rename(
|
155
|
+
columns={
|
156
|
+
"net_component_id": "primary_net_component_id",
|
157
|
+
}
|
158
|
+
)
|
138
159
|
|
139
160
|
return df
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|