ocf-data-sampler 0.2.34__tar.gz → 0.2.36__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.

Potentially problematic release.


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

Files changed (67) hide show
  1. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/PKG-INFO +1 -1
  2. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/load/nwp/nwp.py +14 -10
  3. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler.egg-info/PKG-INFO +1 -1
  4. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/LICENSE +0 -0
  5. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/README.md +0 -0
  6. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/__init__.py +0 -0
  7. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/config/__init__.py +0 -0
  8. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/config/load.py +0 -0
  9. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/config/model.py +0 -0
  10. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/config/save.py +0 -0
  11. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/data/uk_gsp_locations_20220314.csv +0 -0
  12. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/data/uk_gsp_locations_20250109.csv +0 -0
  13. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/load/__init__.py +0 -0
  14. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/load/gsp.py +0 -0
  15. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/load/load_dataset.py +0 -0
  16. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/load/nwp/__init__.py +0 -0
  17. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/load/nwp/providers/__init__.py +0 -0
  18. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/load/nwp/providers/cloudcasting.py +0 -0
  19. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/load/nwp/providers/ecmwf.py +0 -0
  20. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/load/nwp/providers/gfs.py +0 -0
  21. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/load/nwp/providers/icon.py +0 -0
  22. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/load/nwp/providers/ukv.py +0 -0
  23. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/load/nwp/providers/utils.py +0 -0
  24. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/load/satellite.py +0 -0
  25. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/load/site.py +0 -0
  26. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/load/utils.py +0 -0
  27. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/numpy_sample/__init__.py +0 -0
  28. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/numpy_sample/collate.py +0 -0
  29. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/numpy_sample/common_types.py +0 -0
  30. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/numpy_sample/datetime_features.py +0 -0
  31. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/numpy_sample/gsp.py +0 -0
  32. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/numpy_sample/nwp.py +0 -0
  33. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/numpy_sample/satellite.py +0 -0
  34. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/numpy_sample/site.py +0 -0
  35. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/numpy_sample/sun_position.py +0 -0
  36. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/select/__init__.py +0 -0
  37. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/select/dropout.py +0 -0
  38. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/select/fill_time_periods.py +0 -0
  39. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/select/find_contiguous_time_periods.py +0 -0
  40. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/select/geospatial.py +0 -0
  41. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/select/location.py +0 -0
  42. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/select/select_spatial_slice.py +0 -0
  43. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/select/select_time_slice.py +0 -0
  44. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/torch_datasets/datasets/__init__.py +0 -0
  45. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/torch_datasets/datasets/pvnet_uk.py +0 -0
  46. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/torch_datasets/datasets/site.py +0 -0
  47. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/torch_datasets/sample/__init__.py +0 -0
  48. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/torch_datasets/sample/base.py +0 -0
  49. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/torch_datasets/sample/site.py +0 -0
  50. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/torch_datasets/sample/uk_regional.py +0 -0
  51. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/torch_datasets/utils/__init__.py +0 -0
  52. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/torch_datasets/utils/channel_dict_to_dataarray.py +0 -0
  53. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/torch_datasets/utils/merge_and_fill_utils.py +0 -0
  54. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/torch_datasets/utils/spatial_slice_for_dataset.py +0 -0
  55. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/torch_datasets/utils/time_slice_for_dataset.py +0 -0
  56. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/torch_datasets/utils/valid_time_periods.py +0 -0
  57. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/torch_datasets/utils/validation_utils.py +0 -0
  58. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler/utils.py +0 -0
  59. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler.egg-info/SOURCES.txt +0 -0
  60. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler.egg-info/dependency_links.txt +0 -0
  61. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler.egg-info/requires.txt +0 -0
  62. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/ocf_data_sampler.egg-info/top_level.txt +0 -0
  63. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/pyproject.toml +0 -0
  64. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/scripts/download_gsp_location_data.py +0 -0
  65. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/scripts/refactor_site.py +0 -0
  66. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/setup.cfg +0 -0
  67. {ocf_data_sampler-0.2.34 → ocf_data_sampler-0.2.36}/utils/compute_icon_mean_stddev.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ocf-data-sampler
3
- Version: 0.2.34
3
+ Version: 0.2.36
4
4
  Author: James Fulton, Peter Dudfield
5
5
  Author-email: Open Climate Fix team <info@openclimatefix.org>
6
6
  License: MIT License
@@ -29,7 +29,7 @@ def _validate_nwp_data(data_array: xr.DataArray, provider: str) -> None:
29
29
  common_expected_dtypes = {
30
30
  "init_time_utc": np.datetime64,
31
31
  "step": np.timedelta64,
32
- "channel": np.str_,
32
+ "channel": (np.str_, np.object_),
33
33
  }
34
34
 
35
35
  geographic_spatial_dtypes = {
@@ -43,8 +43,8 @@ def _validate_nwp_data(data_array: xr.DataArray, provider: str) -> None:
43
43
  "gfs": geographic_spatial_dtypes,
44
44
  "mo_global": geographic_spatial_dtypes,
45
45
  "ukv": {
46
- "x_osgb": np.floating,
47
- "y_osgb": np.floating,
46
+ "x_osgb": np.number,
47
+ "y_osgb": np.number,
48
48
  },
49
49
  "cloudcasting": {
50
50
  "x_geostationary": np.floating,
@@ -57,17 +57,21 @@ def _validate_nwp_data(data_array: xr.DataArray, provider: str) -> None:
57
57
  **provider_specific_spatial_dtypes.get(provider, {}),
58
58
  }
59
59
 
60
- if not expected_dtypes:
61
- raise ValueError(f"Unknown provider: {provider}")
62
-
63
60
  for coord, expected_dtype in expected_dtypes.items():
64
61
  if coord not in data_array.coords:
65
62
  raise ValueError(f"Coordinate '{coord}' missing for provider '{provider}'")
66
- if not np.issubdtype(data_array.coords[coord].dtype, expected_dtype):
67
- actual_dtype = data_array.coords[coord].dtype
63
+
64
+ actual_dtype = data_array.coords[coord].dtype
65
+
66
+ if not np.issubdtype(actual_dtype, expected_dtype):
67
+ if isinstance(expected_dtype, tuple):
68
+ expected_name_str = " or ".join([t.__name__ for t in expected_dtype])
69
+ else:
70
+ expected_name_str = expected_dtype.__name__
71
+
68
72
  err_msg = (
69
- f"'{coord}' for {provider} should be {expected_dtype.__name__}, "
70
- f"not {actual_dtype}"
73
+ f"'{coord}' for {provider} should be {expected_name_str}, "
74
+ f"not {actual_dtype.name}"
71
75
  )
72
76
  raise TypeError(err_msg)
73
77
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ocf-data-sampler
3
- Version: 0.2.34
3
+ Version: 0.2.36
4
4
  Author: James Fulton, Peter Dudfield
5
5
  Author-email: Open Climate Fix team <info@openclimatefix.org>
6
6
  License: MIT License