PVNet 3.0.20__tar.gz → 3.0.22__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 (53) hide show
  1. {PVNet-3.0.20 → PVNet-3.0.22}/PKG-INFO +2 -2
  2. {PVNet-3.0.20 → PVNet-3.0.22}/PVNet.egg-info/PKG-INFO +2 -2
  3. {PVNet-3.0.20 → PVNet-3.0.22}/PVNet.egg-info/requires.txt +1 -1
  4. PVNet-3.0.22/pvnet/__init__.py +2 -0
  5. {PVNet-3.0.20 → PVNet-3.0.22}/pvnet/data/datamodule.py +1 -2
  6. {PVNet-3.0.20 → PVNet-3.0.22}/pvnet/data/pv_site_datamodule.py +1 -2
  7. PVNet-3.0.22/pvnet/data/utils.py +19 -0
  8. {PVNet-3.0.20 → PVNet-3.0.22}/pvnet/data/wind_datamodule.py +1 -2
  9. {PVNet-3.0.20 → PVNet-3.0.22}/requirements.txt +1 -1
  10. PVNet-3.0.20/pvnet/__init__.py +0 -2
  11. PVNet-3.0.20/pvnet/data/utils.py +0 -47
  12. {PVNet-3.0.20 → PVNet-3.0.22}/LICENSE +0 -0
  13. {PVNet-3.0.20 → PVNet-3.0.22}/MANIFEST.in +0 -0
  14. {PVNet-3.0.20 → PVNet-3.0.22}/PVNet.egg-info/SOURCES.txt +0 -0
  15. {PVNet-3.0.20 → PVNet-3.0.22}/PVNet.egg-info/dependency_links.txt +0 -0
  16. {PVNet-3.0.20 → PVNet-3.0.22}/PVNet.egg-info/top_level.txt +0 -0
  17. {PVNet-3.0.20 → PVNet-3.0.22}/README.md +0 -0
  18. {PVNet-3.0.20 → PVNet-3.0.22}/pvnet/callbacks.py +0 -0
  19. {PVNet-3.0.20 → PVNet-3.0.22}/pvnet/data/__init__.py +0 -0
  20. {PVNet-3.0.20 → PVNet-3.0.22}/pvnet/data/base.py +0 -0
  21. {PVNet-3.0.20 → PVNet-3.0.22}/pvnet/models/__init__.py +0 -0
  22. {PVNet-3.0.20 → PVNet-3.0.22}/pvnet/models/base_model.py +0 -0
  23. {PVNet-3.0.20 → PVNet-3.0.22}/pvnet/models/baseline/__init__.py +0 -0
  24. {PVNet-3.0.20 → PVNet-3.0.22}/pvnet/models/baseline/last_value.py +0 -0
  25. {PVNet-3.0.20 → PVNet-3.0.22}/pvnet/models/baseline/single_value.py +0 -0
  26. {PVNet-3.0.20 → PVNet-3.0.22}/pvnet/models/ensemble.py +0 -0
  27. {PVNet-3.0.20 → PVNet-3.0.22}/pvnet/models/multimodal/__init__.py +0 -0
  28. {PVNet-3.0.20 → PVNet-3.0.22}/pvnet/models/multimodal/basic_blocks.py +0 -0
  29. {PVNet-3.0.20 → PVNet-3.0.22}/pvnet/models/multimodal/encoders/__init__.py +0 -0
  30. {PVNet-3.0.20 → PVNet-3.0.22}/pvnet/models/multimodal/encoders/basic_blocks.py +0 -0
  31. {PVNet-3.0.20 → PVNet-3.0.22}/pvnet/models/multimodal/encoders/encoders2d.py +0 -0
  32. {PVNet-3.0.20 → PVNet-3.0.22}/pvnet/models/multimodal/encoders/encoders3d.py +0 -0
  33. {PVNet-3.0.20 → PVNet-3.0.22}/pvnet/models/multimodal/encoders/encodersRNN.py +0 -0
  34. {PVNet-3.0.20 → PVNet-3.0.22}/pvnet/models/multimodal/linear_networks/__init__.py +0 -0
  35. {PVNet-3.0.20 → PVNet-3.0.22}/pvnet/models/multimodal/linear_networks/basic_blocks.py +0 -0
  36. {PVNet-3.0.20 → PVNet-3.0.22}/pvnet/models/multimodal/linear_networks/networks.py +0 -0
  37. {PVNet-3.0.20 → PVNet-3.0.22}/pvnet/models/multimodal/multimodal.py +0 -0
  38. {PVNet-3.0.20 → PVNet-3.0.22}/pvnet/models/multimodal/multimodal_base.py +0 -0
  39. {PVNet-3.0.20 → PVNet-3.0.22}/pvnet/models/multimodal/site_encoders/__init__.py +0 -0
  40. {PVNet-3.0.20 → PVNet-3.0.22}/pvnet/models/multimodal/site_encoders/basic_blocks.py +0 -0
  41. {PVNet-3.0.20 → PVNet-3.0.22}/pvnet/models/multimodal/site_encoders/encoders.py +0 -0
  42. {PVNet-3.0.20 → PVNet-3.0.22}/pvnet/models/multimodal/unimodal_teacher.py +0 -0
  43. {PVNet-3.0.20 → PVNet-3.0.22}/pvnet/models/utils.py +0 -0
  44. {PVNet-3.0.20 → PVNet-3.0.22}/pvnet/optimizers.py +0 -0
  45. {PVNet-3.0.20 → PVNet-3.0.22}/pvnet/training.py +0 -0
  46. {PVNet-3.0.20 → PVNet-3.0.22}/pvnet/utils.py +0 -0
  47. {PVNet-3.0.20 → PVNet-3.0.22}/pyproject.toml +0 -0
  48. {PVNet-3.0.20 → PVNet-3.0.22}/requirements-dev.txt +0 -0
  49. {PVNet-3.0.20 → PVNet-3.0.22}/setup.cfg +0 -0
  50. {PVNet-3.0.20 → PVNet-3.0.22}/setup.py +0 -0
  51. {PVNet-3.0.20 → PVNet-3.0.22}/tests/__init__.py +0 -0
  52. {PVNet-3.0.20 → PVNet-3.0.22}/tests/conftest.py +0 -0
  53. {PVNet-3.0.20 → PVNet-3.0.22}/tests/test_end2end.py +0 -0
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PVNet
3
- Version: 3.0.20
3
+ Version: 3.0.22
4
4
  Summary: PVNet
5
5
  Author: Peter Dudfield
6
6
  Author-email: info@openclimatefix.org
7
7
  License: MIT
8
8
  Description-Content-Type: text/markdown
9
9
  License-File: LICENSE
10
- Requires-Dist: ocf_datapipes>=3.1.5
10
+ Requires-Dist: ocf_datapipes>=3.3.6
11
11
  Requires-Dist: ocf_ml_metrics>=0.0.11
12
12
  Requires-Dist: numpy
13
13
  Requires-Dist: pandas
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PVNet
3
- Version: 3.0.20
3
+ Version: 3.0.22
4
4
  Summary: PVNet
5
5
  Author: Peter Dudfield
6
6
  Author-email: info@openclimatefix.org
7
7
  License: MIT
8
8
  Description-Content-Type: text/markdown
9
9
  License-File: LICENSE
10
- Requires-Dist: ocf_datapipes>=3.1.5
10
+ Requires-Dist: ocf_datapipes>=3.3.6
11
11
  Requires-Dist: ocf_ml_metrics>=0.0.11
12
12
  Requires-Dist: numpy
13
13
  Requires-Dist: pandas
@@ -1,4 +1,4 @@
1
- ocf_datapipes>=3.1.5
1
+ ocf_datapipes>=3.3.6
2
2
  ocf_ml_metrics>=0.0.11
3
3
  numpy
4
4
  pandas
@@ -0,0 +1,2 @@
1
+ """PVNet"""
2
+ __version__ = "3.0.22"
@@ -3,12 +3,11 @@
3
3
  import resource
4
4
 
5
5
  import torch
6
- from ocf_datapipes.batch import stack_np_examples_into_batch
6
+ from ocf_datapipes.batch import batch_to_tensor, stack_np_examples_into_batch
7
7
  from ocf_datapipes.training.pvnet import pvnet_datapipe
8
8
  from torch.utils.data.datapipes.iter import FileLister
9
9
 
10
10
  from pvnet.data.base import BaseDataModule
11
- from pvnet.data.utils import batch_to_tensor
12
11
 
13
12
  rlimit = resource.getrlimit(resource.RLIMIT_NOFILE)
14
13
  resource.setrlimit(resource.RLIMIT_NOFILE, (2048, rlimit[1]))
@@ -1,11 +1,10 @@
1
1
  """ Data module for pytorch lightning """
2
2
  import glob
3
3
 
4
- from ocf_datapipes.batch import BatchKey, stack_np_examples_into_batch
4
+ from ocf_datapipes.batch import BatchKey, batch_to_tensor, stack_np_examples_into_batch
5
5
  from ocf_datapipes.training.pvnet_site import pvnet_site_netcdf_datapipe
6
6
 
7
7
  from pvnet.data.base import BaseDataModule
8
- from pvnet.data.utils import batch_to_tensor
9
8
 
10
9
 
11
10
  class PVSiteDataModule(BaseDataModule):
@@ -0,0 +1,19 @@
1
+ """Utils common between Wind and PV datamodules"""
2
+ from ocf_datapipes.batch import BatchKey, unstack_np_batch_into_examples
3
+ from torch.utils.data import IterDataPipe, functional_datapipe
4
+
5
+
6
+ @functional_datapipe("split_batches")
7
+ class BatchSplitter(IterDataPipe):
8
+ """Pipeline step to split batches of data and yield single examples"""
9
+
10
+ def __init__(self, source_datapipe: IterDataPipe, splitting_key: BatchKey = BatchKey.gsp):
11
+ """Pipeline step to split batches of data and yield single examples"""
12
+ self.source_datapipe = source_datapipe
13
+ self.splitting_key = splitting_key
14
+
15
+ def __iter__(self):
16
+ """Opens the NWP data"""
17
+ for batch in self.source_datapipe:
18
+ for example in unstack_np_batch_into_examples(batch):
19
+ yield example
@@ -1,11 +1,10 @@
1
1
  """ Data module for pytorch lightning """
2
2
  import glob
3
3
 
4
- from ocf_datapipes.batch import BatchKey, stack_np_examples_into_batch
4
+ from ocf_datapipes.batch import BatchKey, batch_to_tensor, stack_np_examples_into_batch
5
5
  from ocf_datapipes.training.windnet import windnet_netcdf_datapipe
6
6
 
7
7
  from pvnet.data.base import BaseDataModule
8
- from pvnet.data.utils import batch_to_tensor
9
8
 
10
9
 
11
10
  class WindDataModule(BaseDataModule):
@@ -1,4 +1,4 @@
1
- ocf_datapipes>=3.1.5
1
+ ocf_datapipes>=3.3.6
2
2
  ocf_ml_metrics>=0.0.11
3
3
  numpy
4
4
  pandas
@@ -1,2 +0,0 @@
1
- """PVNet"""
2
- __version__ = "3.0.20"
@@ -1,47 +0,0 @@
1
- """Utils common between Wind and PV datamodules"""
2
- import numpy as np
3
- import torch
4
- from ocf_datapipes.batch import BatchKey, unstack_np_batch_into_examples
5
- from torch.utils.data import IterDataPipe, functional_datapipe
6
-
7
-
8
- def copy_batch_to_device(batch, device):
9
- """Moves a dict-batch of tensors to new device."""
10
- batch_copy = {}
11
-
12
- for k, v in batch.items():
13
- if isinstance(v, dict):
14
- # Recursion to reach the nested NWP
15
- batch_copy[k] = copy_batch_to_device(v, device)
16
- elif isinstance(v, torch.Tensor):
17
- batch_copy[k] = v.to(device)
18
- else:
19
- batch_copy[k] = v
20
- return batch_copy
21
-
22
-
23
- def batch_to_tensor(batch):
24
- """Moves numpy batch to a tensor"""
25
- for k, v in batch.items():
26
- if isinstance(v, dict):
27
- # Recursion to reach the nested NWP
28
- batch[k] = batch_to_tensor(v)
29
- elif isinstance(v, np.ndarray) and np.issubdtype(v.dtype, np.number):
30
- batch[k] = torch.as_tensor(v)
31
- return batch
32
-
33
-
34
- @functional_datapipe("split_batches")
35
- class BatchSplitter(IterDataPipe):
36
- """Pipeline step to split batches of data and yield single examples"""
37
-
38
- def __init__(self, source_datapipe: IterDataPipe, splitting_key: BatchKey = BatchKey.gsp):
39
- """Pipeline step to split batches of data and yield single examples"""
40
- self.source_datapipe = source_datapipe
41
- self.splitting_key = splitting_key
42
-
43
- def __iter__(self):
44
- """Opens the NWP data"""
45
- for batch in self.source_datapipe:
46
- for example in unstack_np_batch_into_examples(batch):
47
- yield example
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
File without changes
File without changes