Skip to main content

Python tools for modelling plant productivity and demography.

Project description

The pyrealm package

PyPI - Version PyPI - Python Version DOI Documentation Status codecov Test and build pre-commit.ci status

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 T Model of the allocation of gross primary productivity to estimate net primary productivity and hence plant growth.
  • The SPLASH model for calculating soil moisture and actual evapotranspiration.
  • 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/.

Using pyrealm

The pyrealm package requires Python 3 and the currently supported Python versions are: 3.10 and 3.11. 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])
)

# Calculate the predictions of the P Model for a C3 plant
pmodel_c3 = PModel(env)

# Estimate the GPP from the model given the absorbed photosynthetically active light
pmodel_c3.estimate_productivity(fapar=1, ppfd=300)

# 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:

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 prealm package has been supported by the following grants and institutions:

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

pyrealm-1.0.0.tar.gz (49.8 MB view details)

Uploaded Source

Built Distribution

pyrealm-1.0.0-py3-none-any.whl (89.2 kB view details)

Uploaded Python 3

File details

Details for the file pyrealm-1.0.0.tar.gz.

File metadata

  • Download URL: pyrealm-1.0.0.tar.gz
  • Upload date:
  • Size: 49.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for pyrealm-1.0.0.tar.gz
Algorithm Hash digest
SHA256 44060d8b010a5e0d80e02fddd7e72592f675a7885c8f6ae60fce9e81f31668e7
MD5 c5515f787a6dd900e4b38c31d92e60ee
BLAKE2b-256 3dea627ec4123f67d633303f7369a2a7d9cedce6df307e53cfc13805c549e0a9

See more details on using hashes here.

File details

Details for the file pyrealm-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pyrealm-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 89.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for pyrealm-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 080d0650f10e0e496033d1ec7b11b3f061a95a3e926631ea0834ad59b4a415df
MD5 e248ce0456ec530293426655978834f1
BLAKE2b-256 8704e6ab7d35da635dd7aa6ad7f435308d16d2873fa36ee62116137b5852c89f

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