ocf-data-sampler 0.2.2__py3-none-any.whl → 0.2.3__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.

@@ -55,7 +55,10 @@ def select_time_slice_nwp(
55
55
  if accum_channels is None:
56
56
  accum_channels = []
57
57
 
58
- if dropout_timedeltas is not None:
58
+ if dropout_timedeltas is None:
59
+ dropout_timedeltas = []
60
+
61
+ if len(dropout_timedeltas)>0:
59
62
  if not all(t < pd.Timedelta(0) for t in dropout_timedeltas):
60
63
  raise ValueError("dropout timedeltas must be negative")
61
64
  if len(dropout_timedeltas) < 1:
@@ -64,7 +67,7 @@ def select_time_slice_nwp(
64
67
  if not (0 <= dropout_frac <= 1):
65
68
  raise ValueError("dropout_frac must be between 0 and 1")
66
69
 
67
- consider_dropout = (dropout_timedeltas is not None) and dropout_frac > 0
70
+ consider_dropout = len(dropout_timedeltas) > 0 and dropout_frac > 0
68
71
 
69
72
  # The accumatated and non-accumulated channels
70
73
  accum_channels = np.intersect1d(da.channel.values, accum_channels)
@@ -28,7 +28,7 @@ def find_valid_time_periods(datasets_dict: dict, config: Configuration) -> pd.Da
28
28
  for nwp_key, nwp_config in config.input_data.nwp.items():
29
29
  da = datasets_dict["nwp"][nwp_key]
30
30
 
31
- if nwp_config.dropout_timedeltas_minutes is None:
31
+ if nwp_config.dropout_timedeltas_minutes==[]:
32
32
  max_dropout = minutes(0)
33
33
  else:
34
34
  max_dropout = minutes(np.max(np.abs(nwp_config.dropout_timedeltas_minutes)))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: ocf-data-sampler
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Author: James Fulton, Peter Dudfield
5
5
  Author-email: Open Climate Fix team <info@openclimatefix.org>
6
6
  License: MIT License
@@ -39,7 +39,7 @@ ocf_data_sampler/select/find_contiguous_time_periods.py,sha256=cEXrQDzk8pXknxB0q
39
39
  ocf_data_sampler/select/geospatial.py,sha256=CDExkl36eZOKmdJPzUr_K0Wn3axHqv5nYo-EkSiINcc,5032
40
40
  ocf_data_sampler/select/location.py,sha256=AZvGR8y62opiW7zACGXjoOtBEWRfSLOZIA73O5Deu0c,1037
41
41
  ocf_data_sampler/select/select_spatial_slice.py,sha256=qY2Ll00EPA80oBtzwMoR5nk0UIpoWZF9oXl22YwWr0Q,12341
42
- ocf_data_sampler/select/select_time_slice.py,sha256=q5QdgHPIXQb49uT5NwbOguY1GhjWc_o3c-2cDb5kLAo,5455
42
+ ocf_data_sampler/select/select_time_slice.py,sha256=HeHbwZ0CP03x0-LaJtpbSdtpLufwVTR73p6wH6O_PS8,5513
43
43
  ocf_data_sampler/select/spatial_slice_for_dataset.py,sha256=Hvz0wHSWMYYamf2oHNiGlzJcM4cAH6pL_7ZEvIBL2dE,1882
44
44
  ocf_data_sampler/select/time_slice_for_dataset.py,sha256=1DN6VsWWdLvkpJxodZtBRDUgC4vJE2td_RP5J3ZqPNw,4268
45
45
  ocf_data_sampler/torch_datasets/datasets/__init__.py,sha256=jfJSFcR0eO1AqeH7S3KnGjsBqVZT5w3oyi784PUR6Q0,146
@@ -48,10 +48,10 @@ ocf_data_sampler/torch_datasets/datasets/site.py,sha256=j29cWPIcksRbge014MxR0_Og
48
48
  ocf_data_sampler/torch_datasets/utils/__init__.py,sha256=7Yt4anQVU9y27nj4Wx1tRLqbAQLbzW0ED71UL65LvxA,187
49
49
  ocf_data_sampler/torch_datasets/utils/channel_dict_to_dataarray.py,sha256=MGylKhXxXLQC2fYv-8L_GVoYhov3LcEwC0Q21xItDSk,353
50
50
  ocf_data_sampler/torch_datasets/utils/merge_and_fill_utils.py,sha256=we7BTxRH7B7jKayDT7YfNyfI3zZClz2Bk-HXKQIokgU,956
51
- ocf_data_sampler/torch_datasets/utils/valid_time_periods.py,sha256=LdHgLPAYUVoCRMk2nnFdsMpygGS2kbps3h-7_bZnETw,4718
51
+ ocf_data_sampler/torch_datasets/utils/valid_time_periods.py,sha256=xcy75cVxl0WrglnX5YUAFjXXlO2GwEBHWyqo8TDuiOA,4714
52
52
  scripts/refactor_site.py,sha256=skzvsPP0Cn9yTKndzkilyNcGz4DZ88ctvCJ0XrBdc2A,3135
53
53
  utils/compute_icon_mean_stddev.py,sha256=a1oWMRMnny39rV-dvu8rcx85sb4bXzPFrR1gkUr4Jpg,2296
54
- ocf_data_sampler-0.2.2.dist-info/METADATA,sha256=NEsKFB-wcbnffDXMEBNpFhxfM7dH2pgfEbiRferBfLE,11594
55
- ocf_data_sampler-0.2.2.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
56
- ocf_data_sampler-0.2.2.dist-info/top_level.txt,sha256=LEFU4Uk-PEo72QGLAfnVZIUEm37Q8mKuMeg_Xk-p33g,31
57
- ocf_data_sampler-0.2.2.dist-info/RECORD,,
54
+ ocf_data_sampler-0.2.3.dist-info/METADATA,sha256=AHPkmaocRkmk__-A4eAPRoTlTQ7K_pqWmj0AY75i4lA,11594
55
+ ocf_data_sampler-0.2.3.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
56
+ ocf_data_sampler-0.2.3.dist-info/top_level.txt,sha256=LEFU4Uk-PEo72QGLAfnVZIUEm37Q8mKuMeg_Xk-p33g,31
57
+ ocf_data_sampler-0.2.3.dist-info/RECORD,,