domainiac 2.0.1__tar.gz → 4.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-2.0.1 → domainiac-4.0.0}/PKG-INFO +1 -1
- {domainiac-2.0.1 → domainiac-4.0.0}/domainiac/managers/plant_manager.py +17 -10
- {domainiac-2.0.1 → domainiac-4.0.0}/pyproject.toml +1 -1
- {domainiac-2.0.1 → domainiac-4.0.0}/domainiac/__init__.py +0 -0
- {domainiac-2.0.1 → domainiac-4.0.0}/domainiac/managers/__init__.py +0 -0
- {domainiac-2.0.1 → domainiac-4.0.0}/domainiac/managers/masterdata_manager.py +0 -0
- {domainiac-2.0.1 → domainiac-4.0.0}/domainiac/managers/metering_manager.py +0 -0
- {domainiac-2.0.1 → domainiac-4.0.0}/domainiac/managers/nwp_manager.py +0 -0
- {domainiac-2.0.1 → domainiac-4.0.0}/domainiac/managers/resource_manager.py +0 -0
- {domainiac-2.0.1 → domainiac-4.0.0}/domainiac/managers/unit_manager.py +0 -0
- {domainiac-2.0.1 → domainiac-4.0.0}/domainiac/modeling/__init__.py +0 -0
- {domainiac-2.0.1 → domainiac-4.0.0}/domainiac/modeling/nwp.py +0 -0
- {domainiac-2.0.1 → domainiac-4.0.0}/domainiac/modeling/plant.py +0 -0
- {domainiac-2.0.1 → domainiac-4.0.0}/domainiac/wrappers/__init__.py +0 -0
- {domainiac-2.0.1 → domainiac-4.0.0}/domainiac/wrappers/cache_wrapper.py +0 -0
@@ -41,17 +41,24 @@ class PlantManager(MasterdataManager):
|
|
41
41
|
"is_tso_connected",
|
42
42
|
"valid_from_date_utc",
|
43
43
|
"valid_to_date_utc",
|
44
|
+
"net_component_id",
|
44
45
|
]
|
45
46
|
if not columns:
|
46
47
|
columns = default_columns
|
47
|
-
else:
|
48
|
-
columns = list(set(default_columns + columns))
|
49
48
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
49
|
+
# TODO: masterdata_plant table doesn't have net_component_id column
|
50
|
+
# Find a better way to do this in future.
|
51
|
+
plant_columns = [col for col in columns if col != "net_component_id"]
|
52
|
+
df_plant = self.get_data(
|
53
|
+
"masterdataPlant", filters=filters, columns=plant_columns
|
54
|
+
)
|
55
|
+
df_psr = self._get_power_system_resource()
|
56
|
+
df = df_plant.merge(
|
57
|
+
df_psr, on=["plant_id"], how="left", validate="m:1"
|
54
58
|
).drop_duplicates()
|
59
|
+
|
60
|
+
df = df[columns]
|
61
|
+
|
55
62
|
return df
|
56
63
|
|
57
64
|
def get_installed_power_timeseries(self, gsrn: str) -> pd.DataFrame:
|
@@ -110,22 +117,22 @@ class PlantManager(MasterdataManager):
|
|
110
117
|
|
111
118
|
return df
|
112
119
|
|
113
|
-
def
|
120
|
+
def _get_power_system_resource(self) -> pd.DataFrame:
|
114
121
|
|
115
122
|
df_unit = self.unit_manager.get_units(columns=["masterdata_gsrn"])
|
116
123
|
|
117
|
-
|
124
|
+
df_psr_mapping = self.db.query("masterdataAggregatedUnit")[
|
118
125
|
["unit_gsrn", "net_component_id"]
|
119
126
|
]
|
120
127
|
|
121
128
|
df_unit = df_unit[["masterdata_gsrn", "plant_id"]]
|
122
129
|
|
123
130
|
df = pd.merge(
|
124
|
-
|
131
|
+
df_psr_mapping,
|
125
132
|
df_unit,
|
126
133
|
left_on="unit_gsrn",
|
127
134
|
right_on="masterdata_gsrn",
|
128
|
-
how="
|
135
|
+
how="left",
|
129
136
|
validate="1:m",
|
130
137
|
)[["net_component_id", "plant_id"]]
|
131
138
|
|
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
|
File without changes
|
File without changes
|