domainiac 0.1.5__tar.gz → 0.1.6__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-0.1.5 → domainiac-0.1.6}/PKG-INFO +1 -1
- {domainiac-0.1.5 → domainiac-0.1.6}/domainiac/managers/resource_manager.py +25 -20
- {domainiac-0.1.5 → domainiac-0.1.6}/pyproject.toml +1 -1
- {domainiac-0.1.5 → domainiac-0.1.6}/domainiac/__init__.py +0 -0
- {domainiac-0.1.5 → domainiac-0.1.6}/domainiac/managers/__init__.py +0 -0
- {domainiac-0.1.5 → domainiac-0.1.6}/domainiac/managers/masterdata_manager.py +0 -0
- {domainiac-0.1.5 → domainiac-0.1.6}/domainiac/managers/metering_manager.py +0 -0
- {domainiac-0.1.5 → domainiac-0.1.6}/domainiac/managers/plant_manager.py +0 -0
- {domainiac-0.1.5 → domainiac-0.1.6}/domainiac/managers/unit_manager.py +0 -0
@@ -2,6 +2,8 @@ import datamazing.pandas as pdz
|
|
2
2
|
import pandas as pd
|
3
3
|
from typeguard import typechecked
|
4
4
|
|
5
|
+
DEFAULT_RESOLUTION = pd.Timedelta("PT5M")
|
6
|
+
|
5
7
|
|
6
8
|
class ResourceManager:
|
7
9
|
"""
|
@@ -19,7 +21,7 @@ class ResourceManager:
|
|
19
21
|
self,
|
20
22
|
db: pdz.Database,
|
21
23
|
time_interval: pdz.TimeInterval,
|
22
|
-
resolution: pd.Timedelta =
|
24
|
+
resolution: pd.Timedelta = DEFAULT_RESOLUTION,
|
23
25
|
) -> None:
|
24
26
|
self.db = db
|
25
27
|
self.time_interval = time_interval
|
@@ -37,27 +39,30 @@ class ResourceManager:
|
|
37
39
|
if df_resource_schedules.empty:
|
38
40
|
raise ValueError(f"No resource schedules found for gsrn {resource_gsrn}.")
|
39
41
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
42
|
+
if self.resolution != DEFAULT_RESOLUTION:
|
43
|
+
df_resource_schedules = (
|
44
|
+
pdz.group(
|
45
|
+
df_resource_schedules,
|
46
|
+
by=[
|
47
|
+
"market_participant",
|
48
|
+
"created_time_utc",
|
49
|
+
"price_area",
|
50
|
+
"resource_gsrn",
|
51
|
+
],
|
52
|
+
)
|
53
|
+
.resample(on="time_utc", resolution=self.resolution)
|
54
|
+
.agg(
|
55
|
+
{
|
56
|
+
"schedule_power_MW": "mean",
|
57
|
+
"schedule_capacity_min_MW": "max",
|
58
|
+
"schedule_capacity_max_MW": "min",
|
59
|
+
}
|
60
|
+
)
|
61
|
+
.dropna()
|
57
62
|
)
|
58
|
-
|
63
|
+
return df_resource_schedules.drop(
|
64
|
+
columns=["masterdata_gsrn", "datahub_gsrn_e18"], errors="ignore"
|
59
65
|
)
|
60
|
-
return df_resource_resampled
|
61
66
|
|
62
67
|
@typechecked
|
63
68
|
def get_latest_resource_schedules(
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|