ocf-data-sampler 0.0.27__tar.gz → 0.0.29__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 (73) hide show
  1. {ocf_data_sampler-0.0.27/ocf_data_sampler.egg-info → ocf_data_sampler-0.0.29}/PKG-INFO +64 -5
  2. ocf_data_sampler-0.0.29/README.md +92 -0
  3. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29/ocf_data_sampler.egg-info}/PKG-INFO +64 -5
  4. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/pyproject.toml +1 -1
  5. ocf_data_sampler-0.0.27/README.md +0 -33
  6. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/LICENSE +0 -0
  7. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/MANIFEST.in +0 -0
  8. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/__init__.py +0 -0
  9. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/config/__init__.py +0 -0
  10. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/config/load.py +0 -0
  11. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/config/model.py +0 -0
  12. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/config/save.py +0 -0
  13. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/constants.py +0 -0
  14. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/data/uk_gsp_locations.csv +0 -0
  15. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/load/__init__.py +0 -0
  16. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/load/gsp.py +0 -0
  17. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/load/load_dataset.py +0 -0
  18. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/load/nwp/__init__.py +0 -0
  19. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/load/nwp/nwp.py +0 -0
  20. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/load/nwp/providers/__init__.py +0 -0
  21. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/load/nwp/providers/ecmwf.py +0 -0
  22. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/load/nwp/providers/ukv.py +0 -0
  23. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/load/nwp/providers/utils.py +0 -0
  24. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/load/satellite.py +0 -0
  25. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/load/site.py +0 -0
  26. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/load/utils.py +0 -0
  27. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/numpy_batch/__init__.py +0 -0
  28. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/numpy_batch/gsp.py +0 -0
  29. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/numpy_batch/nwp.py +0 -0
  30. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/numpy_batch/satellite.py +0 -0
  31. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/numpy_batch/site.py +0 -0
  32. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/numpy_batch/sun_position.py +0 -0
  33. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/select/__init__.py +0 -0
  34. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/select/dropout.py +0 -0
  35. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/select/fill_time_periods.py +0 -0
  36. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/select/find_contiguous_time_periods.py +0 -0
  37. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/select/geospatial.py +0 -0
  38. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/select/location.py +0 -0
  39. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/select/select_spatial_slice.py +0 -0
  40. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/select/select_time_slice.py +0 -0
  41. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/select/spatial_slice_for_dataset.py +0 -0
  42. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/select/time_slice_for_dataset.py +0 -0
  43. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/torch_datasets/__init__.py +0 -0
  44. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/torch_datasets/process_and_combine.py +0 -0
  45. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/torch_datasets/pvnet_uk_regional.py +0 -0
  46. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/torch_datasets/site.py +0 -0
  47. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/torch_datasets/valid_time_periods.py +0 -0
  48. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler/utils.py +0 -0
  49. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler.egg-info/SOURCES.txt +0 -0
  50. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler.egg-info/dependency_links.txt +0 -0
  51. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler.egg-info/requires.txt +0 -0
  52. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/ocf_data_sampler.egg-info/top_level.txt +0 -0
  53. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/scripts/refactor_site.py +0 -0
  54. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/setup.cfg +0 -0
  55. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/tests/__init__.py +0 -0
  56. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/tests/config/test_config.py +0 -0
  57. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/tests/conftest.py +0 -0
  58. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/tests/load/test_load_gsp.py +0 -0
  59. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/tests/load/test_load_nwp.py +0 -0
  60. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/tests/load/test_load_satellite.py +0 -0
  61. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/tests/load/test_load_sites.py +0 -0
  62. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/tests/numpy_batch/test_gsp.py +0 -0
  63. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/tests/numpy_batch/test_nwp.py +0 -0
  64. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/tests/numpy_batch/test_satellite.py +0 -0
  65. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/tests/numpy_batch/test_sun_position.py +0 -0
  66. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/tests/select/test_dropout.py +0 -0
  67. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/tests/select/test_fill_time_periods.py +0 -0
  68. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/tests/select/test_find_contiguous_time_periods.py +0 -0
  69. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/tests/select/test_location.py +0 -0
  70. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/tests/select/test_select_spatial_slice.py +0 -0
  71. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/tests/select/test_select_time_slice.py +0 -0
  72. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/tests/torch_datasets/test_pvnet_uk_regional.py +0 -0
  73. {ocf_data_sampler-0.0.27 → ocf_data_sampler-0.0.29}/tests/torch_datasets/test_site.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ocf_data_sampler
3
- Version: 0.0.27
3
+ Version: 0.0.29
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
@@ -53,15 +53,67 @@ Provides-Extra: docs
53
53
  Requires-Dist: mkdocs>=1.2; extra == "docs"
54
54
  Requires-Dist: mkdocs-material>=8.0; extra == "docs"
55
55
 
56
- # OCF Data Sampler
56
+ # ocf-data-sampler
57
+
57
58
  <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
58
59
  [![All Contributors](https://img.shields.io/badge/all_contributors-5-orange.svg?style=flat-square)](#contributors-)
59
60
  <!-- ALL-CONTRIBUTORS-BADGE:END -->
60
- [![ease of contribution: easy](https://img.shields.io/badge/ease%20of%20contribution:%20easy-32bd50)](https://github.com/openclimatefix/ocf-meta-repo?tab=readme-ov-file#overview-of-ocfs-nowcasting-repositories)
61
61
 
62
- A repo for sampling from weather data for renewable energy prediction
62
+ [![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)
63
+ [![ease of contribution: easy](https://img.shields.io/badge/ease%20of%20contribution:%20easy-32bd50)](https://github.com/openclimatefix#how-easy-is-it-to-get-involved)
63
64
 
64
- ## Contributors
65
+ **ocf-data-sampler** contains all the tools needed to create batches and feed them to our models, such as [PVNet](https://github.com/openclimatefix/PVNet/). The data we work with—typically energy data, satellite imagery, and numerical weather predictions (NWPs)—is usually too heavy to do this on the fly, so that's where this repo comes in: handling steps like opening the data, selecting the right samples, normalising and reshaping, and saving to and reading from disk.
66
+
67
+ We are currently migrating to this repo from [ocf_datapipes](https://github.com/openclimatefix/ocf_datapipes/), which performs the same functions but is built around `PyTorch DataPipes`, which are quite cumbersome to work with and are no longer maintained by PyTorch. **ocf-data-sampler** uses `PyTorch Datasets`, and we've taken the opportunity to make the code much cleaner and more manageable.
68
+
69
+ > [!Note]
70
+ > This repository is still in development and does not yet have the full
71
+ > functionality of its predecessor, [ocf_datapipes](https://github.com/openclimatefix/ocf_datapipes/).
72
+ > It might not be ready for use out of the box! We would really appreciate any help to let us make the transition faster.
73
+
74
+ ## Documentation
75
+
76
+ **ocf-data-sampler** doesn't have external documentation _yet_; you can read a bit about how our torch datasets work in the Readme [here](https://github.com/openclimatefix/ocf-data-sampler/tree/readme-update/ocf_data_sampler/torch_datasets).
77
+
78
+
79
+ ## FAQ
80
+
81
+ If you have any questions about this or any other of our repos, don't hesitate to hop to our [Discussions Page](https://github.com/orgs/openclimatefix/discussions)!
82
+
83
+ ### How does ocf-data-sampler deal with data sources that use different projections (e.g. some are in latitude-longitude, and some in OSGB)?
84
+
85
+ When creating samples, we make a spatial crop of a preset size centred around a point of interest (POI, usually a solar or wind farm). The size of the crop is set not in miles or kilometres, but in 'pixels', which would be different for different data sources, depending on their spatial resolution, projections they use, and where the POI is. For example, a latitude-longitude source with a 1° resolution will have pixel sizes corresponding to very different 'surface' distances (that you might measure in, e.g., kilometres) from a source with 0.1° resolution. The pixel size will even be different for the same source depending on how close the POI is to the equator!
86
+
87
+ Instead of trying to accommodate for all these differences and make all the sources use the same spatial grid, we translate the POI's position into the corresponding coordinate system and select the crop using the source's original grid. This 'snapshot' is then passed to the model with no additional information on what specific coordinates it represents; instead, since the size is always the same and the POI is always in the centre, the model gets consistent information on the measurements at a location near the POI and how it affects the target, without any explicit knowledge of where that location is in coordinate system terms.
88
+
89
+ ## Development
90
+
91
+ You can install **ocf-data-sampler** for development as follows:
92
+
93
+ ```
94
+ pip install git+https://github.com/openclimatefix/ocf-data-sampler.git
95
+ ```
96
+
97
+ ### Running the test suite
98
+
99
+ The tests in this project use `pytest`. Once you have it installed, you can run it from the project's directory:
100
+
101
+ ```
102
+ cd ocf-data-sampler
103
+ pytest
104
+ ```
105
+
106
+ ## Contributing and community
107
+
108
+ [![issues badge](https://img.shields.io/github/issues/openclimatefix/ocf-data-sampler?color=FFAC5F)](https://github.com/openclimatefix/ocf-data-sampler/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)
109
+
110
+ - PR's are welcome! See the [Organisation Profile](https://github.com/openclimatefix) for details on contributing
111
+ - Find out about our other projects in the [OCF Meta Repo](https://github.com/openclimatefix/ocf-meta-repo)
112
+ - Check out the [OCF blog](https://openclimatefix.org/blog) for updates
113
+ - Follow OCF on [LinkedIn](https://uk.linkedin.com/company/open-climate-fix)
114
+
115
+
116
+ ## Contributors
65
117
 
66
118
  Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
67
119
 
@@ -86,3 +138,10 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
86
138
  <!-- ALL-CONTRIBUTORS-LIST:END -->
87
139
 
88
140
  This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
141
+
142
+ ---
143
+
144
+ *Part of the [Open Climate Fix](https://github.com/orgs/openclimatefix/people) community.*
145
+
146
+ [![OCF Logo](https://cdn.prod.website-files.com/62d92550f6774db58d441cca/6324a2038936ecda71599a8b_OCF_Logo_black_trans.png)](https://openclimatefix.org)
147
+
@@ -0,0 +1,92 @@
1
+ # ocf-data-sampler
2
+
3
+ <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
4
+ [![All Contributors](https://img.shields.io/badge/all_contributors-5-orange.svg?style=flat-square)](#contributors-)
5
+ <!-- ALL-CONTRIBUTORS-BADGE:END -->
6
+
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)
8
+ [![ease of contribution: easy](https://img.shields.io/badge/ease%20of%20contribution:%20easy-32bd50)](https://github.com/openclimatefix#how-easy-is-it-to-get-involved)
9
+
10
+ **ocf-data-sampler** contains all the tools needed to create batches and feed them to our models, such as [PVNet](https://github.com/openclimatefix/PVNet/). The data we work with—typically energy data, satellite imagery, and numerical weather predictions (NWPs)—is usually too heavy to do this on the fly, so that's where this repo comes in: handling steps like opening the data, selecting the right samples, normalising and reshaping, and saving to and reading from disk.
11
+
12
+ We are currently migrating to this repo from [ocf_datapipes](https://github.com/openclimatefix/ocf_datapipes/), which performs the same functions but is built around `PyTorch DataPipes`, which are quite cumbersome to work with and are no longer maintained by PyTorch. **ocf-data-sampler** uses `PyTorch Datasets`, and we've taken the opportunity to make the code much cleaner and more manageable.
13
+
14
+ > [!Note]
15
+ > This repository is still in development and does not yet have the full
16
+ > functionality of its predecessor, [ocf_datapipes](https://github.com/openclimatefix/ocf_datapipes/).
17
+ > It might not be ready for use out of the box! We would really appreciate any help to let us make the transition faster.
18
+
19
+ ## Documentation
20
+
21
+ **ocf-data-sampler** doesn't have external documentation _yet_; you can read a bit about how our torch datasets work in the Readme [here](https://github.com/openclimatefix/ocf-data-sampler/tree/readme-update/ocf_data_sampler/torch_datasets).
22
+
23
+
24
+ ## FAQ
25
+
26
+ If you have any questions about this or any other of our repos, don't hesitate to hop to our [Discussions Page](https://github.com/orgs/openclimatefix/discussions)!
27
+
28
+ ### How does ocf-data-sampler deal with data sources that use different projections (e.g. some are in latitude-longitude, and some in OSGB)?
29
+
30
+ When creating samples, we make a spatial crop of a preset size centred around a point of interest (POI, usually a solar or wind farm). The size of the crop is set not in miles or kilometres, but in 'pixels', which would be different for different data sources, depending on their spatial resolution, projections they use, and where the POI is. For example, a latitude-longitude source with a 1° resolution will have pixel sizes corresponding to very different 'surface' distances (that you might measure in, e.g., kilometres) from a source with 0.1° resolution. The pixel size will even be different for the same source depending on how close the POI is to the equator!
31
+
32
+ Instead of trying to accommodate for all these differences and make all the sources use the same spatial grid, we translate the POI's position into the corresponding coordinate system and select the crop using the source's original grid. This 'snapshot' is then passed to the model with no additional information on what specific coordinates it represents; instead, since the size is always the same and the POI is always in the centre, the model gets consistent information on the measurements at a location near the POI and how it affects the target, without any explicit knowledge of where that location is in coordinate system terms.
33
+
34
+ ## Development
35
+
36
+ You can install **ocf-data-sampler** for development as follows:
37
+
38
+ ```
39
+ pip install git+https://github.com/openclimatefix/ocf-data-sampler.git
40
+ ```
41
+
42
+ ### Running the test suite
43
+
44
+ The tests in this project use `pytest`. Once you have it installed, you can run it from the project's directory:
45
+
46
+ ```
47
+ cd ocf-data-sampler
48
+ pytest
49
+ ```
50
+
51
+ ## Contributing and community
52
+
53
+ [![issues badge](https://img.shields.io/github/issues/openclimatefix/ocf-data-sampler?color=FFAC5F)](https://github.com/openclimatefix/ocf-data-sampler/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)
54
+
55
+ - PR's are welcome! See the [Organisation Profile](https://github.com/openclimatefix) for details on contributing
56
+ - Find out about our other projects in the [OCF Meta Repo](https://github.com/openclimatefix/ocf-meta-repo)
57
+ - Check out the [OCF blog](https://openclimatefix.org/blog) for updates
58
+ - Follow OCF on [LinkedIn](https://uk.linkedin.com/company/open-climate-fix)
59
+
60
+
61
+ ## Contributors
62
+
63
+ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
64
+
65
+ <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
66
+ <!-- prettier-ignore-start -->
67
+ <!-- markdownlint-disable -->
68
+ <table>
69
+ <tbody>
70
+ <tr>
71
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/dfulu"><img src="https://avatars.githubusercontent.com/u/41546094?v=4?s=100" width="100px;" alt="James Fulton"/><br /><sub><b>James Fulton</b></sub></a><br /><a href="https://github.com/openclimatefix/ocf-data-sampler/commits?author=dfulu" title="Code">💻</a></td>
72
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/AUdaltsova"><img src="https://avatars.githubusercontent.com/u/43303448?v=4?s=100" width="100px;" alt="Alexandra Udaltsova"/><br /><sub><b>Alexandra Udaltsova</b></sub></a><br /><a href="https://github.com/openclimatefix/ocf-data-sampler/commits?author=AUdaltsova" title="Code">💻</a></td>
73
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/Sukh-P"><img src="https://avatars.githubusercontent.com/u/42407101?v=4?s=100" width="100px;" alt="Sukhil Patel"/><br /><sub><b>Sukhil Patel</b></sub></a><br /><a href="https://github.com/openclimatefix/ocf-data-sampler/commits?author=Sukh-P" title="Code">💻</a></td>
74
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/peterdudfield"><img src="https://avatars.githubusercontent.com/u/34686298?v=4?s=100" width="100px;" alt="Peter Dudfield"/><br /><sub><b>Peter Dudfield</b></sub></a><br /><a href="https://github.com/openclimatefix/ocf-data-sampler/commits?author=peterdudfield" title="Code">💻</a></td>
75
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/VikramsDataScience"><img src="https://avatars.githubusercontent.com/u/45002417?v=4?s=100" width="100px;" alt="Vikram Pande"/><br /><sub><b>Vikram Pande</b></sub></a><br /><a href="https://github.com/openclimatefix/ocf-data-sampler/commits?author=VikramsDataScience" title="Code">💻</a></td>
76
+ </tr>
77
+ </tbody>
78
+ </table>
79
+
80
+ <!-- markdownlint-restore -->
81
+ <!-- prettier-ignore-end -->
82
+
83
+ <!-- ALL-CONTRIBUTORS-LIST:END -->
84
+
85
+ This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
86
+
87
+ ---
88
+
89
+ *Part of the [Open Climate Fix](https://github.com/orgs/openclimatefix/people) community.*
90
+
91
+ [![OCF Logo](https://cdn.prod.website-files.com/62d92550f6774db58d441cca/6324a2038936ecda71599a8b_OCF_Logo_black_trans.png)](https://openclimatefix.org)
92
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ocf_data_sampler
3
- Version: 0.0.27
3
+ Version: 0.0.29
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
@@ -53,15 +53,67 @@ Provides-Extra: docs
53
53
  Requires-Dist: mkdocs>=1.2; extra == "docs"
54
54
  Requires-Dist: mkdocs-material>=8.0; extra == "docs"
55
55
 
56
- # OCF Data Sampler
56
+ # ocf-data-sampler
57
+
57
58
  <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
58
59
  [![All Contributors](https://img.shields.io/badge/all_contributors-5-orange.svg?style=flat-square)](#contributors-)
59
60
  <!-- ALL-CONTRIBUTORS-BADGE:END -->
60
- [![ease of contribution: easy](https://img.shields.io/badge/ease%20of%20contribution:%20easy-32bd50)](https://github.com/openclimatefix/ocf-meta-repo?tab=readme-ov-file#overview-of-ocfs-nowcasting-repositories)
61
61
 
62
- A repo for sampling from weather data for renewable energy prediction
62
+ [![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)
63
+ [![ease of contribution: easy](https://img.shields.io/badge/ease%20of%20contribution:%20easy-32bd50)](https://github.com/openclimatefix#how-easy-is-it-to-get-involved)
63
64
 
64
- ## Contributors
65
+ **ocf-data-sampler** contains all the tools needed to create batches and feed them to our models, such as [PVNet](https://github.com/openclimatefix/PVNet/). The data we work with—typically energy data, satellite imagery, and numerical weather predictions (NWPs)—is usually too heavy to do this on the fly, so that's where this repo comes in: handling steps like opening the data, selecting the right samples, normalising and reshaping, and saving to and reading from disk.
66
+
67
+ We are currently migrating to this repo from [ocf_datapipes](https://github.com/openclimatefix/ocf_datapipes/), which performs the same functions but is built around `PyTorch DataPipes`, which are quite cumbersome to work with and are no longer maintained by PyTorch. **ocf-data-sampler** uses `PyTorch Datasets`, and we've taken the opportunity to make the code much cleaner and more manageable.
68
+
69
+ > [!Note]
70
+ > This repository is still in development and does not yet have the full
71
+ > functionality of its predecessor, [ocf_datapipes](https://github.com/openclimatefix/ocf_datapipes/).
72
+ > It might not be ready for use out of the box! We would really appreciate any help to let us make the transition faster.
73
+
74
+ ## Documentation
75
+
76
+ **ocf-data-sampler** doesn't have external documentation _yet_; you can read a bit about how our torch datasets work in the Readme [here](https://github.com/openclimatefix/ocf-data-sampler/tree/readme-update/ocf_data_sampler/torch_datasets).
77
+
78
+
79
+ ## FAQ
80
+
81
+ If you have any questions about this or any other of our repos, don't hesitate to hop to our [Discussions Page](https://github.com/orgs/openclimatefix/discussions)!
82
+
83
+ ### How does ocf-data-sampler deal with data sources that use different projections (e.g. some are in latitude-longitude, and some in OSGB)?
84
+
85
+ When creating samples, we make a spatial crop of a preset size centred around a point of interest (POI, usually a solar or wind farm). The size of the crop is set not in miles or kilometres, but in 'pixels', which would be different for different data sources, depending on their spatial resolution, projections they use, and where the POI is. For example, a latitude-longitude source with a 1° resolution will have pixel sizes corresponding to very different 'surface' distances (that you might measure in, e.g., kilometres) from a source with 0.1° resolution. The pixel size will even be different for the same source depending on how close the POI is to the equator!
86
+
87
+ Instead of trying to accommodate for all these differences and make all the sources use the same spatial grid, we translate the POI's position into the corresponding coordinate system and select the crop using the source's original grid. This 'snapshot' is then passed to the model with no additional information on what specific coordinates it represents; instead, since the size is always the same and the POI is always in the centre, the model gets consistent information on the measurements at a location near the POI and how it affects the target, without any explicit knowledge of where that location is in coordinate system terms.
88
+
89
+ ## Development
90
+
91
+ You can install **ocf-data-sampler** for development as follows:
92
+
93
+ ```
94
+ pip install git+https://github.com/openclimatefix/ocf-data-sampler.git
95
+ ```
96
+
97
+ ### Running the test suite
98
+
99
+ The tests in this project use `pytest`. Once you have it installed, you can run it from the project's directory:
100
+
101
+ ```
102
+ cd ocf-data-sampler
103
+ pytest
104
+ ```
105
+
106
+ ## Contributing and community
107
+
108
+ [![issues badge](https://img.shields.io/github/issues/openclimatefix/ocf-data-sampler?color=FFAC5F)](https://github.com/openclimatefix/ocf-data-sampler/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)
109
+
110
+ - PR's are welcome! See the [Organisation Profile](https://github.com/openclimatefix) for details on contributing
111
+ - Find out about our other projects in the [OCF Meta Repo](https://github.com/openclimatefix/ocf-meta-repo)
112
+ - Check out the [OCF blog](https://openclimatefix.org/blog) for updates
113
+ - Follow OCF on [LinkedIn](https://uk.linkedin.com/company/open-climate-fix)
114
+
115
+
116
+ ## Contributors
65
117
 
66
118
  Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
67
119
 
@@ -86,3 +138,10 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
86
138
  <!-- ALL-CONTRIBUTORS-LIST:END -->
87
139
 
88
140
  This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
141
+
142
+ ---
143
+
144
+ *Part of the [Open Climate Fix](https://github.com/orgs/openclimatefix/people) community.*
145
+
146
+ [![OCF Logo](https://cdn.prod.website-files.com/62d92550f6774db58d441cca/6324a2038936ecda71599a8b_OCF_Logo_black_trans.png)](https://openclimatefix.org)
147
+
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ocf_data_sampler"
7
- version = "0.0.27"
7
+ version = "0.0.29"
8
8
  license = { file = "LICENSE" }
9
9
  readme = "README.md"
10
10
  description = "Sample from weather data for renewable energy prediction"
@@ -1,33 +0,0 @@
1
- # OCF Data Sampler
2
- <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
3
- [![All Contributors](https://img.shields.io/badge/all_contributors-5-orange.svg?style=flat-square)](#contributors-)
4
- <!-- ALL-CONTRIBUTORS-BADGE:END -->
5
- [![ease of contribution: easy](https://img.shields.io/badge/ease%20of%20contribution:%20easy-32bd50)](https://github.com/openclimatefix/ocf-meta-repo?tab=readme-ov-file#overview-of-ocfs-nowcasting-repositories)
6
-
7
- A repo for sampling from weather data for renewable energy prediction
8
-
9
- ## Contributors ✨
10
-
11
- Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
12
-
13
- <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
14
- <!-- prettier-ignore-start -->
15
- <!-- markdownlint-disable -->
16
- <table>
17
- <tbody>
18
- <tr>
19
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/dfulu"><img src="https://avatars.githubusercontent.com/u/41546094?v=4?s=100" width="100px;" alt="James Fulton"/><br /><sub><b>James Fulton</b></sub></a><br /><a href="https://github.com/openclimatefix/ocf-data-sampler/commits?author=dfulu" title="Code">💻</a></td>
20
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/AUdaltsova"><img src="https://avatars.githubusercontent.com/u/43303448?v=4?s=100" width="100px;" alt="Alexandra Udaltsova"/><br /><sub><b>Alexandra Udaltsova</b></sub></a><br /><a href="https://github.com/openclimatefix/ocf-data-sampler/commits?author=AUdaltsova" title="Code">💻</a></td>
21
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/Sukh-P"><img src="https://avatars.githubusercontent.com/u/42407101?v=4?s=100" width="100px;" alt="Sukhil Patel"/><br /><sub><b>Sukhil Patel</b></sub></a><br /><a href="https://github.com/openclimatefix/ocf-data-sampler/commits?author=Sukh-P" title="Code">💻</a></td>
22
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/peterdudfield"><img src="https://avatars.githubusercontent.com/u/34686298?v=4?s=100" width="100px;" alt="Peter Dudfield"/><br /><sub><b>Peter Dudfield</b></sub></a><br /><a href="https://github.com/openclimatefix/ocf-data-sampler/commits?author=peterdudfield" title="Code">💻</a></td>
23
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/VikramsDataScience"><img src="https://avatars.githubusercontent.com/u/45002417?v=4?s=100" width="100px;" alt="Vikram Pande"/><br /><sub><b>Vikram Pande</b></sub></a><br /><a href="https://github.com/openclimatefix/ocf-data-sampler/commits?author=VikramsDataScience" title="Code">💻</a></td>
24
- </tr>
25
- </tbody>
26
- </table>
27
-
28
- <!-- markdownlint-restore -->
29
- <!-- prettier-ignore-end -->
30
-
31
- <!-- ALL-CONTRIBUTORS-LIST:END -->
32
-
33
- This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!