PVNet 5.3.18__tar.gz → 5.3.20__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 (36) hide show
  1. {pvnet-5.3.18 → pvnet-5.3.20}/PKG-INFO +3 -1
  2. {pvnet-5.3.18 → pvnet-5.3.20}/PVNet.egg-info/PKG-INFO +3 -1
  3. {pvnet-5.3.18 → pvnet-5.3.20}/PVNet.egg-info/requires.txt +2 -0
  4. {pvnet-5.3.18 → pvnet-5.3.20}/pvnet/utils.py +41 -10
  5. {pvnet-5.3.18 → pvnet-5.3.20}/pyproject.toml +2 -0
  6. {pvnet-5.3.18 → pvnet-5.3.20}/LICENSE +0 -0
  7. {pvnet-5.3.18 → pvnet-5.3.20}/PVNet.egg-info/SOURCES.txt +0 -0
  8. {pvnet-5.3.18 → pvnet-5.3.20}/PVNet.egg-info/dependency_links.txt +0 -0
  9. {pvnet-5.3.18 → pvnet-5.3.20}/PVNet.egg-info/top_level.txt +0 -0
  10. {pvnet-5.3.18 → pvnet-5.3.20}/README.md +0 -0
  11. {pvnet-5.3.18 → pvnet-5.3.20}/pvnet/__init__.py +0 -0
  12. {pvnet-5.3.18 → pvnet-5.3.20}/pvnet/datamodule.py +0 -0
  13. {pvnet-5.3.18 → pvnet-5.3.20}/pvnet/load_model.py +0 -0
  14. {pvnet-5.3.18 → pvnet-5.3.20}/pvnet/models/__init__.py +0 -0
  15. {pvnet-5.3.18 → pvnet-5.3.20}/pvnet/models/base_model.py +0 -0
  16. {pvnet-5.3.18 → pvnet-5.3.20}/pvnet/models/ensemble.py +0 -0
  17. {pvnet-5.3.18 → pvnet-5.3.20}/pvnet/models/late_fusion/__init__.py +0 -0
  18. {pvnet-5.3.18 → pvnet-5.3.20}/pvnet/models/late_fusion/basic_blocks.py +0 -0
  19. {pvnet-5.3.18 → pvnet-5.3.20}/pvnet/models/late_fusion/encoders/__init__.py +0 -0
  20. {pvnet-5.3.18 → pvnet-5.3.20}/pvnet/models/late_fusion/encoders/basic_blocks.py +0 -0
  21. {pvnet-5.3.18 → pvnet-5.3.20}/pvnet/models/late_fusion/encoders/encoders3d.py +0 -0
  22. {pvnet-5.3.18 → pvnet-5.3.20}/pvnet/models/late_fusion/late_fusion.py +0 -0
  23. {pvnet-5.3.18 → pvnet-5.3.20}/pvnet/models/late_fusion/linear_networks/__init__.py +0 -0
  24. {pvnet-5.3.18 → pvnet-5.3.20}/pvnet/models/late_fusion/linear_networks/basic_blocks.py +0 -0
  25. {pvnet-5.3.18 → pvnet-5.3.20}/pvnet/models/late_fusion/linear_networks/networks.py +0 -0
  26. {pvnet-5.3.18 → pvnet-5.3.20}/pvnet/models/late_fusion/site_encoders/__init__.py +0 -0
  27. {pvnet-5.3.18 → pvnet-5.3.20}/pvnet/models/late_fusion/site_encoders/basic_blocks.py +0 -0
  28. {pvnet-5.3.18 → pvnet-5.3.20}/pvnet/models/late_fusion/site_encoders/encoders.py +0 -0
  29. {pvnet-5.3.18 → pvnet-5.3.20}/pvnet/optimizers.py +0 -0
  30. {pvnet-5.3.18 → pvnet-5.3.20}/pvnet/training/__init__.py +0 -0
  31. {pvnet-5.3.18 → pvnet-5.3.20}/pvnet/training/lightning_module.py +0 -0
  32. {pvnet-5.3.18 → pvnet-5.3.20}/pvnet/training/plots.py +0 -0
  33. {pvnet-5.3.18 → pvnet-5.3.20}/pvnet/training/train.py +0 -0
  34. {pvnet-5.3.18 → pvnet-5.3.20}/setup.cfg +0 -0
  35. {pvnet-5.3.18 → pvnet-5.3.20}/tests/test_datamodule.py +0 -0
  36. {pvnet-5.3.18 → pvnet-5.3.20}/tests/test_end2end.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PVNet
3
- Version: 5.3.18
3
+ Version: 5.3.20
4
4
  Summary: PVNet
5
5
  Author-email: Peter Dudfield <info@openclimatefix.org>
6
6
  Requires-Python: <3.14,>=3.11
@@ -25,6 +25,8 @@ Requires-Dist: hydra-core
25
25
  Requires-Dist: rich
26
26
  Requires-Dist: einops
27
27
  Requires-Dist: safetensors
28
+ Requires-Dist: jinja2
29
+ Requires-Dist: weasyprint
28
30
  Dynamic: license-file
29
31
 
30
32
  # PVNet
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PVNet
3
- Version: 5.3.18
3
+ Version: 5.3.20
4
4
  Summary: PVNet
5
5
  Author-email: Peter Dudfield <info@openclimatefix.org>
6
6
  Requires-Python: <3.14,>=3.11
@@ -25,6 +25,8 @@ Requires-Dist: hydra-core
25
25
  Requires-Dist: rich
26
26
  Requires-Dist: einops
27
27
  Requires-Dist: safetensors
28
+ Requires-Dist: jinja2
29
+ Requires-Dist: weasyprint
28
30
  Dynamic: license-file
29
31
 
30
32
  # PVNet
@@ -17,3 +17,5 @@ hydra-core
17
17
  rich
18
18
  einops
19
19
  safetensors
20
+ jinja2
21
+ weasyprint
@@ -5,8 +5,9 @@ from typing import TYPE_CHECKING
5
5
 
6
6
  import rich.syntax
7
7
  import rich.tree
8
+ import torch
8
9
  from lightning.pytorch.utilities import rank_zero_only
9
- from omegaconf import DictConfig, OmegaConf
10
+ from omegaconf import DictConfig, ListConfig, OmegaConf
10
11
 
11
12
  if TYPE_CHECKING:
12
13
  from pvnet.models.base_model import BaseModel
@@ -167,13 +168,43 @@ def validate_batch_against_config(
167
168
 
168
169
 
169
170
  def validate_gpu_config(config: DictConfig) -> None:
170
- """Abort if multiple GPUs requested by mistake i.e. `devices: 2` instead of `[2]`."""
171
- tr = config.get("trainer", {})
172
- dev = tr.get("devices")
173
-
174
- if isinstance(dev, int) and dev > 1:
175
- raise ValueError(
176
- f"Detected `devices: {dev}` — this requests {dev} GPUs. "
177
- "If you meant a specific GPU (e.g. GPU 2), use `devices: [2]`. "
178
- "Parallel training not supported."
171
+ """Abort if the config may use multiple GPUs.
172
+
173
+ PVNet does not currently support parallel training. This validation only
174
+ raises when multiple CUDA GPUs are actually available and the trainer config
175
+ could select more than one of them.
176
+ """
177
+ trainer_config = config.get("trainer", {})
178
+ devices = trainer_config.get("devices")
179
+ accelerator = str(trainer_config.get("accelerator", "auto")).lower()
180
+
181
+ num_available_gpus = torch.cuda.device_count()
182
+
183
+ if num_available_gpus <= 1:
184
+ return
185
+
186
+ if accelerator in {"cpu", "mps", "tpu"}:
187
+ return
188
+
189
+ if devices == "auto":
190
+ msg = (
191
+ f"`devices: 'auto'` may use all {num_available_gpus} available GPUs. "
192
+ "PVNet does not support multi-GPU training. "
193
+ "Use a single explicit device, for example `devices: [0]`."
194
+ )
195
+ elif isinstance(devices, int) and devices > 1:
196
+ msg = (
197
+ f"Detected `devices: {devices}` with {num_available_gpus} GPUs available. "
198
+ "This requests multiple GPUs. PVNet does not support multi-GPU training. "
199
+ "If you meant to select a specific GPU, for example GPU 2, use `devices: [2]`."
179
200
  )
201
+ elif isinstance(devices, (list, tuple, ListConfig)) and len(devices) > 1:
202
+ msg = (
203
+ f"Detected `devices: {list(devices)}` with {num_available_gpus} GPUs available. "
204
+ "This requests multiple GPUs. PVNet does not support multi-GPU training. "
205
+ "Use a single explicit device, for example `devices: [0]`."
206
+ )
207
+ else:
208
+ return
209
+
210
+ raise ValueError(msg)
@@ -31,6 +31,8 @@ dependencies = [
31
31
  "rich",
32
32
  "einops",
33
33
  "safetensors",
34
+ "jinja2",
35
+ "weasyprint",
34
36
  ]
35
37
 
36
38
  [dependency-groups]
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