Skip to main content

PVNet summation

ease of contribution: hard

This project is used for training a model to sum the GSP predictions of PVNet into a national estimate.

Using the summation model to sum the GSP predictions rather than doing a simple sum increases the accuracy of the national predictions and can be configured to produce estimates of the uncertainty range of the national estimate. See the PVNet repo for more details and our paper.

Setup / Installation

git clone https://github.com/openclimatefix/PVNet_summation
cd PVNet_summation
pip install .

Additional development dependencies

pip install ".[dev]"

Getting started with running PVNet summation

In order to run PVNet summation, we assume that you are already set up with PVNet and have a trained PVNet model already available either locally or pushed to HuggingFace.

Before running any code, copy the example configuration to a configs directory:

cp -r configs.example configs

You will be making local amendments to these configs.

Datasets

The datasets required are the same as documented in PVNet. The only addition is that you will need PVLive data for the national sum i.e. GSP ID 0.

Generating pre-made concurrent batches of data for PVNet

It is required that you preprepare batches using the save_concurrent_batches.py script from PVNet. This saves the batches as required by the PVNet model to make predictions for all GSPs for a single forecast init time. Seen the PVNet package for more details on this.

Set up and config example for batch creation

The concurrent batches created in the step above will be augmented with a few additional pieces of data required for the summation model. Within your copy of PVNet_summation/configs make sure you have replaced all of the items marked with PLACEHOLDER

Training PVNet_summation

How PVNet_summation is run is determined by the extensive configuration in the config files. The configs stored in PVNet/configs.example should work with batches created using the steps and batch creation config mentioned above.

Make sure to update the following config files before training your model:

  1. In configs/datamodule/default.yaml:
    • update batch_dir to point to the directory you stored your concurrent batches in during batch creation.
    • update gsp_zarr_path to point to the PVLive data containing the national estimate
  2. In configs/model/default.yaml:
    • update the PVNet model for which you are training a summation model for. A new summation model should be trained for each PVNet model
    • update the hyperparameters and structure of the summation model
  3. In configs/trainer/default.yaml:
    • set accelerator: 0 if running on a system without a supported GPU
  4. In configs.config.yaml:
    • It is recommended that you set presave_pvnet_outputs to True. This means that the concurrent batches that you create will only be run through the PVNet model once before training and their outputs saved, rather than being run on the fly on each batch throughout training. This can speed up training significantly.

Assuming you have updated the configs, you should now be able to run:

python run.py

This will then use the pretrained PVNet model to run inference on the concurrent batches, the outputs from this inference will then be used as the training data for the summation model alongside the national PVLive data (GSP ID 0).

Testing

You can use python -m pytest tests to run tests

Metadata

Release files for PVNet_summation 0.3.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PVNet_summation 0.3.7
File Size Uploaded Provenance Actions
pvnet_summation-0.3.7.tar.gz 15.5 kB Without provenance Details for pvnet_summation-0.3.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for PVNet_summation 0.3.7
File Interpreter ABI Platform Actions
pvnet_summation-0.3.7-py3-none-any.whl Python 3 none any Details for pvnet_summation-0.3.7-py3-none-any.whl

Total release size: 33.1 kB

Release files / pvnet_summation-0.3.7.tar.gz

Download URL pvnet_summation-0.3.7.tar.gz
Size 15.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b510c2e305c1a1d64d2d40b54f56238df38d1e85cc9c20fb1ad052d137828c46
BLAKE2b-256 checksum
How to use checksums
9503a4602d54c8de0b25afec843e2d29c6f2be66003c80c07d36b5cde1108a44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.22

Release files / pvnet_summation-0.3.7-py3-none-any.whl

Download URL pvnet_summation-0.3.7-py3-none-any.whl
Size 17.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
791dda90344ec3504c1e8a2e7f500cbaf9633c7cf7959a137c7f8257c8f6393f
BLAKE2b-256 checksum
How to use checksums
9c2bc864d492e08cbc700ee9bc198cf24b1e3decf36b0ce43645f7445bdb4a06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.22

Security for PVNet_summation 0.3.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.7 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page