PVNet 4.1.6__tar.gz → 4.1.7__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.
- {pvnet-4.1.6 → pvnet-4.1.7}/PKG-INFO +1 -1
- {pvnet-4.1.6 → pvnet-4.1.7}/PVNet.egg-info/PKG-INFO +1 -1
- pvnet-4.1.7/pvnet/__init__.py +2 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/pvnet/models/base_model.py +38 -27
- pvnet-4.1.6/pvnet/__init__.py +0 -2
- {pvnet-4.1.6 → pvnet-4.1.7}/LICENSE +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/MANIFEST.in +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/PVNet.egg-info/SOURCES.txt +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/PVNet.egg-info/dependency_links.txt +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/PVNet.egg-info/requires.txt +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/PVNet.egg-info/top_level.txt +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/README.md +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/pvnet/callbacks.py +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/pvnet/data/__init__.py +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/pvnet/data/base_datamodule.py +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/pvnet/data/site_datamodule.py +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/pvnet/data/uk_regional_datamodule.py +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/pvnet/load_model.py +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/pvnet/models/__init__.py +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/pvnet/models/baseline/__init__.py +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/pvnet/models/baseline/last_value.py +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/pvnet/models/baseline/single_value.py +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/pvnet/models/ensemble.py +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/pvnet/models/model_cards/pv_india_model_card_template.md +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/pvnet/models/model_cards/pv_uk_regional_model_card_template.md +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/pvnet/models/model_cards/wind_india_model_card_template.md +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/pvnet/models/multimodal/__init__.py +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/pvnet/models/multimodal/basic_blocks.py +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/pvnet/models/multimodal/encoders/__init__.py +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/pvnet/models/multimodal/encoders/basic_blocks.py +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/pvnet/models/multimodal/encoders/encoders2d.py +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/pvnet/models/multimodal/encoders/encoders3d.py +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/pvnet/models/multimodal/encoders/encodersRNN.py +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/pvnet/models/multimodal/linear_networks/__init__.py +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/pvnet/models/multimodal/linear_networks/basic_blocks.py +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/pvnet/models/multimodal/linear_networks/networks.py +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/pvnet/models/multimodal/multimodal.py +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/pvnet/models/multimodal/multimodal_base.py +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/pvnet/models/multimodal/site_encoders/__init__.py +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/pvnet/models/multimodal/site_encoders/basic_blocks.py +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/pvnet/models/multimodal/site_encoders/encoders.py +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/pvnet/models/multimodal/unimodal_teacher.py +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/pvnet/models/utils.py +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/pvnet/optimizers.py +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/pvnet/training.py +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/pvnet/utils.py +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/pyproject.toml +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/setup.cfg +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/tests/test_end2end.py +0 -0
- {pvnet-4.1.6 → pvnet-4.1.7}/tests/test_utils.py +0 -0
|
@@ -107,13 +107,12 @@ def minimize_data_config(input_path, output_path, model):
|
|
|
107
107
|
nwp_config["image_size_pixels_height"] = nwp_pixel_size
|
|
108
108
|
nwp_config["image_size_pixels_width"] = nwp_pixel_size
|
|
109
109
|
|
|
110
|
-
# Replace the
|
|
111
|
-
nwp_config["
|
|
112
|
-
|
|
113
|
-
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
) * nwp_config["time_resolution_minutes"]
|
|
110
|
+
# Replace the interval_end_minutes minutes
|
|
111
|
+
nwp_config["interval_end_minutes"] = (
|
|
112
|
+
nwp_config["interval_start_minutes"] +
|
|
113
|
+
(model.nwp_encoders_dict[nwp_source].sequence_length - 1)
|
|
114
|
+
* nwp_config["time_resolution_minutes"]
|
|
115
|
+
)
|
|
117
116
|
|
|
118
117
|
if "satellite" in config["input_data"]:
|
|
119
118
|
if not model.include_sat:
|
|
@@ -123,11 +122,15 @@ def minimize_data_config(input_path, output_path, model):
|
|
|
123
122
|
|
|
124
123
|
# Replace the image size
|
|
125
124
|
sat_pixel_size = model.sat_encoder.image_size_pixels
|
|
126
|
-
sat_config["
|
|
127
|
-
sat_config["
|
|
128
|
-
|
|
129
|
-
# Replace the
|
|
130
|
-
sat_config["
|
|
125
|
+
sat_config["image_size_pixels_height"] = sat_pixel_size
|
|
126
|
+
sat_config["image_size_pixels_width"] = sat_pixel_size
|
|
127
|
+
|
|
128
|
+
# Replace the interval_end_minutes minutes
|
|
129
|
+
sat_config["interval_end_minutes"] = (
|
|
130
|
+
sat_config["interval_start_minutes"] +
|
|
131
|
+
(model.sat_encoder.sequence_length - 1)
|
|
132
|
+
* sat_config["time_resolution_minutes"]
|
|
133
|
+
)
|
|
131
134
|
|
|
132
135
|
if "pv" in config["input_data"]:
|
|
133
136
|
if not model.include_pv:
|
|
@@ -137,7 +140,7 @@ def minimize_data_config(input_path, output_path, model):
|
|
|
137
140
|
gsp_config = config["input_data"]["gsp"]
|
|
138
141
|
|
|
139
142
|
# Replace the forecast minutes
|
|
140
|
-
gsp_config["
|
|
143
|
+
gsp_config["interval_end_minutes"] = model.forecast_minutes
|
|
141
144
|
|
|
142
145
|
with open(output_path, "w") as outfile:
|
|
143
146
|
yaml.dump(config, outfile, default_flow_style=False)
|
|
@@ -318,7 +321,6 @@ class PVNetModelHubMixin(PyTorchModelHubMixin):
|
|
|
318
321
|
wandb_repo: Optional[str] = None,
|
|
319
322
|
wandb_ids: Optional[Union[list[str], str]] = None,
|
|
320
323
|
card_template_path: Optional[Path] = None,
|
|
321
|
-
revision: str = "main",
|
|
322
324
|
**kwargs,
|
|
323
325
|
) -> Optional[str]:
|
|
324
326
|
"""
|
|
@@ -340,8 +342,6 @@ class PVNetModelHubMixin(PyTorchModelHubMixin):
|
|
|
340
342
|
wandb_ids: Identifier(s) of the model on wandb.
|
|
341
343
|
card_template_path: Path to the HuggingFace model card template. Defaults to card in
|
|
342
344
|
PVNet library if set to None.
|
|
343
|
-
revision (`str`, *optional*, defaults to `"main"`):
|
|
344
|
-
The revision to push the model to. Only used if `push_to_hub=True`.
|
|
345
345
|
kwargs:
|
|
346
346
|
Additional key word arguments passed along to the
|
|
347
347
|
[`~ModelHubMixin._from_pretrained`] method.
|
|
@@ -367,10 +367,9 @@ class PVNetModelHubMixin(PyTorchModelHubMixin):
|
|
|
367
367
|
# Taylor the data config to the model being saved
|
|
368
368
|
minimize_data_config(new_data_config_path, new_data_config_path, self)
|
|
369
369
|
|
|
370
|
-
card = self.create_hugging_face_model_card(
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
card_template_path)
|
|
370
|
+
card = self.create_hugging_face_model_card(
|
|
371
|
+
repo_id, wandb_repo, wandb_ids, card_template_path
|
|
372
|
+
)
|
|
374
373
|
|
|
375
374
|
(save_directory / "README.md").write_text(str(card))
|
|
376
375
|
|
|
@@ -381,16 +380,29 @@ class PVNetModelHubMixin(PyTorchModelHubMixin):
|
|
|
381
380
|
repo_id=repo_id,
|
|
382
381
|
repo_type="model",
|
|
383
382
|
folder_path=save_directory,
|
|
384
|
-
revision=revision,
|
|
385
383
|
)
|
|
386
384
|
|
|
385
|
+
# Print the most recent commit hash
|
|
386
|
+
c = api.list_repo_commits(repo_id=repo_id, repo_type="model")[0]
|
|
387
|
+
|
|
388
|
+
message = (
|
|
389
|
+
f"The latest commit is now: \n"
|
|
390
|
+
f" date: {c.created_at} \n"
|
|
391
|
+
f" commit hash: {c.commit_id}\n"
|
|
392
|
+
f" by: {c.authors}\n"
|
|
393
|
+
f" title: {c.title}\n"
|
|
394
|
+
)
|
|
395
|
+
|
|
396
|
+
print(message)
|
|
397
|
+
|
|
387
398
|
return None
|
|
388
399
|
|
|
389
400
|
@staticmethod
|
|
390
|
-
def create_hugging_face_model_card(
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
401
|
+
def create_hugging_face_model_card(
|
|
402
|
+
repo_id: Optional[str] = None,
|
|
403
|
+
wandb_repo: Optional[str] = None,
|
|
404
|
+
wandb_ids: Optional[Union[list[str], str]] = None,
|
|
405
|
+
card_template_path: Optional[Path] = None,
|
|
394
406
|
) -> ModelCard:
|
|
395
407
|
"""
|
|
396
408
|
Creates Hugging Face model card
|
|
@@ -443,14 +455,13 @@ class PVNetModelHubMixin(PyTorchModelHubMixin):
|
|
|
443
455
|
for package, version in packages_and_versions.items():
|
|
444
456
|
package_versions_markdown += f" - {package}=={version}\n"
|
|
445
457
|
|
|
446
|
-
|
|
458
|
+
return ModelCard.from_template(
|
|
447
459
|
card_data,
|
|
448
460
|
template_path=card_template_path,
|
|
449
461
|
wandb_links=wandb_links,
|
|
450
462
|
package_versions=package_versions_markdown
|
|
451
463
|
)
|
|
452
464
|
|
|
453
|
-
return card
|
|
454
465
|
|
|
455
466
|
class BaseModel(pl.LightningModule, PVNetModelHubMixin):
|
|
456
467
|
"""Abstract base class for PVNet submodels"""
|
pvnet-4.1.6/pvnet/__init__.py
DELETED
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|