pyrealm

Providing an integrated toolbox for modelling plant productivity, growth and demography using Python.
https://github.com/ImperialCollegeLondon/pyrealm

Category: Biosphere
Sub Category: Plants and Vegetation

Keywords from Contributors

energy-system-model crop images distribution accessor categories root mesh pypi routing

Last synced: about 19 hours ago
JSON representation

Repository metadata

Development of the pyrealm package, providing an integrated toolbox for modelling plant productivity, growth and demography using Python.

README.md


PyPI - Version
PyPI - Python Version
DOI
Documentation Status
codecov
Test and build
pre-commit.ci status
SPEC 0 — Minimum Supported Dependencies

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:

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:

Citation (CITATION.cff)

cff-version: 1.2.0
title: pyrealm
message: >-
  If you use this software, please cite it using the
  metadata from this file.
type: software
authors:
  - given-names: C. David L.
    family-names: Orme
    email: d.orme@imperial.ac.uk
    affiliation: Department of Life Sciences, Imperial College London
    orcid: 'https://orcid.org/0000-0002-7005-1394'
  - given-names: Alienor
    family-names: Lavergne
    email: alienor.lavergne@springernature.com
    affiliation: Department of Life Sciences, Imperial College London
  - given-names: Vivienne
    family-names: Groner
    email: v.groner@imperial.ac.uk
    affiliation: Department of Life Sciences, Imperial College London
  - given-names: Marion
    family-names: Weinzierl
    email: mw925@cam.ac.uk
    affiliation: Institute of Computing for Climate Science, University of Cambridge
  - given-names: Tianzhang
    family-names: Cai
    email: tc684@cam.ac.uk
    affiliation: Institute of Computing for Climate Science, University of Cambridge
  - given-names: Surbhi
    family-names: Goel
    email: sg2147@cam.ac.uk
    affiliation: Institute of Computing for Climate Science, University of Cambridge
  - given-names: Alexander
    family-names: Smith
    email: as3402@cam.ac.uk
    affiliation: Institute of Computing for Climate Science, University of Cambridge
  - given-names: James
    family-names: Emberton
    email: je484@cam.ac.uk
    affiliation: Institute of Computing for Climate Science, University of Cambridge
  - given-names: Amy
    family-names: Pike
    email: ap766@cam.ac.uk
    affiliation: Institute of Computing for Climate Science, University of Cambridge

repository-code: 'https://github.com/ImperialCollegeLondon/pyrealm'
url: 'https://pyrealm.readthedocs.io'
repository: 'https://pypi.org/project/pyrealm/'
abstract: >-
  The pyrealm package provides an integrated set of Python 3
  modules for modelling plant productivity, growth and
  demography and the estimation of growing conditions.
license: MIT


Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: about 2 months ago

Total Commits: 2,215
Total Committers: 14
Avg Commits per committer: 158.214
Development Distribution Score (DDS): 0.303

Commits in past year: 642
Committers in past year: 7
Avg Commits per committer in past year: 91.714
Development Distribution Score (DDS) in past year: 0.421

Name Email Commits
David Orme d****e 1543
MarionBWeinzierl m****5@c****k 178
James Emberton j****n@g****m 146
tztsai 1****4@q****m 88
pre-commit-ci[bot] 6****] 84
Sam Avis a****6@g****m 42
TZCai 1****9@1****m 39
Surbhi Goel s****7@g****m 38
Sally s****n@g****m 17
Alexander Smith a****x@g****m 15
arne s****e@g****m 13
Amy Pike a****e@h****k 6
vgro v****o 5
github-actions[bot] 4****] 1

Committer domains:


Issue and Pull Request metadata

Last synced: about 2 months ago

Total issues: 224
Total pull requests: 416
Average time to close issues: about 2 months
Average time to close pull requests: 14 days
Total issue authors: 14
Total pull request authors: 12
Average comments per issue: 0.74
Average comments per pull request: 1.99
Merged pull request: 332
Bot issues: 1
Bot pull requests: 97

Past year issues: 98
Past year pull requests: 207
Past year average time to close issues: 16 days
Past year average time to close pull requests: 6 days
Past year issue authors: 7
Past year pull request authors: 7
Past year average comments per issue: 0.53
Past year average comments per pull request: 1.53
Past year merged pull request: 165
Past year bot issues: 1
Past year bot pull requests: 54

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/ImperialCollegeLondon/pyrealm

Top Issue Authors

  • davidorme (150)
  • MarionBWeinzierl (31)
  • j-emberton (17)
  • tztsai (5)
  • sjavis (4)
  • surbhigoel77 (4)
  • AmyOctoCat (3)
  • arne-exe (2)
  • sallymatson (2)
  • a-smith-github (2)
  • Syuizen (1)
  • mondus (1)
  • github-actions[bot] (1)
  • VallesMarinerisExplorer (1)

Top Pull Request Authors

  • davidorme (222)
  • pre-commit-ci[bot] (83)
  • MarionBWeinzierl (31)
  • tztsai (25)
  • github-actions[bot] (14)
  • j-emberton (12)
  • sjavis (9)
  • surbhigoel77 (8)
  • AmyOctoCat (7)
  • arne-exe (2)
  • sallymatson (2)
  • a-smith-github (1)

Top Issue Labels

  • bug (32)
  • enhancement (26)
  • rse (17)
  • roadmap (11)
  • meta (8)
  • documentation (8)
  • core devs (7)
  • code review (2)
  • icebox (2)
  • duplicate (1)
  • testing (1)
  • outreach (1)

Top Pull Request Labels

  • enhancement (21)
  • documentation (10)
  • rse (9)
  • roadmap (3)
  • code review (2)
  • testing (2)
  • core devs (1)

Package metadata

proxy.golang.org: github.com/ImperialCollegeLondon/pyrealm

proxy.golang.org: github.com/imperialcollegelondon/pyrealm

pypi.org: pyrealm

Python tools for modelling plant productivity and demography.

  • Homepage: https://pyrealm.readthedocs.io/
  • Documentation: https://pyrealm.readthedocs.io/
  • Licenses: MIT License
  • Latest release: 2.0.0 (published 3 months ago)
  • Last Synced: 2025-10-29T20:09:56.234Z (about 2 months ago)
  • Versions: 28
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 3,018 Last month
  • Rankings:
    • Dependent packages count: 10.052%
    • Forks count: 15.314%
    • Average: 17.149%
    • Stargazers count: 18.46%
    • Downloads: 20.28%
    • Dependent repos count: 21.642%
  • Maintainers (1)

Dependencies

requirements.txt pypi
  • netCDF4 *
  • pre-commit *
  • pytest *
  • pyyaml *
.github/workflows/pre-commit_autoupdate.yaml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • browniebroke/pre-commit-autoupdate-action main composite
  • peter-evans/create-pull-request v3 composite
.github/workflows/pyrealm_ci.yaml actions
  • abatilo/actions-poetry v2.1.6 composite
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • pre-commit/action v3.0.0 composite
poetry.lock pypi
  • 131 dependencies
pyproject.toml pypi
  • Bottleneck ^1.3.5
  • dacite ^1.6.0
  • numpy ^1.16.5
  • python >=3.9,<3.11
  • scipy ^1.7.3
  • tabulate ^0.8.10

Score: 15.18466893313743