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

ocf_data_sampler/utils.py CHANGED
@@ -15,7 +15,16 @@ def minutes(minutes: int | list[float]) -> pd.Timedelta | pd.TimedeltaIndex:
15
15
 
16
16
  def compute(xarray_dict: dict) -> dict:
17
17
  """Eagerly load a nested dictionary of xarray DataArrays."""
18
- for k, v in xarray_dict.items():
18
+ # Load these keys first because they don't use tensorstore
19
+ priority_keys = ["gsp", "site"]
20
+ for key in priority_keys:
21
+ if key in xarray_dict:
22
+ xarray_dict[key] = xarray_dict[key].compute()
23
+
24
+ # Load the rest
25
+ keys = [k for k in xarray_dict if k not in priority_keys]
26
+ for k in keys:
27
+ v = xarray_dict[k]
19
28
  if isinstance(v, dict):
20
29
  xarray_dict[k] = compute(v)
21
30
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ocf-data-sampler
3
- Version: 0.5.17
3
+ Version: 0.5.18
4
4
  Author: James Fulton, Peter Dudfield
5
5
  Author-email: Open Climate Fix team <info@openclimatefix.org>
6
6
  License: MIT License
@@ -1,5 +1,5 @@
1
1
  ocf_data_sampler/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
2
- ocf_data_sampler/utils.py,sha256=CTJf9bjHjO8vOJebUtXiMpvgwUpF7gEOjjaoE77fhTk,1177
2
+ ocf_data_sampler/utils.py,sha256=WfmyBacjFGsv_IlUHRezNGc4ixi4wBvom_JF76iJYbY,1487
3
3
  ocf_data_sampler/config/__init__.py,sha256=O29mbH0XG2gIY1g3BaveGCnpBO2SFqdu-qzJ7a6evl0,223
4
4
  ocf_data_sampler/config/load.py,sha256=LL-7wemI8o4KPkx35j-wQ3HjsMvDgqXr7G46IcASfnU,632
5
5
  ocf_data_sampler/config/model.py,sha256=5ou8BZgQ9h-xyJEqHdspPKZgZO9Vr6opjSphUys7yE8,11505
@@ -58,7 +58,7 @@ ocf_data_sampler/torch_datasets/utils/valid_time_periods.py,sha256=xcy75cVxl0Wrg
58
58
  ocf_data_sampler/torch_datasets/utils/validation_utils.py,sha256=YqmT-lExWlI8_ul3l0EP73Ik002fStr_bhsZh9mQqEU,4735
59
59
  scripts/download_gsp_location_data.py,sha256=rRDXMoqX-RYY4jPdxhdlxJGhWdl6r245F5UARgKV6P4,3121
60
60
  scripts/refactor_site.py,sha256=skzvsPP0Cn9yTKndzkilyNcGz4DZ88ctvCJ0XrBdc2A,3135
61
- ocf_data_sampler-0.5.17.dist-info/METADATA,sha256=H4nnVbAIoMjhfz0wME3sB78hUE0dAdcXSDtR5CCIIvQ,12817
62
- ocf_data_sampler-0.5.17.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
63
- ocf_data_sampler-0.5.17.dist-info/top_level.txt,sha256=deUxqmsONNAGZDNbsntbXH7BRA1MqWaUeAJrCo6q_xA,25
64
- ocf_data_sampler-0.5.17.dist-info/RECORD,,
61
+ ocf_data_sampler-0.5.18.dist-info/METADATA,sha256=X8GB_jGQyev3yFEAmGCW1NvDnKiIw5hVWPyzNTGteLE,12817
62
+ ocf_data_sampler-0.5.18.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
63
+ ocf_data_sampler-0.5.18.dist-info/top_level.txt,sha256=deUxqmsONNAGZDNbsntbXH7BRA1MqWaUeAJrCo6q_xA,25
64
+ ocf_data_sampler-0.5.18.dist-info/RECORD,,