Skip to main content

PVNet_summation

Project description

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.

Training PVNet_summation

How PVNet_summation is run is determined by the extensive configuration in the config files. The configs stored in configs.example.

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

  1. At the very start of training we loop over all of the input samples and make predictions for them using PVNet. These predictions are saved to disk and will be loaded in the training loop for more efficient training. In configs/config.yaml update sample_save_dir to set where the predictions will be saved to.

  2. In configs/datamodule/default.yaml:

  • Update pvnet_model.model_id and pvnet_model.revision to point to the Huggingface commit or local directory where the exported PVNet model is.
  • Update configuration to point to a data configuration compatible with the PVNet model whose outputs will be fed into the summation model.
  • Set train_period and val_period to control the time ranges of the train and val period
  • Optionally set max_num_train_samples and max_num_val_samples to limit the number of possible train and validation example which will be used.
  1. In configs/model/default.yaml:
    • Update the hyperparameters and structure of the summation model
  2. In configs/trainer/default.yaml:
    • Set accelerator: 0 if running on a system without a supported GPU

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

python run.py

Testing

You can use python -m pytest tests to run tests

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pvnet_summation-1.2.2.tar.gz (21.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pvnet_summation-1.2.2-py3-none-any.whl (25.9 kB view details)

Uploaded Python 3

File details

Details for the file pvnet_summation-1.2.2.tar.gz.

File metadata

  • Download URL: pvnet_summation-1.2.2.tar.gz
  • Upload date:
  • Size: 21.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pvnet_summation-1.2.2.tar.gz
Algorithm Hash digest
SHA256 9f7df92dcae0279ef3387f1d534620c74e7dcfcfac24b5510b2d4f8adb1f6235
MD5 d0e7acb4e98b8a4c528fc42b7a805d65
BLAKE2b-256 3be6b057fc4c9ae6cd51ebe3f3375df6656fb55efba7d088d500ca14539862f2

See more details on using hashes here.

File details

Details for the file pvnet_summation-1.2.2-py3-none-any.whl.

File metadata

  • Download URL: pvnet_summation-1.2.2-py3-none-any.whl
  • Upload date:
  • Size: 25.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pvnet_summation-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6d8399a73c80c34cc1c47effe8a1fcdfe540a434181c4104ce9e3c8b77d7d9e9
MD5 cc3c3bfe299c915b313159356b6d35f8
BLAKE2b-256 007c619c7055eeffece318907ed8b0cc6529adfa733cc29dd9addb13e0162704

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page