Python tools for modelling plant productivity and demography.
Project description
The pyrealm package provides a toolbox implementing some key models for estimating
plant productivity, growth and demography in Python. The outputs of different models
can be then easily fed into other models within pyrealm to allow productivity
estimates to be fed forward into estimation of net primary productivity, growth and
ultimately plant community demography.
The pyrealm package currently includes:
- The P Model for estimating optimal rates of plant photosynthesis given the balance between carbon capture and water loss. This includes recent extensions to incorporate the effects of water stress, slow acclimation processes, models of C3/C4 competition and carbon isotope fractionation.
- The SPLASH model for calculating soil moisture and actual evapotranspiration.
- Initial components of a demography module for modelling plant functional types, cohorts, communities and canopies, including allocation calculations using the T Model.
- A suite of core physics functions and other utilities used to support the modules above.
For more details, see the package website: https://pyrealm.readthedocs.io/.
Version overview
The pyrealm package uses semantic versioning and the list below
summarise the major changes:
- Version
1.0.0: initial implementation of the P Model and associated functionality - Version
2.0.0: wide refactor of P Model code to a new API, extension of the package functionality to include the SPLASH v1 model and experimental modules developing functionality for plant demography and phenology.
We strongly recommend that you update to version 2.0.0. The documentation
includes a migration
guide to help update
existing code using version 1.0.0.
Using pyrealm
The pyrealm package requires Python 3.11 or greater and we currently test all
pyrealm code using Python 3.11, 3.12 and 3.13. We make released package versions
available via PyPi and also generate DOIs for each
release via Zenodo. You can install the most
recent release using pip:
pip install pyrealm
You can now get started using pyrealm. For example, to calculate the estimated gross
primary productivity of a C3 plant in a location, start a Python interpreter, using
python, python3 or ipython depending on your installation, and run:
import numpy as np
from pyrealm.pmodel import PModelEnvironment, PModel
# Calculate the photosynthetic environment given the conditions
env = PModelEnvironment(
tc=np.array([20]), vpd=np.array([1000]),
co2=np.array([400]), patm=np.array([101325.0],
fapar=1, ppfd=300)
)
# Calculate the predictions of the P Model for a C3 plant
pmodel_c3 = PModel(env)
# Report the GPP in micrograms of carbon per m2 per second.
pmodel_c3.gpp
This should give the following output:
array([76.42544948])
The package website provides worked examples of using pyrealm, for example to:
- fit the P Model,
- include acclimation in estimating light use efficiency , and
- estimate C3/C4 competition.
These worked examples also show how pyrealm can be used within Python scripts or
Jupyter notebooks and how to use pyrealm with large datasets loaded using
numpy or xarray with
pyrealm classes and functions.
Citing pyrealm
The pyrealm repository can be cited following the information in the citation
file. If you are using pyrealm in research, it is better to cite the
DOI of the specific release from Zenodo.
Developing pyrealm
If you are interested in contributing to the development of pyrealm, please read the
guide for contributors. Please do also read the code of
conduct for contributing to this project.
Support and funding
Development of the pyrealm package has been supported by the following grants and
institutions:
- The REALM project, funded by an ERC grant to Prof. Colin Prentice (Imperial College London).
- The LEMONTREE project, funded by Schmidt Sciences through the VESRI programme to support an international research team lead by Prof. Sandy Harrison (University of Reading).
- The Virtual Rainforest project, funded by a Distinguished Scientist award from the NOMIS Foundation to Prof. Robert Ewers (Imperial College London)
- Research software engineering support from the Institute of Computing for Climate Science at the University of Cambridge, through the Virtual Institute for Scientific Software program funded by Schmidt Sciences.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
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 pyrealm-2.0.0.tar.gz.
File metadata
- Download URL: pyrealm-2.0.0.tar.gz
- Upload date:
- Size: 137.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2fa7fc20cd24775178cf4c0d06894d1d96d766ef762ea0fcc4f60c3dc61ce3e6
|
|
| MD5 |
83fcdcae49a928a7041a2ec03eee952e
|
|
| BLAKE2b-256 |
9a36c0b55024887cecc9f5d6725e94e0d71f12a53c8b77f17d15f9ce875da4c0
|
Provenance
The following attestation bundles were made for pyrealm-2.0.0.tar.gz:
Publisher:
pyrealm_publish.yaml on ImperialCollegeLondon/pyrealm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyrealm-2.0.0.tar.gz -
Subject digest:
2fa7fc20cd24775178cf4c0d06894d1d96d766ef762ea0fcc4f60c3dc61ce3e6 - Sigstore transparency entry: 545731109
- Sigstore integration time:
-
Permalink:
ImperialCollegeLondon/pyrealm@e2905b57aebd91a1a731db862c7f387fd4445fe8 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/ImperialCollegeLondon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pyrealm_publish.yaml@e2905b57aebd91a1a731db862c7f387fd4445fe8 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pyrealm-2.0.0-py3-none-any.whl.
File metadata
- Download URL: pyrealm-2.0.0-py3-none-any.whl
- Upload date:
- Size: 160.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23beea1ab27f6bf2c846cd400eaf8508dccb84a9acc1577601c650c249ae5be7
|
|
| MD5 |
baa2e39cb6413f40dd0b0a5b79e6b530
|
|
| BLAKE2b-256 |
031ded2cd2e2f381434ae97eb8ea837ff685aaf79a1d1840f5d17b880024b139
|
Provenance
The following attestation bundles were made for pyrealm-2.0.0-py3-none-any.whl:
Publisher:
pyrealm_publish.yaml on ImperialCollegeLondon/pyrealm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyrealm-2.0.0-py3-none-any.whl -
Subject digest:
23beea1ab27f6bf2c846cd400eaf8508dccb84a9acc1577601c650c249ae5be7 - Sigstore transparency entry: 545731141
- Sigstore integration time:
-
Permalink:
ImperialCollegeLondon/pyrealm@e2905b57aebd91a1a731db862c7f387fd4445fe8 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/ImperialCollegeLondon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pyrealm_publish.yaml@e2905b57aebd91a1a731db862c7f387fd4445fe8 -
Trigger Event:
release
-
Statement type: