domainiac 2.0.0__tar.gz → 2.0.1__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.0 → domainiac-2.0.1}/PKG-INFO +1 -1
- {domainiac-2.0.0 → domainiac-2.0.1}/domainiac/managers/plant_manager.py +30 -1
- {domainiac-2.0.0 → domainiac-2.0.1}/pyproject.toml +1 -1
- {domainiac-2.0.0 → domainiac-2.0.1}/domainiac/__init__.py +0 -0
- {domainiac-2.0.0 → domainiac-2.0.1}/domainiac/managers/__init__.py +0 -0
- {domainiac-2.0.0 → domainiac-2.0.1}/domainiac/managers/masterdata_manager.py +0 -0
- {domainiac-2.0.0 → domainiac-2.0.1}/domainiac/managers/metering_manager.py +0 -0
- {domainiac-2.0.0 → domainiac-2.0.1}/domainiac/managers/nwp_manager.py +0 -0
- {domainiac-2.0.0 → domainiac-2.0.1}/domainiac/managers/resource_manager.py +0 -0
- {domainiac-2.0.0 → domainiac-2.0.1}/domainiac/managers/unit_manager.py +0 -0
- {domainiac-2.0.0 → domainiac-2.0.1}/domainiac/modeling/__init__.py +0 -0
- {domainiac-2.0.0 → domainiac-2.0.1}/domainiac/modeling/nwp.py +0 -0
- {domainiac-2.0.0 → domainiac-2.0.1}/domainiac/modeling/plant.py +0 -0
- {domainiac-2.0.0 → domainiac-2.0.1}/domainiac/wrappers/__init__.py +0 -0
- {domainiac-2.0.0 → domainiac-2.0.1}/domainiac/wrappers/cache_wrapper.py +0 -0
@@ -2,6 +2,7 @@ import datamazing.pandas as pdz
|
|
2
2
|
import pandas as pd
|
3
3
|
|
4
4
|
from .masterdata_manager import MasterdataManager
|
5
|
+
from .unit_manager import UnitManager
|
5
6
|
|
6
7
|
|
7
8
|
class PlantManager(MasterdataManager):
|
@@ -20,6 +21,7 @@ class PlantManager(MasterdataManager):
|
|
20
21
|
self.time_interval = time_interval
|
21
22
|
self.resolution = resolution
|
22
23
|
self.cache_masterdata = cache_masterdata
|
24
|
+
self.unit_manager = UnitManager(db, time_interval, resolution, cache_masterdata)
|
23
25
|
|
24
26
|
def get_plants(
|
25
27
|
self,
|
@@ -44,7 +46,13 @@ class PlantManager(MasterdataManager):
|
|
44
46
|
columns = default_columns
|
45
47
|
else:
|
46
48
|
columns = list(set(default_columns + columns))
|
47
|
-
|
49
|
+
|
50
|
+
df_plant = self.get_data("masterdataPlant", filters=filters, columns=columns)
|
51
|
+
df_psrt = self._get_power_system_resource_type()
|
52
|
+
df = df_psrt.merge(
|
53
|
+
df_plant, on=["plant_id"], how="inner", validate="m:1"
|
54
|
+
).drop_duplicates()
|
55
|
+
return df
|
48
56
|
|
49
57
|
def get_installed_power_timeseries(self, gsrn: str) -> pd.DataFrame:
|
50
58
|
"""Gets the installed power timeseries for a plant."""
|
@@ -101,3 +109,24 @@ class PlantManager(MasterdataManager):
|
|
101
109
|
df = df[["time_utc", "installed_power_MW"]]
|
102
110
|
|
103
111
|
return df
|
112
|
+
|
113
|
+
def _get_power_system_resource_type(self) -> pd.DataFrame:
|
114
|
+
|
115
|
+
df_unit = self.unit_manager.get_units(columns=["masterdata_gsrn"])
|
116
|
+
|
117
|
+
df_power_system_resource_map = self.db.query("masterdataAggregatedUnit")[
|
118
|
+
["unit_gsrn", "net_component_id"]
|
119
|
+
]
|
120
|
+
|
121
|
+
df_unit = df_unit[["masterdata_gsrn", "plant_id"]]
|
122
|
+
|
123
|
+
df = pd.merge(
|
124
|
+
df_power_system_resource_map,
|
125
|
+
df_unit,
|
126
|
+
left_on="unit_gsrn",
|
127
|
+
right_on="masterdata_gsrn",
|
128
|
+
how="inner",
|
129
|
+
validate="1:m",
|
130
|
+
)[["net_component_id", "plant_id"]]
|
131
|
+
|
132
|
+
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
|
File without changes
|
File without changes
|