PVNet 3.0.37__tar.gz → 3.0.39__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.
Files changed (49) hide show
  1. {pvnet-3.0.37 → pvnet-3.0.39}/PKG-INFO +12 -7
  2. {pvnet-3.0.37 → pvnet-3.0.39}/PVNet.egg-info/PKG-INFO +12 -7
  3. {pvnet-3.0.37 → pvnet-3.0.39}/README.md +11 -6
  4. pvnet-3.0.39/pvnet/__init__.py +2 -0
  5. {pvnet-3.0.37 → pvnet-3.0.39}/pvnet/data/base.py +9 -1
  6. {pvnet-3.0.37 → pvnet-3.0.39}/pvnet/data/wind_datamodule.py +3 -0
  7. pvnet-3.0.37/pvnet/__init__.py +0 -2
  8. {pvnet-3.0.37 → pvnet-3.0.39}/LICENSE +0 -0
  9. {pvnet-3.0.37 → pvnet-3.0.39}/MANIFEST.in +0 -0
  10. {pvnet-3.0.37 → pvnet-3.0.39}/PVNet.egg-info/SOURCES.txt +0 -0
  11. {pvnet-3.0.37 → pvnet-3.0.39}/PVNet.egg-info/dependency_links.txt +0 -0
  12. {pvnet-3.0.37 → pvnet-3.0.39}/PVNet.egg-info/requires.txt +0 -0
  13. {pvnet-3.0.37 → pvnet-3.0.39}/PVNet.egg-info/top_level.txt +0 -0
  14. {pvnet-3.0.37 → pvnet-3.0.39}/pvnet/callbacks.py +0 -0
  15. {pvnet-3.0.37 → pvnet-3.0.39}/pvnet/data/__init__.py +0 -0
  16. {pvnet-3.0.37 → pvnet-3.0.39}/pvnet/data/datamodule.py +0 -0
  17. {pvnet-3.0.37 → pvnet-3.0.39}/pvnet/data/pv_site_datamodule.py +0 -0
  18. {pvnet-3.0.37 → pvnet-3.0.39}/pvnet/data/utils.py +0 -0
  19. {pvnet-3.0.37 → pvnet-3.0.39}/pvnet/load_model.py +0 -0
  20. {pvnet-3.0.37 → pvnet-3.0.39}/pvnet/models/__init__.py +0 -0
  21. {pvnet-3.0.37 → pvnet-3.0.39}/pvnet/models/base_model.py +0 -0
  22. {pvnet-3.0.37 → pvnet-3.0.39}/pvnet/models/baseline/__init__.py +0 -0
  23. {pvnet-3.0.37 → pvnet-3.0.39}/pvnet/models/baseline/last_value.py +0 -0
  24. {pvnet-3.0.37 → pvnet-3.0.39}/pvnet/models/baseline/single_value.py +0 -0
  25. {pvnet-3.0.37 → pvnet-3.0.39}/pvnet/models/ensemble.py +0 -0
  26. {pvnet-3.0.37 → pvnet-3.0.39}/pvnet/models/multimodal/__init__.py +0 -0
  27. {pvnet-3.0.37 → pvnet-3.0.39}/pvnet/models/multimodal/basic_blocks.py +0 -0
  28. {pvnet-3.0.37 → pvnet-3.0.39}/pvnet/models/multimodal/encoders/__init__.py +0 -0
  29. {pvnet-3.0.37 → pvnet-3.0.39}/pvnet/models/multimodal/encoders/basic_blocks.py +0 -0
  30. {pvnet-3.0.37 → pvnet-3.0.39}/pvnet/models/multimodal/encoders/encoders2d.py +0 -0
  31. {pvnet-3.0.37 → pvnet-3.0.39}/pvnet/models/multimodal/encoders/encoders3d.py +0 -0
  32. {pvnet-3.0.37 → pvnet-3.0.39}/pvnet/models/multimodal/encoders/encodersRNN.py +0 -0
  33. {pvnet-3.0.37 → pvnet-3.0.39}/pvnet/models/multimodal/linear_networks/__init__.py +0 -0
  34. {pvnet-3.0.37 → pvnet-3.0.39}/pvnet/models/multimodal/linear_networks/basic_blocks.py +0 -0
  35. {pvnet-3.0.37 → pvnet-3.0.39}/pvnet/models/multimodal/linear_networks/networks.py +0 -0
  36. {pvnet-3.0.37 → pvnet-3.0.39}/pvnet/models/multimodal/multimodal.py +0 -0
  37. {pvnet-3.0.37 → pvnet-3.0.39}/pvnet/models/multimodal/multimodal_base.py +0 -0
  38. {pvnet-3.0.37 → pvnet-3.0.39}/pvnet/models/multimodal/site_encoders/__init__.py +0 -0
  39. {pvnet-3.0.37 → pvnet-3.0.39}/pvnet/models/multimodal/site_encoders/basic_blocks.py +0 -0
  40. {pvnet-3.0.37 → pvnet-3.0.39}/pvnet/models/multimodal/site_encoders/encoders.py +0 -0
  41. {pvnet-3.0.37 → pvnet-3.0.39}/pvnet/models/multimodal/unimodal_teacher.py +0 -0
  42. {pvnet-3.0.37 → pvnet-3.0.39}/pvnet/models/utils.py +0 -0
  43. {pvnet-3.0.37 → pvnet-3.0.39}/pvnet/optimizers.py +0 -0
  44. {pvnet-3.0.37 → pvnet-3.0.39}/pvnet/training.py +0 -0
  45. {pvnet-3.0.37 → pvnet-3.0.39}/pvnet/utils.py +0 -0
  46. {pvnet-3.0.37 → pvnet-3.0.39}/pyproject.toml +0 -0
  47. {pvnet-3.0.37 → pvnet-3.0.39}/setup.cfg +0 -0
  48. {pvnet-3.0.37 → pvnet-3.0.39}/tests/test_end2end.py +0 -0
  49. {pvnet-3.0.37 → pvnet-3.0.39}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PVNet
3
- Version: 3.0.37
3
+ Version: 3.0.39
4
4
  Summary: PVNet
5
5
  Author-email: Peter Dudfield <info@openclimatefix.org>
6
6
  Description-Content-Type: text/markdown
@@ -65,12 +65,12 @@ together.
65
65
 
66
66
  ## Experiments
67
67
 
68
- **Link to our workshop paper coming soon**
68
+ Our paper based on this repo was accepted into the Tackling Climate Change with Machine Learning workshop at ICLR 2024 and can be viewed [here](https://www.climatechange.ai/papers/iclr2024/46).
69
69
 
70
- Some very rough working notes on this model are
71
- [here](https://docs.google.com/document/d/1fbkfkBzp16WbnCg7RDuRDvgzInA6XQu3xh4NCjV-WDA/edit?usp=sharing).
70
+ Some slightly more structured notes on deliberate experiments we have performed with PVNet are [here](https://docs.google.com/document/d/1VumDwWd8YAfvXbOtJEv3ZJm_FHQDzrKXR0jU9vnvGQg).
72
71
 
73
- Some slightly more structured notes on deliberate experiments we have performed with PVNet are [here](https://docs.google.com/document/d/1VumDwWd8YAfvXbOtJEv3ZJm_FHQDzrKXR0jU9vnvGQg/edit?usp=sharing)
72
+ Some very rough, early working notes on this model are
73
+ [here](https://docs.google.com/document/d/1fbkfkBzp16WbnCg7RDuRDvgzInA6XQu3xh4NCjV-WDA). These are now somewhat out of date.
74
74
 
75
75
 
76
76
 
@@ -200,10 +200,15 @@ Where `FULL-PATH-TO-REPO` represent the whole path to the PVNet repo on your loc
200
200
 
201
201
  ### Running the batch creation script
202
202
 
203
- Run the save_batches.py script to create batches with the following example arguments as:
203
+ Run the save_batches.py script to create batches if setting parameters in the datamodule config (`streamed_batches.yaml` in this example):
204
204
 
205
205
  ```
206
- python scripts/save_batches.py datamodule=streamed_batches +batch_output_dir="./output" +num_train_batches=10 +num_val_batches=5
206
+ python scripts/save_batches.py
207
+ ```
208
+ or with the following example arguments to override config:
209
+
210
+ ```
211
+ python scripts/save_batches.py datamodule=streamed_batches datamodule.batch_output_dir="./output" datamodule.num_train_batches=10 datamodule.num_val_batches=5
207
212
  ```
208
213
 
209
214
  In this function the datamodule argument looks for a config under `PVNet/configs/datamodule`. The examples here are either to use "premade_batches" or "streamed_batches".
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PVNet
3
- Version: 3.0.37
3
+ Version: 3.0.39
4
4
  Summary: PVNet
5
5
  Author-email: Peter Dudfield <info@openclimatefix.org>
6
6
  Description-Content-Type: text/markdown
@@ -65,12 +65,12 @@ together.
65
65
 
66
66
  ## Experiments
67
67
 
68
- **Link to our workshop paper coming soon**
68
+ Our paper based on this repo was accepted into the Tackling Climate Change with Machine Learning workshop at ICLR 2024 and can be viewed [here](https://www.climatechange.ai/papers/iclr2024/46).
69
69
 
70
- Some very rough working notes on this model are
71
- [here](https://docs.google.com/document/d/1fbkfkBzp16WbnCg7RDuRDvgzInA6XQu3xh4NCjV-WDA/edit?usp=sharing).
70
+ Some slightly more structured notes on deliberate experiments we have performed with PVNet are [here](https://docs.google.com/document/d/1VumDwWd8YAfvXbOtJEv3ZJm_FHQDzrKXR0jU9vnvGQg).
72
71
 
73
- Some slightly more structured notes on deliberate experiments we have performed with PVNet are [here](https://docs.google.com/document/d/1VumDwWd8YAfvXbOtJEv3ZJm_FHQDzrKXR0jU9vnvGQg/edit?usp=sharing)
72
+ Some very rough, early working notes on this model are
73
+ [here](https://docs.google.com/document/d/1fbkfkBzp16WbnCg7RDuRDvgzInA6XQu3xh4NCjV-WDA). These are now somewhat out of date.
74
74
 
75
75
 
76
76
 
@@ -200,10 +200,15 @@ Where `FULL-PATH-TO-REPO` represent the whole path to the PVNet repo on your loc
200
200
 
201
201
  ### Running the batch creation script
202
202
 
203
- Run the save_batches.py script to create batches with the following example arguments as:
203
+ Run the save_batches.py script to create batches if setting parameters in the datamodule config (`streamed_batches.yaml` in this example):
204
204
 
205
205
  ```
206
- python scripts/save_batches.py datamodule=streamed_batches +batch_output_dir="./output" +num_train_batches=10 +num_val_batches=5
206
+ python scripts/save_batches.py
207
+ ```
208
+ or with the following example arguments to override config:
209
+
210
+ ```
211
+ python scripts/save_batches.py datamodule=streamed_batches datamodule.batch_output_dir="./output" datamodule.num_train_batches=10 datamodule.num_val_batches=5
207
212
  ```
208
213
 
209
214
  In this function the datamodule argument looks for a config under `PVNet/configs/datamodule`. The examples here are either to use "premade_batches" or "streamed_batches".
@@ -17,12 +17,12 @@ together.
17
17
 
18
18
  ## Experiments
19
19
 
20
- **Link to our workshop paper coming soon**
20
+ Our paper based on this repo was accepted into the Tackling Climate Change with Machine Learning workshop at ICLR 2024 and can be viewed [here](https://www.climatechange.ai/papers/iclr2024/46).
21
21
 
22
- Some very rough working notes on this model are
23
- [here](https://docs.google.com/document/d/1fbkfkBzp16WbnCg7RDuRDvgzInA6XQu3xh4NCjV-WDA/edit?usp=sharing).
22
+ Some slightly more structured notes on deliberate experiments we have performed with PVNet are [here](https://docs.google.com/document/d/1VumDwWd8YAfvXbOtJEv3ZJm_FHQDzrKXR0jU9vnvGQg).
24
23
 
25
- Some slightly more structured notes on deliberate experiments we have performed with PVNet are [here](https://docs.google.com/document/d/1VumDwWd8YAfvXbOtJEv3ZJm_FHQDzrKXR0jU9vnvGQg/edit?usp=sharing)
24
+ Some very rough, early working notes on this model are
25
+ [here](https://docs.google.com/document/d/1fbkfkBzp16WbnCg7RDuRDvgzInA6XQu3xh4NCjV-WDA). These are now somewhat out of date.
26
26
 
27
27
 
28
28
 
@@ -152,10 +152,15 @@ Where `FULL-PATH-TO-REPO` represent the whole path to the PVNet repo on your loc
152
152
 
153
153
  ### Running the batch creation script
154
154
 
155
- Run the save_batches.py script to create batches with the following example arguments as:
155
+ Run the save_batches.py script to create batches if setting parameters in the datamodule config (`streamed_batches.yaml` in this example):
156
156
 
157
157
  ```
158
- python scripts/save_batches.py datamodule=streamed_batches +batch_output_dir="./output" +num_train_batches=10 +num_val_batches=5
158
+ python scripts/save_batches.py
159
+ ```
160
+ or with the following example arguments to override config:
161
+
162
+ ```
163
+ python scripts/save_batches.py datamodule=streamed_batches datamodule.batch_output_dir="./output" datamodule.num_train_batches=10 datamodule.num_val_batches=5
159
164
  ```
160
165
 
161
166
  In this function the datamodule argument looks for a config under `PVNet/configs/datamodule`. The examples here are either to use "premade_batches" or "streamed_batches".
@@ -0,0 +1,2 @@
1
+ """PVNet"""
2
+ __version__ = "3.0.39"
@@ -19,6 +19,7 @@ class BaseDataModule(LightningDataModule):
19
19
  test_period=[None, None],
20
20
  batch_dir=None,
21
21
  shuffle_factor=100,
22
+ nwp_channels=None,
22
23
  ):
23
24
  """Datamodule for training pvnet architecture.
24
25
 
@@ -38,17 +39,24 @@ class BaseDataModule(LightningDataModule):
38
39
  shuffle_factor: Number of presaved batches to be split and reshuffled to create returned
39
40
  batches. A larger factor means on each epoch the batches will be more diverse but at
40
41
  the cost of using more RAM.
41
-
42
+ nwp_channels: Number of NWP channels to use. If None, the all channels are used
42
43
  """
43
44
  super().__init__()
44
45
  self.configuration = configuration
45
46
  self.batch_size = batch_size
46
47
  self.batch_dir = batch_dir
47
48
  self.shuffle_factor = shuffle_factor
49
+ self.nwp_channels = nwp_channels
48
50
 
49
51
  if not ((batch_dir is not None) ^ (configuration is not None)):
50
52
  raise ValueError("Exactly one of `batch_dir` or `configuration` must be set.")
51
53
 
54
+ if (nwp_channels is not None) and (batch_dir is None):
55
+ raise ValueError(
56
+ "In order for 'nwp_channels' to work, we need batch_dir. "
57
+ "Otherwise the nwp channels is one in the configuration"
58
+ )
59
+
52
60
  if batch_dir is not None:
53
61
  if any([period != [None, None] for period in [train_period, val_period, test_period]]):
54
62
  raise ValueError("Cannot set `(train/val/test)_period` with presaved batches")
@@ -11,6 +11,7 @@ class WindDataModule(BaseDataModule):
11
11
  """Datamodule for training windnet and using windnet pipeline in `ocf_datapipes`."""
12
12
 
13
13
  def _get_datapipe(self, start_time, end_time):
14
+ # TODO is this is not right, need to load full windnet pipeline
14
15
  data_pipeline = windnet_netcdf_datapipe(
15
16
  self.configuration,
16
17
  keys=["wind", "nwp", "sensor"],
@@ -28,7 +29,9 @@ class WindDataModule(BaseDataModule):
28
29
  data_pipeline = windnet_netcdf_datapipe(
29
30
  keys=["wind", "nwp", "sensor"],
30
31
  filenames=filenames,
32
+ nwp_channels=self.nwp_channels,
31
33
  )
34
+
32
35
  data_pipeline = (
33
36
  data_pipeline.batch(self.batch_size)
34
37
  .map(stack_np_examples_into_batch)
@@ -1,2 +0,0 @@
1
- """PVNet"""
2
- __version__ = "3.0.37"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes