PVNet 5.3.7__tar.gz → 5.3.9__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.7 → pvnet-5.3.9}/PKG-INFO +1 -1
  2. {pvnet-5.3.7 → pvnet-5.3.9}/PVNet.egg-info/PKG-INFO +1 -1
  3. {pvnet-5.3.7 → pvnet-5.3.9}/pvnet/utils.py +14 -20
  4. {pvnet-5.3.7 → pvnet-5.3.9}/LICENSE +0 -0
  5. {pvnet-5.3.7 → pvnet-5.3.9}/PVNet.egg-info/SOURCES.txt +0 -0
  6. {pvnet-5.3.7 → pvnet-5.3.9}/PVNet.egg-info/dependency_links.txt +0 -0
  7. {pvnet-5.3.7 → pvnet-5.3.9}/PVNet.egg-info/requires.txt +0 -0
  8. {pvnet-5.3.7 → pvnet-5.3.9}/PVNet.egg-info/top_level.txt +0 -0
  9. {pvnet-5.3.7 → pvnet-5.3.9}/README.md +0 -0
  10. {pvnet-5.3.7 → pvnet-5.3.9}/pvnet/__init__.py +0 -0
  11. {pvnet-5.3.7 → pvnet-5.3.9}/pvnet/datamodule.py +0 -0
  12. {pvnet-5.3.7 → pvnet-5.3.9}/pvnet/load_model.py +0 -0
  13. {pvnet-5.3.7 → pvnet-5.3.9}/pvnet/models/__init__.py +0 -0
  14. {pvnet-5.3.7 → pvnet-5.3.9}/pvnet/models/base_model.py +0 -0
  15. {pvnet-5.3.7 → pvnet-5.3.9}/pvnet/models/ensemble.py +0 -0
  16. {pvnet-5.3.7 → pvnet-5.3.9}/pvnet/models/late_fusion/__init__.py +0 -0
  17. {pvnet-5.3.7 → pvnet-5.3.9}/pvnet/models/late_fusion/basic_blocks.py +0 -0
  18. {pvnet-5.3.7 → pvnet-5.3.9}/pvnet/models/late_fusion/encoders/__init__.py +0 -0
  19. {pvnet-5.3.7 → pvnet-5.3.9}/pvnet/models/late_fusion/encoders/basic_blocks.py +0 -0
  20. {pvnet-5.3.7 → pvnet-5.3.9}/pvnet/models/late_fusion/encoders/encoders3d.py +0 -0
  21. {pvnet-5.3.7 → pvnet-5.3.9}/pvnet/models/late_fusion/late_fusion.py +0 -0
  22. {pvnet-5.3.7 → pvnet-5.3.9}/pvnet/models/late_fusion/linear_networks/__init__.py +0 -0
  23. {pvnet-5.3.7 → pvnet-5.3.9}/pvnet/models/late_fusion/linear_networks/basic_blocks.py +0 -0
  24. {pvnet-5.3.7 → pvnet-5.3.9}/pvnet/models/late_fusion/linear_networks/networks.py +0 -0
  25. {pvnet-5.3.7 → pvnet-5.3.9}/pvnet/models/late_fusion/site_encoders/__init__.py +0 -0
  26. {pvnet-5.3.7 → pvnet-5.3.9}/pvnet/models/late_fusion/site_encoders/basic_blocks.py +0 -0
  27. {pvnet-5.3.7 → pvnet-5.3.9}/pvnet/models/late_fusion/site_encoders/encoders.py +0 -0
  28. {pvnet-5.3.7 → pvnet-5.3.9}/pvnet/optimizers.py +0 -0
  29. {pvnet-5.3.7 → pvnet-5.3.9}/pvnet/training/__init__.py +0 -0
  30. {pvnet-5.3.7 → pvnet-5.3.9}/pvnet/training/lightning_module.py +0 -0
  31. {pvnet-5.3.7 → pvnet-5.3.9}/pvnet/training/plots.py +0 -0
  32. {pvnet-5.3.7 → pvnet-5.3.9}/pvnet/training/train.py +0 -0
  33. {pvnet-5.3.7 → pvnet-5.3.9}/pyproject.toml +0 -0
  34. {pvnet-5.3.7 → pvnet-5.3.9}/setup.cfg +0 -0
  35. {pvnet-5.3.7 → pvnet-5.3.9}/tests/test_datamodule.py +0 -0
  36. {pvnet-5.3.7 → pvnet-5.3.9}/tests/test_end2end.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PVNet
3
- Version: 5.3.7
3
+ Version: 5.3.9
4
4
  Summary: PVNet
5
5
  Author-email: Peter Dudfield <info@openclimatefix.org>
6
6
  Requires-Python: <3.14,>=3.11
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PVNet
3
- Version: 5.3.7
3
+ Version: 5.3.9
4
4
  Summary: PVNet
5
5
  Author-email: Peter Dudfield <info@openclimatefix.org>
6
6
  Requires-Python: <3.14,>=3.11
@@ -102,30 +102,24 @@ def validate_batch_against_config(
102
102
 
103
103
  # NWP validation
104
104
  if model.include_nwp:
105
- if "nwp" not in batch:
105
+ if (nwp_dict := batch.get("nwp")) is None:
106
106
  raise ValueError("Model uses NWP data but 'nwp' missing from batch.")
107
107
 
108
- for source in model.nwp_encoders_dict:
109
- if source not in batch["nwp"]:
110
- raise ValueError(
111
- f"Model uses NWP source '{source}' but it is missing from batch['nwp']."
112
- )
108
+ for source, enc in model.nwp_encoders_dict.items():
109
+ if (src_data := nwp_dict.get(source)) is None:
110
+ raise ValueError(f"NWP source '{source}' missing from batch['nwp'].")
113
111
 
114
- enc = model.nwp_encoders_dict[source]
115
- expected_channels = enc.in_channels - int(model.add_image_embedding_channel)
116
-
117
- expected_shape = (
118
- batch["nwp"][source]["nwp"].shape[0],
119
- enc.sequence_length,
120
- expected_channels,
121
- enc.image_size_pixels,
122
- enc.image_size_pixels,
123
- )
124
- actual_shape = tuple(batch["nwp"][source]["nwp"].shape)
125
- if actual_shape != expected_shape:
126
- raise ValueError(
127
- f"NWP.{source} shape mismatch: expected {expected_shape}, got {actual_shape}"
112
+ nwp_tensor = src_data["nwp"]
113
+ exp_ch = enc.in_channels - int(model.add_image_embedding_channel)
114
+ _, actual_seq, actual_ch, h, w = nwp_tensor.shape
115
+
116
+ if (actual_seq != enc.sequence_length or actual_ch != exp_ch or
117
+ h != enc.image_size_pixels or w != enc.image_size_pixels):
118
+ msg = (
119
+ f"NWP.{source} mismatch: Exp {enc.sequence_length}seq, {exp_ch}ch. "
120
+ f"Got {actual_seq}seq, {actual_ch}ch"
128
121
  )
122
+ raise ValueError(msg)
129
123
 
130
124
  # Satellite validation
131
125
  if model.include_sat:
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