domainiac 8.0.4__tar.gz → 8.0.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.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: domainiac
3
- Version: 8.0.4
3
+ Version: 8.0.6
4
4
  Summary: Package for working with Energinet data, but with specialized functions used for Enigma.
5
5
  Author: Team Enigma
6
6
  Author-email: gridop-enigma@energinet.dk
@@ -37,4 +37,19 @@ class MeteringManager:
37
37
  ]
38
38
  )
39
39
 
40
+ # Settlement data is an aggregated production in the interval [t, t+1],
41
+ # therefore there is a timeshift of half the resolution. The data is
42
+ # then interpolated to a production at hourly timestamps XX:00
43
+
44
+ df = pdz.shift_time(df, on="time_utc", period=pd.Timedelta(minutes=30))
45
+ df = pdz.resample(
46
+ df, on="time_utc", resolution=pd.Timedelta(minutes=30)
47
+ ).interpolate()
48
+ # Because of interpolation, the GSRN for the new points is NAN,
49
+ # they have to be backfilled with proper values
50
+ df["datahub_gsrn_e18"] = datahub_gsrn
51
+
52
+ df = df.drop(df[df["time_utc"].dt.minute != 0].index)
53
+ df = df.reset_index().drop("index", axis=1)
54
+
40
55
  return df
@@ -57,6 +57,11 @@ class Group:
57
57
  def groups_from_df(cls, df: pd.DataFrame, identifiers: list[str]) -> list["Group"]:
58
58
  groups = []
59
59
  for _, row in df.iterrows():
60
+ if "altitude" in row.keys():
61
+ altitude = row["altitude"]
62
+ else:
63
+ altitude = 0
64
+
60
65
  identifiers = {identifier: row[identifier] for identifier in identifiers}
61
66
  group = cls(
62
67
  identifiers=identifiers,
@@ -64,7 +69,7 @@ class Group:
64
69
  coordinate=Coordinate(
65
70
  latitude=row["latitude"],
66
71
  longitude=row["longitude"],
67
- altitude=row["altitude"],
72
+ altitude=altitude,
68
73
  ),
69
74
  )
70
75
  groups.append(group)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "domainiac"
3
- version = "8.0.4"
3
+ version = "8.0.6"
4
4
  description = "Package for working with Energinet data, but with specialized functions used for Enigma."
5
5
  authors = ["Team Enigma <gridop-enigma@energinet.dk>"]
6
6
  packages = [