A Vector Autoregressive Weather Generator
Project description
VARWG: Vector Autoregressive Weather Generator
What is VARWG?
VARWG is a single-site Vector-Autoregressive weather generator that was developed for hydrodynamic and ecologic modelling of lakes. It includes a number of possibilities to define climate scenarios. For example, changes in mean or in the variability of air temperature can be set. Correlations during simulations are preserved, so that these changes propagate from the air temperature to the other simulated variables.
About the Name Change
The project was renamed from VG to VARWG because there is already a different package named vg on PyPI. To avoid conflicts and ensure the package is properly discoverable on PyPI, we adopted the more descriptive name VARWG (Vector-Autoregressive Weather Generator). For backward compatibility, the old VG class name is still available as an alias, so existing code will continue to work without modifications.
Installation
From PyPI (Recommended)
pip install varwg
Pre-built wheels are available for:
- Linux: x86_64
- Windows: AMD64
- macOS: x86_64 (Intel), arm64 (Apple Silicon)
No compiler needed! If a wheel isn't available for your platform, pip will automatically build from source (requires C compiler and Cython).
From Source
git clone https://github.com/iskur/varwg.git
cd varwg
pip install -e .
Building from source requires:
- C compiler (gcc/clang/MSVC)
- Cython >= 3.1.1
- NumPy >= 1.26.0
Quick Start
After installation, you can use VARWG to generate synthetic weather data:
import varwg
# Configure VARWG with default settings
varwg.set_conf(varwg.config_template)
# Define meteorological variables to simulate
var_names = ("theta", "Qsw", "rh") # Temperature, solar radiation, humidity
# Initialize the weather generator with sample data
met_varwg = varwg.VarWG(var_names, met_file=varwg.sample_met, refit=True, verbose=True)
# Fit the seasonal VAR model
met_varwg.fit(p=3, seasonal=True)
# Simulate 10 years of daily weather data
sim_times, sim_data = met_varwg.simulate(T=10*365)
# Visualize results
met_varwg.plot_meteogram_daily()
See the scripts/ directory for more advanced examples.
Running Tests
To run the test suite:
uv run pytest
Or install test dependencies and run:
uv sync --group test
uv run pytest
Documentation
The documentation can be accessed online at https://vg-doc.readthedocs.io.
Release notes
See CHANGELOG.md for detailed release notes, or view releases on GitHub.
Current version: 1.4.0 - Python ≥ 3.13 required
Web sites
Code is hosted at: https://github.com/iskur/varwg/
Citation
If you use VARWG in your research, please cite:
Schlabing, D., Frassl, M. A., Eder, M., Rinke, K., & Bárdossy, A. (2014). Use of a weather generator for simulating climate change effects on ecosystems: A case study on Lake Constance. Environmental Modelling & Software, 61, 326-338. https://doi.org/10.1016/j.envsoft.2014.06.028
BibTeX
@article{schlabing2014vg,
author = {Schlabing, Dirk and Frassl, Marieke A. and Eder, Magdalena and Rinke, Karsten and B{\'a}rdossy, Andr{\'a}s},
title = {Use of a weather generator for simulating climate change effects on ecosystems: A case study on {Lake Constance}},
journal = {Environmental Modelling \& Software},
volume = {61},
pages = {326--338},
year = {2014},
doi = {10.1016/j.envsoft.2014.02.028},
url = {https://doi.org/10.1016/j.envsoft.2014.06.028}
}
Publications Using VARWG
The following publications have used VARWG for weather generation:
-
Kobler, U. G., Wüest, A., & Schmid, M. (2018). Effects of Lake–Reservoir Pumped-Storage Operations on Temperature and Water Quality. Sustainability, 10(6), 1968. https://doi.org/10.3390/su10061968
-
Fenocchi, A., Petaccia, G., Sibilla, S., & Dresti, C. (2018). Forecasting the evolution in the mixing regime of a deep subalpine lake under climate change scenarios through numerical modelling (Lake Maggiore, Northern Italy/Southern Switzerland). Climate Dynamics, 51, 3521-3536. https://doi.org/10.1007/s00382-018-4094-6
-
Gal, G., Gilboa, Y., Schachar, N., Estroti, M., & Schlabing, D. (2020). Ensemble Modeling of the Impact of Climate Warming and Increased Frequency of Extreme Climatic Events on the Thermal Characteristics of a Sub-Tropical Lake. Water, 12(7), 1982. https://doi.org/10.3390/w12071982
-
Eder, M. (2013). Climate sensitivity of a large lake. PhD Thesis, University of Stuttgart, http://dx.doi.org/10.18419/opus-509.
If you've published work using VARWG, please let us know by opening an issue so we can add it to this list!
License information
See the file "LICENSE" for information on the history of this software, terms & conditions for usage, and a DISCLAIMER OF ALL WARRANTIES.
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
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file varwg-1.4.4.tar.gz.
File metadata
- Download URL: varwg-1.4.4.tar.gz
- Upload date:
- Size: 2.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9cb20e990b7153ddc8de12a49b23cfeaeddba2362b75a51ff17e3bee02725720
|
|
| MD5 |
405d551786fecd7001dc0d787947e989
|
|
| BLAKE2b-256 |
dc5545ab7f2ab9987652cbcf726bf0191405905629c7ab4b1ccab2b63ea3527d
|
Provenance
The following attestation bundles were made for varwg-1.4.4.tar.gz:
Publisher:
build-wheels.yml on iskur/varwg
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
varwg-1.4.4.tar.gz -
Subject digest:
9cb20e990b7153ddc8de12a49b23cfeaeddba2362b75a51ff17e3bee02725720 - Sigstore transparency entry: 815848753
- Sigstore integration time:
-
Permalink:
iskur/varwg@7f323b77bd25f5a9ec927d8f52997f3b1f5581cd -
Branch / Tag:
refs/pull/29/merge - Owner: https://github.com/iskur
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-wheels.yml@7f323b77bd25f5a9ec927d8f52997f3b1f5581cd -
Trigger Event:
pull_request
-
Statement type:
File details
Details for the file varwg-1.4.4-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: varwg-1.4.4-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
856c2bea31463afd378f2eda9ac381bfbf5dcde63b784e26fe4942702ebe20f6
|
|
| MD5 |
33e6c45d438037d5090a14b976085270
|
|
| BLAKE2b-256 |
8174932c290d0c32c12f67030708e9cd671f3e6d4e16b6dc13f8ef1945d5a243
|
Provenance
The following attestation bundles were made for varwg-1.4.4-cp313-cp313-win_amd64.whl:
Publisher:
build-wheels.yml on iskur/varwg
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
varwg-1.4.4-cp313-cp313-win_amd64.whl -
Subject digest:
856c2bea31463afd378f2eda9ac381bfbf5dcde63b784e26fe4942702ebe20f6 - Sigstore transparency entry: 815848777
- Sigstore integration time:
-
Permalink:
iskur/varwg@7f323b77bd25f5a9ec927d8f52997f3b1f5581cd -
Branch / Tag:
refs/pull/29/merge - Owner: https://github.com/iskur
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-wheels.yml@7f323b77bd25f5a9ec927d8f52997f3b1f5581cd -
Trigger Event:
pull_request
-
Statement type:
File details
Details for the file varwg-1.4.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: varwg-1.4.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 3.9 MB
- Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e24e3bfe5325f11d0744769c186cccbb947c1e9fb911b96dd633805232c09bb
|
|
| MD5 |
f551410b3fbc7f4347b7074d24743957
|
|
| BLAKE2b-256 |
c87f80cee44d3d4adcba9ce4642e753d5cf1930e2cf7f1148a64e39e6c80c0ed
|
Provenance
The following attestation bundles were made for varwg-1.4.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
build-wheels.yml on iskur/varwg
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
varwg-1.4.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
8e24e3bfe5325f11d0744769c186cccbb947c1e9fb911b96dd633805232c09bb - Sigstore transparency entry: 815848795
- Sigstore integration time:
-
Permalink:
iskur/varwg@7f323b77bd25f5a9ec927d8f52997f3b1f5581cd -
Branch / Tag:
refs/pull/29/merge - Owner: https://github.com/iskur
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-wheels.yml@7f323b77bd25f5a9ec927d8f52997f3b1f5581cd -
Trigger Event:
pull_request
-
Statement type:
File details
Details for the file varwg-1.4.4-cp313-cp313-macosx_11_0_arm64.whl.
File metadata
- Download URL: varwg-1.4.4-cp313-cp313-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.2 MB
- Tags: CPython 3.13, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
345ba11e3eeb11016b8555c18c1a00f79ce6acaa6ded59d6ee46fa4728d84ee8
|
|
| MD5 |
da06186f90d7ad21f9dd494439ff1699
|
|
| BLAKE2b-256 |
62aea821686cee3899e7b14805d0ed8de59696410fcba33c62ef9b3046e5fd91
|
Provenance
The following attestation bundles were made for varwg-1.4.4-cp313-cp313-macosx_11_0_arm64.whl:
Publisher:
build-wheels.yml on iskur/varwg
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
varwg-1.4.4-cp313-cp313-macosx_11_0_arm64.whl -
Subject digest:
345ba11e3eeb11016b8555c18c1a00f79ce6acaa6ded59d6ee46fa4728d84ee8 - Sigstore transparency entry: 815848826
- Sigstore integration time:
-
Permalink:
iskur/varwg@7f323b77bd25f5a9ec927d8f52997f3b1f5581cd -
Branch / Tag:
refs/pull/29/merge - Owner: https://github.com/iskur
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-wheels.yml@7f323b77bd25f5a9ec927d8f52997f3b1f5581cd -
Trigger Event:
pull_request
-
Statement type:
File details
Details for the file varwg-1.4.4-cp313-cp313-macosx_10_13_x86_64.whl.
File metadata
- Download URL: varwg-1.4.4-cp313-cp313-macosx_10_13_x86_64.whl
- Upload date:
- Size: 2.2 MB
- Tags: CPython 3.13, macOS 10.13+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a6e0704bdeedd120e42df38956a8835dcedc58f73be90ec7823e7b11d8561c6
|
|
| MD5 |
89d47af6df6c57e3ca053ad51c3a8a51
|
|
| BLAKE2b-256 |
5bb2bdee4f0f0abd5688a987ba6844462107bc01634b2a2b1acb352d7b7a9414
|
Provenance
The following attestation bundles were made for varwg-1.4.4-cp313-cp313-macosx_10_13_x86_64.whl:
Publisher:
build-wheels.yml on iskur/varwg
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
varwg-1.4.4-cp313-cp313-macosx_10_13_x86_64.whl -
Subject digest:
1a6e0704bdeedd120e42df38956a8835dcedc58f73be90ec7823e7b11d8561c6 - Sigstore transparency entry: 815790389
- Sigstore integration time:
-
Permalink:
iskur/varwg@46b5810df1936e21d9ce7980c4148f9267fddc84 -
Branch / Tag:
refs/pull/29/merge - Owner: https://github.com/iskur
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-wheels.yml@46b5810df1936e21d9ce7980c4148f9267fddc84 -
Trigger Event:
pull_request
-
Statement type: