ocf-data-sampler 0.5.20__tar.gz → 0.5.23__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 (72) hide show
  1. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/PKG-INFO +5 -2
  2. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/README.md +4 -1
  3. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/config/model.py +11 -1
  4. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/torch_datasets/datasets/site.py +3 -0
  5. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler.egg-info/PKG-INFO +5 -2
  6. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/LICENSE +0 -0
  7. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/__init__.py +0 -0
  8. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/config/__init__.py +0 -0
  9. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/config/load.py +0 -0
  10. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/config/save.py +0 -0
  11. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/data/uk_gsp_locations_20220314.csv +0 -0
  12. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/data/uk_gsp_locations_20250109.csv +0 -0
  13. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/load/__init__.py +0 -0
  14. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/load/gsp.py +0 -0
  15. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/load/load_dataset.py +0 -0
  16. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/load/nwp/__init__.py +0 -0
  17. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/load/nwp/nwp.py +0 -0
  18. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/load/nwp/providers/__init__.py +0 -0
  19. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/load/nwp/providers/cloudcasting.py +0 -0
  20. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/load/nwp/providers/ecmwf.py +0 -0
  21. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/load/nwp/providers/gfs.py +0 -0
  22. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/load/nwp/providers/icon.py +0 -0
  23. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/load/nwp/providers/ukv.py +0 -0
  24. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/load/nwp/providers/utils.py +0 -0
  25. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/load/open_xarray_tensorstore.py +0 -0
  26. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/load/satellite.py +0 -0
  27. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/load/site.py +0 -0
  28. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/load/utils.py +0 -0
  29. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/numpy_sample/__init__.py +0 -0
  30. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/numpy_sample/collate.py +0 -0
  31. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/numpy_sample/common_types.py +0 -0
  32. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/numpy_sample/datetime_features.py +0 -0
  33. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/numpy_sample/gsp.py +0 -0
  34. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/numpy_sample/nwp.py +0 -0
  35. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/numpy_sample/satellite.py +0 -0
  36. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/numpy_sample/site.py +0 -0
  37. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/numpy_sample/sun_position.py +0 -0
  38. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/select/__init__.py +0 -0
  39. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/select/diff_channels.py +0 -0
  40. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/select/dropout.py +0 -0
  41. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/select/fill_time_periods.py +0 -0
  42. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/select/find_contiguous_time_periods.py +0 -0
  43. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/select/geospatial.py +0 -0
  44. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/select/location.py +0 -0
  45. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/select/select_spatial_slice.py +0 -0
  46. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/select/select_time_slice.py +0 -0
  47. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/torch_datasets/datasets/__init__.py +0 -0
  48. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/torch_datasets/datasets/picklecache.py +0 -0
  49. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/torch_datasets/datasets/pvnet_uk.py +0 -0
  50. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/torch_datasets/sample/__init__.py +0 -0
  51. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/torch_datasets/sample/base.py +0 -0
  52. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/torch_datasets/sample/site.py +0 -0
  53. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/torch_datasets/sample/uk_regional.py +0 -0
  54. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/torch_datasets/utils/__init__.py +0 -0
  55. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/torch_datasets/utils/add_alterate_coordinate_projections.py +0 -0
  56. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/torch_datasets/utils/config_normalization_values_to_dicts.py +0 -0
  57. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/torch_datasets/utils/diff_nwp_data.py +0 -0
  58. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/torch_datasets/utils/merge_and_fill_utils.py +0 -0
  59. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/torch_datasets/utils/spatial_slice_for_dataset.py +0 -0
  60. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/torch_datasets/utils/time_slice_for_dataset.py +0 -0
  61. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/torch_datasets/utils/valid_time_periods.py +0 -0
  62. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/torch_datasets/utils/validation_utils.py +0 -0
  63. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler/utils.py +0 -0
  64. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler.egg-info/SOURCES.txt +0 -0
  65. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler.egg-info/dependency_links.txt +0 -0
  66. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler.egg-info/requires.txt +0 -0
  67. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/ocf_data_sampler.egg-info/top_level.txt +0 -0
  68. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/pyproject.toml +0 -0
  69. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/scripts/download_gsp_location_data.py +0 -0
  70. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/scripts/refactor_site.py +0 -0
  71. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/setup.cfg +0 -0
  72. {ocf_data_sampler-0.5.20 → ocf_data_sampler-0.5.23}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ocf-data-sampler
3
- Version: 0.5.20
3
+ Version: 0.5.23
4
4
  Author: James Fulton, Peter Dudfield
5
5
  Author-email: Open Climate Fix team <info@openclimatefix.org>
6
6
  License: MIT License
@@ -50,7 +50,7 @@ Requires-Dist: zarr>=3
50
50
  # ocf-data-sampler
51
51
 
52
52
  <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
53
- [![All Contributors](https://img.shields.io/badge/all_contributors-14-orange.svg?style=flat-square)](#contributors-)
53
+ [![All Contributors](https://img.shields.io/badge/all_contributors-15-orange.svg?style=flat-square)](#contributors-)
54
54
  <!-- ALL-CONTRIBUTORS-BADGE:END -->
55
55
 
56
56
  [![tags badge](https://img.shields.io/github/v/tag/openclimatefix/ocf-data-sampler?include_prereleases&sort=semver&color=FFAC5F)](https://github.com/openclimatefix/ocf-data-sampler/tags)
@@ -137,6 +137,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
137
137
  <td align="center" valign="top" width="14.28%"><a href="https://drona-gyawali.github.io/"><img src="https://avatars.githubusercontent.com/u/170401554?v=4?s=100" width="100px;" alt="Dorna Raj Gyawali"/><br /><sub><b>Dorna Raj Gyawali</b></sub></a><br /><a href="https://github.com/openclimatefix/ocf-data-sampler/commits?author=drona-gyawali" title="Code">💻</a></td>
138
138
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/adnanhashmi25"><img src="https://avatars.githubusercontent.com/u/55550094?v=4?s=100" width="100px;" alt="Adnan Hashmi"/><br /><sub><b>Adnan Hashmi</b></sub></a><br /><a href="https://github.com/openclimatefix/ocf-data-sampler/commits?author=adnanhashmi25" title="Code">💻</a></td>
139
139
  </tr>
140
+ <tr>
141
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/utsav-pal"><img src="https://avatars.githubusercontent.com/u/159793156?v=4?s=100" width="100px;" alt="utsav-pal"/><br /><sub><b>utsav-pal</b></sub></a><br /><a href="https://github.com/openclimatefix/ocf-data-sampler/commits?author=utsav-pal" title="Code">💻</a></td>
142
+ </tr>
140
143
  </tbody>
141
144
  </table>
142
145
 
@@ -1,7 +1,7 @@
1
1
  # ocf-data-sampler
2
2
 
3
3
  <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
4
- [![All Contributors](https://img.shields.io/badge/all_contributors-14-orange.svg?style=flat-square)](#contributors-)
4
+ [![All Contributors](https://img.shields.io/badge/all_contributors-15-orange.svg?style=flat-square)](#contributors-)
5
5
  <!-- ALL-CONTRIBUTORS-BADGE:END -->
6
6
 
7
7
  [![tags badge](https://img.shields.io/github/v/tag/openclimatefix/ocf-data-sampler?include_prereleases&sort=semver&color=FFAC5F)](https://github.com/openclimatefix/ocf-data-sampler/tags)
@@ -88,6 +88,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
88
88
  <td align="center" valign="top" width="14.28%"><a href="https://drona-gyawali.github.io/"><img src="https://avatars.githubusercontent.com/u/170401554?v=4?s=100" width="100px;" alt="Dorna Raj Gyawali"/><br /><sub><b>Dorna Raj Gyawali</b></sub></a><br /><a href="https://github.com/openclimatefix/ocf-data-sampler/commits?author=drona-gyawali" title="Code">💻</a></td>
89
89
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/adnanhashmi25"><img src="https://avatars.githubusercontent.com/u/55550094?v=4?s=100" width="100px;" alt="Adnan Hashmi"/><br /><sub><b>Adnan Hashmi</b></sub></a><br /><a href="https://github.com/openclimatefix/ocf-data-sampler/commits?author=adnanhashmi25" title="Code">💻</a></td>
90
90
  </tr>
91
+ <tr>
92
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/utsav-pal"><img src="https://avatars.githubusercontent.com/u/159793156?v=4?s=100" width="100px;" alt="utsav-pal"/><br /><sub><b>utsav-pal</b></sub></a><br /><a href="https://github.com/openclimatefix/ocf-data-sampler/commits?author=utsav-pal" title="Code">💻</a></td>
93
+ </tr>
91
94
  </tbody>
92
95
  </table>
93
96
 
@@ -337,9 +337,19 @@ class InputData(Base):
337
337
  site: Site | None = None
338
338
  solar_position: SolarPosition | None = None
339
339
 
340
+ @model_validator(mode="after")
341
+ def check_site_or_gsp(self) -> "InputData":
342
+ """Ensure that either `site` or `gsp` is provided in the input data."""
343
+ if self.site is None and self.gsp is None:
344
+ raise ValueError(
345
+ "You must provide either `site` or `gsp` in the `input_data`",
346
+ )
347
+
348
+ return self
349
+
340
350
 
341
351
  class Configuration(Base):
342
352
  """Configuration model for the dataset."""
343
353
 
344
354
  general: General = General()
345
- input_data: InputData = InputData()
355
+ input_data: InputData = Field(default_factory=InputData)
@@ -261,6 +261,9 @@ class SitesDataset(PickleCacheMixin, Dataset):
261
261
 
262
262
  @override
263
263
  def __getitem__(self, idx: int) -> dict:
264
+
265
+ idx = int(idx)
266
+
264
267
  # Get the coordinates of the sample
265
268
  t0, site_id = self.valid_t0_and_site_ids.iloc[idx]
266
269
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ocf-data-sampler
3
- Version: 0.5.20
3
+ Version: 0.5.23
4
4
  Author: James Fulton, Peter Dudfield
5
5
  Author-email: Open Climate Fix team <info@openclimatefix.org>
6
6
  License: MIT License
@@ -50,7 +50,7 @@ Requires-Dist: zarr>=3
50
50
  # ocf-data-sampler
51
51
 
52
52
  <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
53
- [![All Contributors](https://img.shields.io/badge/all_contributors-14-orange.svg?style=flat-square)](#contributors-)
53
+ [![All Contributors](https://img.shields.io/badge/all_contributors-15-orange.svg?style=flat-square)](#contributors-)
54
54
  <!-- ALL-CONTRIBUTORS-BADGE:END -->
55
55
 
56
56
  [![tags badge](https://img.shields.io/github/v/tag/openclimatefix/ocf-data-sampler?include_prereleases&sort=semver&color=FFAC5F)](https://github.com/openclimatefix/ocf-data-sampler/tags)
@@ -137,6 +137,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
137
137
  <td align="center" valign="top" width="14.28%"><a href="https://drona-gyawali.github.io/"><img src="https://avatars.githubusercontent.com/u/170401554?v=4?s=100" width="100px;" alt="Dorna Raj Gyawali"/><br /><sub><b>Dorna Raj Gyawali</b></sub></a><br /><a href="https://github.com/openclimatefix/ocf-data-sampler/commits?author=drona-gyawali" title="Code">💻</a></td>
138
138
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/adnanhashmi25"><img src="https://avatars.githubusercontent.com/u/55550094?v=4?s=100" width="100px;" alt="Adnan Hashmi"/><br /><sub><b>Adnan Hashmi</b></sub></a><br /><a href="https://github.com/openclimatefix/ocf-data-sampler/commits?author=adnanhashmi25" title="Code">💻</a></td>
139
139
  </tr>
140
+ <tr>
141
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/utsav-pal"><img src="https://avatars.githubusercontent.com/u/159793156?v=4?s=100" width="100px;" alt="utsav-pal"/><br /><sub><b>utsav-pal</b></sub></a><br /><a href="https://github.com/openclimatefix/ocf-data-sampler/commits?author=utsav-pal" title="Code">💻</a></td>
142
+ </tr>
140
143
  </tbody>
141
144
  </table>
142
145