Skip to main content

Reference implementation for the Relative Utility Value forecast value method.

Project description

RUVPY

Tests Coverage License: Apache 2.0 Contributor Covenant Zenodo

Open Science infrastructure written in Python.

RUVPY is a library which can be used in your software to quantify the value of forecast information for decision-making.

It is a reference implementation of the Relative Utility Value (RUV) method, which is very flexible and can accommodate a wide range of decisions.

It includes a set of commonly used decision rules, utility functions, damage functions, and economic models. The implementation is sufficiently computationally efficient for most situations and parallelises timesteps over available CPU cores. The primary focus of this implementation is clarity and flexibility.

The scope is intentionally narrow and does not include any figure generation, data loading and saving, other metrics, or analysis functionality. These functions are intended to be implemented in a larger workflow or analysis pipeline which calls the main entry point of this library.

Publications

The method and software package are introduced in detail in the following publications. We suggest reading these to understand the context and motivation for the software.

Laugesen, R., Thyer, M., McInerney, D., and Kavetski, D.: Flexible forecast value metric suitable for a wide range of decisions: application using probabilistic subseasonal streamflow forecasts, Hydrol. Earth Syst. Sci., 27, 873–893, https://doi.org/10.5194/hess-27-873-2023, 2023.

Laugesen, R., Thyer, M., McInerney, D., Kavetski, D. (2024). Software library to quantify the value of forecasts for decision-making: Case study on sensitivity to damages (under review).

Installation

The package is available on PyPI and can be installed using pip:

pip install ruvpy

Documentation

Generated documentation is available at https://richardlaugesen.github.io/ruvpy/.

Examples

The package includes a set of examples corresponding to each figure in the publications noted above. These are all implemented as Jupyter notebooks in the examples directory.

Templates

RUV is designed to be tailored to the decision being evaluated. This may require the development of custom components to define the decision context in RUVPY. A set of templates to help you get started is included in templates directory.

Please consider contributing your new components to the repository to help others.

Development

The main package requires Python (>=3.8), NumPy, SciPy, and Pathos. The examples additionally require XArray, Pandas, Jupyter, and Matplotlib, the tests require Pytest and Statsmodels, and generating docs requires pdoc3.

All dependencies are defined in an included pyproject.toml file ready for use with Poetry or Setuptools.

For example, the following commands can be used once Poetry is installed to set the environment up:

poetry install
poetry shell

And then to run the unit tests use:

pytest

To run examples use:

jupyter notebook

Regenerate documentation using:

pdoc --html --output-dir docs ruvpy --force

Attribution

This project is licensed under the Apache License 2.0, which allows for free use, modification, and distribution of the code under the terms of the license.

We would like to acknowledge and thank the RUVPY developers for their efforts in maintaining and improving this project. Please see the AUTHORS file for a full list of contributors.

For proper citation of this project, please refer to the CITATION.cff file, which provides guidance on how to cite the software and relevant publications.

Code of conduct

We encourage you to contribute! Everyone interacting with this project is expected to follow the Code of Conduct.

Contact

Richard Laugesen (richard@laugesen.com.au)

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

ruvpy-0.9.1.tar.gz (16.2 kB view details)

Uploaded Source

Built Distribution

ruvpy-0.9.1-py3-none-any.whl (26.7 kB view details)

Uploaded Python 3

File details

Details for the file ruvpy-0.9.1.tar.gz.

File metadata

  • Download URL: ruvpy-0.9.1.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for ruvpy-0.9.1.tar.gz
Algorithm Hash digest
SHA256 428fcdad9a4166b3a2ec261a01ed2e79c761d98e41c55ce32c3abf53ac68e115
MD5 394932e8dd0f2aa9307413b2605bf4cb
BLAKE2b-256 967dd33f45b57f485ba12e662cfd97b219c523b35d35d9d84755b2d57b74ff26

See more details on using hashes here.

File details

Details for the file ruvpy-0.9.1-py3-none-any.whl.

File metadata

  • Download URL: ruvpy-0.9.1-py3-none-any.whl
  • Upload date:
  • Size: 26.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for ruvpy-0.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 40323ff7fa72f2ac0e5c7ba5e28f44b2a7ff01d9a915aeea839dcfa08b756b07
MD5 60a4a88cc9153a17e3b53f730ea137c3
BLAKE2b-256 3475a57013d4316e80116b95713dd2c6272b746c3087ad04212f8d0cdfc4ab8d

See more details on using hashes here.

Supported by

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