domainiac 9.0.3__tar.gz → 9.0.5__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.
Files changed (23) hide show
  1. {domainiac-9.0.3 → domainiac-9.0.5}/PKG-INFO +1 -1
  2. {domainiac-9.0.3 → domainiac-9.0.5}/domainiac/functions/interpolation.py +1 -0
  3. {domainiac-9.0.3 → domainiac-9.0.5}/domainiac/functions/temperature.py +5 -1
  4. {domainiac-9.0.3 → domainiac-9.0.5}/domainiac/functions/wind.py +5 -1
  5. {domainiac-9.0.3 → domainiac-9.0.5}/domainiac/managers/nwp_manager.py +8 -3
  6. {domainiac-9.0.3 → domainiac-9.0.5}/pyproject.toml +1 -1
  7. {domainiac-9.0.3 → domainiac-9.0.5}/domainiac/__init__.py +0 -0
  8. {domainiac-9.0.3 → domainiac-9.0.5}/domainiac/functions/__init__.py +0 -0
  9. {domainiac-9.0.3 → domainiac-9.0.5}/domainiac/functions/conversions.py +0 -0
  10. {domainiac-9.0.3 → domainiac-9.0.5}/domainiac/functions/solar.py +0 -0
  11. {domainiac-9.0.3 → domainiac-9.0.5}/domainiac/functions/typing.py +0 -0
  12. {domainiac-9.0.3 → domainiac-9.0.5}/domainiac/managers/__init__.py +0 -0
  13. {domainiac-9.0.3 → domainiac-9.0.5}/domainiac/managers/masterdata_manager.py +0 -0
  14. {domainiac-9.0.3 → domainiac-9.0.5}/domainiac/managers/metering_manager.py +0 -0
  15. {domainiac-9.0.3 → domainiac-9.0.5}/domainiac/managers/outage_manager.py +0 -0
  16. {domainiac-9.0.3 → domainiac-9.0.5}/domainiac/managers/plant_manager.py +0 -0
  17. {domainiac-9.0.3 → domainiac-9.0.5}/domainiac/managers/resource_manager.py +0 -0
  18. {domainiac-9.0.3 → domainiac-9.0.5}/domainiac/managers/unit_manager.py +0 -0
  19. {domainiac-9.0.3 → domainiac-9.0.5}/domainiac/modeling/__init__.py +0 -0
  20. {domainiac-9.0.3 → domainiac-9.0.5}/domainiac/modeling/nwp.py +0 -0
  21. {domainiac-9.0.3 → domainiac-9.0.5}/domainiac/modeling/plant.py +0 -0
  22. {domainiac-9.0.3 → domainiac-9.0.5}/domainiac/wrappers/__init__.py +0 -0
  23. {domainiac-9.0.3 → domainiac-9.0.5}/domainiac/wrappers/cache_wrapper.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: domainiac
3
- Version: 9.0.3
3
+ Version: 9.0.5
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
@@ -112,6 +112,7 @@ def binned_index_interpolation(
112
112
  index = interpolate.PchipInterpolator(
113
113
  x=bin_midpoints,
114
114
  y=bin_index,
115
+ extrapolate=False,
115
116
  )
116
117
 
117
118
  def estimate(x: NDArray[np.float64]) -> NDArray[np.float64]:
@@ -23,8 +23,12 @@ def interpolate_temperature(times: pd.Series, temperature: pd.Series) -> RealFun
23
23
 
24
24
  f = interpolate.make_interp_spline(x, y, k=1)
25
25
 
26
+ bounds = (x.min(), x.max())
27
+
26
28
  def estimate(times: pd.Series) -> NDArray[np.float64]:
27
29
  x = conversions.datetime_to_float(times)
28
- return f(x)
30
+ y = f(x)
31
+ y[(x < bounds[0]) | (x > bounds[1])] = np.nan
32
+ return y
29
33
 
30
34
  return estimate
@@ -25,8 +25,12 @@ def interpolate_wind_components(
25
25
 
26
26
  f = interpolate.make_interp_spline(x, y, k=1)
27
27
 
28
+ bounds = (x.min(), x.max())
29
+
28
30
  def estimate(times: pd.Series) -> NDArray[np.float64]:
29
31
  x = conversions.datetime_to_float(times)
30
- return f(x)
32
+ y = f(x)
33
+ y[(x < bounds[0]) | (x > bounds[1]), :] = np.nan
34
+ return y
31
35
 
32
36
  return estimate
@@ -51,9 +51,10 @@ class NWPManager:
51
51
  """
52
52
  key = (provider, parameter)
53
53
  if key not in self._nwp_coordinates_kd_tree:
54
- # Base KDTree on one hour of data
54
+ # Base KDTree on six hours of data,
55
+ # which should be enough to cover the largest interval which is ECMWF
55
56
  query_time_interval = pdz.TimeInterval(
56
- self.time_interval.left, self.time_interval.left + pd.Timedelta("PT1H")
57
+ self.time_interval.left, self.time_interval.left + pd.Timedelta("PT6H")
57
58
  )
58
59
 
59
60
  df = self.db.query(
@@ -194,7 +195,11 @@ class NWPManager:
194
195
  df_interpolated["time_utc"]
195
196
  )
196
197
 
197
- # disallow extrapolation
198
+ # remove nan values from the interpolated data
199
+ # (for example when data has been extrapolated)
200
+ df = df_interpolated.dropna(subset=column_names)
201
+
202
+ # remove values outside the original time interval
198
203
  df_interpolated = df_interpolated[
199
204
  df_interpolated["time_utc"].between(
200
205
  df["time_utc"].min(), df["time_utc"].max()
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "domainiac"
3
- version = "9.0.3"
3
+ version = "9.0.5"
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 = [