ocf-data-sampler 0.0.47__py3-none-any.whl → 0.0.48__py3-none-any.whl

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.

Potentially problematic release.


This version of ocf-data-sampler might be problematic. Click here for more details.

@@ -3,7 +3,6 @@ import pandas as pd
3
3
  import numpy as np
4
4
 
5
5
 
6
-
7
6
  def _sel_fillnan(
8
7
  da: xr.DataArray,
9
8
  start_dt: pd.Timestamp,
@@ -25,17 +24,6 @@ def _sel_default(
25
24
  return da.sel(time_utc=slice(start_dt, end_dt))
26
25
 
27
26
 
28
- # TODO either implement this or remove it, which would tidy up the code
29
- def _sel_fillinterp(
30
- da: xr.DataArray,
31
- start_dt: pd.Timestamp,
32
- end_dt: pd.Timestamp,
33
- sample_period_duration: pd.Timedelta,
34
- ) -> xr.DataArray:
35
- """Select a time slice from a DataArray, filling missing times with linear interpolation."""
36
- return NotImplemented
37
-
38
-
39
27
  def select_time_slice(
40
28
  ds: xr.DataArray,
41
29
  t0: pd.Timestamp,
@@ -43,17 +31,10 @@ def select_time_slice(
43
31
  interval_end: pd.Timedelta,
44
32
  sample_period_duration: pd.Timedelta,
45
33
  fill_selection: bool = False,
46
- max_steps_gap: int = 0,
47
34
  ):
48
35
  """Select a time slice from a Dataset or DataArray."""
49
- assert max_steps_gap >= 0, "max_steps_gap must be >= 0 "
50
36
 
51
- if fill_selection and max_steps_gap == 0:
52
- _sel = _sel_fillnan
53
- elif fill_selection and max_steps_gap > 0:
54
- _sel = _sel_fillinterp
55
- else:
56
- _sel = _sel_default
37
+ _sel = _sel_fillnan if fill_selection else _sel_default
57
38
 
58
39
  t0_datetime_utc = pd.Timestamp(t0)
59
40
  start_dt = t0_datetime_utc + interval_start
@@ -51,7 +51,6 @@ def slice_datasets_by_time(
51
51
  sample_period_duration=minutes(sat_config.time_resolution_minutes),
52
52
  interval_start=minutes(sat_config.interval_start_minutes),
53
53
  interval_end=minutes(sat_config.interval_end_minutes),
54
- max_steps_gap=2,
55
54
  )
56
55
 
57
56
  # Randomly sample dropout
@@ -122,4 +121,4 @@ def slice_datasets_by_time(
122
121
  site_dropout_time,
123
122
  )
124
123
 
125
- return sliced_datasets_dict
124
+ return sliced_datasets_dict
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: ocf_data_sampler
3
- Version: 0.0.47
3
+ Version: 0.0.48
4
4
  Summary: Sample from weather data for renewable energy prediction
5
5
  Author: James Fulton, Peter Dudfield, and the Open Climate Fix team
6
6
  Author-email: info@openclimatefix.org
@@ -33,9 +33,9 @@ ocf_data_sampler/select/find_contiguous_time_periods.py,sha256=q7IaNfX95A3z9XHqb
33
33
  ocf_data_sampler/select/geospatial.py,sha256=4xL-9y674jjoaXeqE52NHCHVfknciE4OEGsZtn9DvP4,4911
34
34
  ocf_data_sampler/select/location.py,sha256=26Y5ZjfFngShBwXieuWSoOA-RLaRzci4TTmcDk3Wg7U,2015
35
35
  ocf_data_sampler/select/select_spatial_slice.py,sha256=WNxwur9Q5oetvogATw8-hNejDuEwrXHzuZIovFDjNJA,11488
36
- ocf_data_sampler/select/select_time_slice.py,sha256=D5P_cSvnv8Qs49K5au7lPxDr9U_VmDn42s5leMzHt0k,6122
36
+ ocf_data_sampler/select/select_time_slice.py,sha256=gFeuAuV2C7DJMHgiTHqjRUXOdfI-iraVF5NIzWhewFQ,5524
37
37
  ocf_data_sampler/select/spatial_slice_for_dataset.py,sha256=3tRrMBXr7s4CnClbVSIq7hpls3H4Y3qYTDwswcxCCCE,1763
38
- ocf_data_sampler/select/time_slice_for_dataset.py,sha256=LMw8KnOCKnPjD0m4UubAWERpaiQtzRKkI2cSh5a0A-M,4335
38
+ ocf_data_sampler/select/time_slice_for_dataset.py,sha256=BFjNwWAzhcb1hpqx7UPi5RF9WWt15owbZp1WB-uGA6Q,4305
39
39
  ocf_data_sampler/torch_datasets/datasets/__init__.py,sha256=nJUa2KzVa84ZoM0PT2AbDz26ennmAYc7M7WJVfypPMs,85
40
40
  ocf_data_sampler/torch_datasets/datasets/pvnet_uk_regional.py,sha256=xxeX4Js9LQpydehi3BS7k9psqkYGzgJuM17uTYux40M,8742
41
41
  ocf_data_sampler/torch_datasets/datasets/site.py,sha256=75M0oDstOLyLZBySVIS6fLJSbEjfxcWBlgGP_ewui7s,15334
@@ -66,8 +66,8 @@ tests/torch_datasets/conftest.py,sha256=eRCzHE7cxS4AoskExkCGFDBeqItktAYNAdkfpMoF
66
66
  tests/torch_datasets/test_merge_and_fill_utils.py,sha256=ueA0A7gZaWEgNdsU8p3CnKuvSnlleTUjEhSw2HUUROM,1229
67
67
  tests/torch_datasets/test_pvnet_uk_regional.py,sha256=FCiFueeFqrsXe7gWguSjBz5ZeUrvyhGbGw81gaVvkHM,5087
68
68
  tests/torch_datasets/test_site.py,sha256=0tnjgx6z4VlzjoF_V2p3Y2t2Z1d0o_07Vwb-FH_c3tU,4640
69
- ocf_data_sampler-0.0.47.dist-info/LICENSE,sha256=F-Q3UFCR-BECSocV55BFDpn4YKxve9PKrm-lTt6o_Tg,1073
70
- ocf_data_sampler-0.0.47.dist-info/METADATA,sha256=x4HkuNvlIxd5LzUtf5keEgRPFoK8BuV3kpMjogShv5w,11788
71
- ocf_data_sampler-0.0.47.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
72
- ocf_data_sampler-0.0.47.dist-info/top_level.txt,sha256=Faob6N6cFdPc5eUpCTYcXgCaNhi4XLLteUL5W5ayYmg,31
73
- ocf_data_sampler-0.0.47.dist-info/RECORD,,
69
+ ocf_data_sampler-0.0.48.dist-info/LICENSE,sha256=F-Q3UFCR-BECSocV55BFDpn4YKxve9PKrm-lTt6o_Tg,1073
70
+ ocf_data_sampler-0.0.48.dist-info/METADATA,sha256=Wl37iFa0xFXGRsHNEHLn7WYeXbWvbg8SGgLXcksExQA,11788
71
+ ocf_data_sampler-0.0.48.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
72
+ ocf_data_sampler-0.0.48.dist-info/top_level.txt,sha256=Faob6N6cFdPc5eUpCTYcXgCaNhi4XLLteUL5W5ayYmg,31
73
+ ocf_data_sampler-0.0.48.dist-info/RECORD,,