ocf-data-sampler 0.0.11__py3-none-any.whl → 0.0.13__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.
@@ -114,7 +114,7 @@ def find_valid_t0_times(
114
114
 
115
115
  assert set(datasets_dict.keys()).issubset({"nwp", "sat", "gsp"})
116
116
 
117
- contiguous_time_periods = [] # Used to store contiguous time periods from each data source
117
+ contiguous_time_periods: dict[str: pd.DataFrame] = {} # Used to store contiguous time periods from each data source
118
118
 
119
119
  if "nwp" in datasets_dict:
120
120
  for nwp_key, nwp_config in config.input_data.nwp.items():
@@ -158,7 +158,7 @@ def find_valid_t0_times(
158
158
  max_dropout=max_dropout,
159
159
  )
160
160
 
161
- contiguous_time_periods.append(time_periods)
161
+ contiguous_time_periods[f'nwp_{nwp_key}'] = time_periods
162
162
 
163
163
  if "sat" in datasets_dict:
164
164
  sat_config = config.input_data.satellite
@@ -170,7 +170,7 @@ def find_valid_t0_times(
170
170
  forecast_duration=minutes(sat_config.forecast_minutes),
171
171
  )
172
172
 
173
- contiguous_time_periods.append(time_periods)
173
+ contiguous_time_periods['sat'] = time_periods
174
174
 
175
175
  # GSP always assumed to be in data
176
176
  gsp_config = config.input_data.gsp
@@ -182,15 +182,22 @@ def find_valid_t0_times(
182
182
  forecast_duration=minutes(gsp_config.forecast_minutes),
183
183
  )
184
184
 
185
- contiguous_time_periods.append(time_periods)
185
+ contiguous_time_periods['gsp'] = time_periods
186
+
187
+ # just get the values (no the keys)
188
+ contiguous_time_periods_values = list(contiguous_time_periods.values())
186
189
 
187
190
  # Find joint overlapping contiguous time periods
188
- if len(contiguous_time_periods) > 1:
191
+ if len(contiguous_time_periods_values) > 1:
189
192
  valid_time_periods = intersection_of_multiple_dataframes_of_periods(
190
- contiguous_time_periods
193
+ contiguous_time_periods_values
191
194
  )
192
195
  else:
193
- valid_time_periods = contiguous_time_periods[0]
196
+ valid_time_periods = contiguous_time_periods_values[0]
197
+
198
+ # check there are some valid time periods
199
+ if len(valid_time_periods) == 0:
200
+ raise ValueError(f"No valid time periods found, {contiguous_time_periods=}")
194
201
 
195
202
  # Fill out the contiguous time periods to get the t0 times
196
203
  valid_t0_times = fill_time_periods(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ocf_data_sampler
3
- Version: 0.0.11
3
+ Version: 0.0.13
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
@@ -22,11 +22,11 @@ ocf_data_sampler/select/find_contiguous_time_periods.py,sha256=6ioB8LeFpFNBMgKDx
22
22
  ocf_data_sampler/select/select_spatial_slice.py,sha256=7BSzOFPMSBWpBWXSajWTfI8luUVsSgh4zN-rkr-AuUs,11470
23
23
  ocf_data_sampler/select/select_time_slice.py,sha256=XuksC9N03c5rV9OeWtxjGuoGyeJJGy4JMJe3w7m6oaw,6654
24
24
  ocf_data_sampler/torch_datasets/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
25
- ocf_data_sampler/torch_datasets/pvnet_uk_regional.py,sha256=rVKFfoHqSfm4C-eOXiqi5GwBJdMewRMIikvpjEJXi1s,17477
25
+ ocf_data_sampler/torch_datasets/pvnet_uk_regional.py,sha256=1jo-5KhGhFv6mb5C9HHTn_fiTHgaFgnuifA_cLt4JYs,17823
26
26
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
27
  tests/conftest.py,sha256=OcArgF60paroZQqoP7xExRBF34nEyMuXd7dS7hD6p3w,5393
28
- ocf_data_sampler-0.0.11.dist-info/LICENSE,sha256=F-Q3UFCR-BECSocV55BFDpn4YKxve9PKrm-lTt6o_Tg,1073
29
- ocf_data_sampler-0.0.11.dist-info/METADATA,sha256=UygNspgLmps-YBxZwJd9wWq1ATU9mPtvRZ4b3-Qbr24,588
30
- ocf_data_sampler-0.0.11.dist-info/WHEEL,sha256=HiCZjzuy6Dw0hdX5R3LCFPDmFS4BWl8H-8W39XfmgX4,91
31
- ocf_data_sampler-0.0.11.dist-info/top_level.txt,sha256=KaQn5qzkJGJP6hKWqsVAc9t0cMLjVvSTk8-kTrW79SA,23
32
- ocf_data_sampler-0.0.11.dist-info/RECORD,,
28
+ ocf_data_sampler-0.0.13.dist-info/LICENSE,sha256=F-Q3UFCR-BECSocV55BFDpn4YKxve9PKrm-lTt6o_Tg,1073
29
+ ocf_data_sampler-0.0.13.dist-info/METADATA,sha256=8G8qD019wgJTz9M2594c5Zm19aIDWxqvl1smiTgEJT4,588
30
+ ocf_data_sampler-0.0.13.dist-info/WHEEL,sha256=Mdi9PDNwEZptOjTlUcAth7XJDFtKrHYaQMPulZeBCiQ,91
31
+ ocf_data_sampler-0.0.13.dist-info/top_level.txt,sha256=KaQn5qzkJGJP6hKWqsVAc9t0cMLjVvSTk8-kTrW79SA,23
32
+ ocf_data_sampler-0.0.13.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (72.2.0)
2
+ Generator: setuptools (73.0.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5