Skip to main content

DOI GitHub Org


PaleoVeg

PaleoVeg is a Python package for predicting vegetation types based on bioclimatic variables. It is designed for paleovegetation reconstruction, allowing users to model vegetation based on past climate data or other environmental predictors.

Release preparation, classifier checksums, and persistent archiving are described in RELEASE.md. Version 1.0.0 uses a newly trained all-data classifier; its predictions differ from the classifier used by v0.2.0. Native model loading uses scikit-learn 1.9.0 and requires Python 3.11 or later.

Features

  • Predict vegetation types for single or multiple locations using bioclimatic variables.
  • Apply a CO₂ concentration-dependent C3/C4 competition correction.
  • Run CSV/TSV predictions locally in a browser through the static GitHub Pages app.
  • Flexible output options:
    • Probabilities for each vegetation type.
    • Dominant vegetation type.
  • Supports input as:
    • Pandas DataFrames for tabular data.
    • Numpy arrays for map-like (grid-based) data.

Predicted Vegetation/Biome Types

PaleoVeg predicts the following vegetation/biome types:

  1. Evergreen Needleleaf Forest
  2. Evergreen Broadleaf Forest
  3. Deciduous Needleleaf Forest
  4. Deciduous Broadleaf Forest
  5. Mixed Forest
  6. Woodland
  7. Wooded Grassland
  8. Closed Shrubland
  9. Open Shrubland
  10. Grassland
  11. Bare Ground

Installation

  1. Clone the repository:

    git clone https://github.com/roink/PaleoVeg.git
    cd PaleoVeg
    
  2. Install the package:

    pip install .
    

The default installation contains the dependencies needed to download the released model and make predictions. Install the optional dependencies when reproducing the published analyses or testing the browser application:

pip install -e '.[reproduction,test]'  # Model training and paper reproduction
pip install -e '.[browser-test]'       # Browser/Python prediction parity

The reproduction workflow also uses CDO, curl, unzip, and sha256sum. See training/README.md for required input data, the complete workflow, and the software versions recorded for the published analyses.

Browser application

Open the PaleoVeg web application

The web application lets you run PaleoVeg without installing Python. Climate data are processed locally in the browser and are not uploaded to a server.

It accepts CSV, TSV, and NetCDF data containing either BIOCLIM variables or 12-month temperature and precipitation normals. Variable matches, climate units, and the choice between supplied and derived BIOCLIM variables are shown for review before a prediction runs.

For spatial NetCDF data, the app provides a map preview and can export NetCDF, CSV, NumPy, PNG, and reproducibility metadata. It supports dominant vegetation, class probabilities, and C3/C4 correction using a chosen CO₂ concentration or a geological-age lookup.


Usage

1. Import the Package

from paleoveg import predict, predict_map

2. Predict Using Tabular Data

Input Data

Provide a Pandas DataFrame with the following required columns:

bio1, bio4, bio5, bio6, bio7, bio8, bio9, bio10, bio11, bio12, bio13, bio14, bio15, bio16, bio17, bio18, bio19

Example

import pandas as pd
from paleoveg import predict

# Example input DataFrame
data = {
    "bio1": [10.2, 12.5],
    "bio4": [15.6, 14.1],
    "bio5": [20.1, 18.4],
    "bio6": [5.3, 7.2],
    "bio7": [14.8, 16.5],
    "bio8": [12.4, 11.8],
    "bio9": [9.7, 8.9],
    "bio10": [8.5, 9.2],
    "bio11": [7.9, 6.5],
    "bio12": [300.5, 310.2],
    "bio13": [100.2, 102.4],
    "bio14": [150.4, 148.3],
    "bio15": [180.6, 175.9],
    "bio16": [170.3, 165.2],
    "bio17": [160.9, 155.8],
    "bio18": [140.7, 145.4],
    "bio19": [130.8, 128.7],
}

df = pd.DataFrame(data)

# Predict probabilities
probabilities = predict(df, dominant="exclude", c3_c4_correction=False)

# Predict dominant vegetation type
dominant_class = predict(df, dominant="only", c3_c4_correction=True)

# Specify another atmospheric CO2 concentration in ppm
result = predict(
    df,
    dominant="include",
    c3_c4_correction=True,
    co2_ppm=220,
)

# Derive CO2 from geological age in ka BP (before 1950)
result_at_20ka = predict(
    df,
    dominant="include",
    c3_c4_correction=True,
    age_ka_bp=20,
)

3. Predict Using Map-Like Data

Input Data

Provide a Numpy array with shape (m, n, 17) where:

  • m and n represent the grid dimensions.
  • 17 represents the bioclimatic variables in the required order.

Example

import numpy as np
from paleoveg import predict_map

# Example 3D data: m = 5, n = 5, 17 predictors
m, n = 5, 5
data = np.random.rand(m, n, 17)

# Predict probabilities (m x n x 11)
probabilities_map = predict_map(data, dominant="exclude", c3_c4_correction=False)

# Predict dominant type (m x n x 1)
dominant_map = predict_map(data, dominant="only", c3_c4_correction=True)

Functions

1. predict(input_df, dominant="exclude", c3_c4_correction=False, ..., co2_ppm=None, age_ka_bp=None)

Predict vegetation types for tabular data.

Parameters:

  • input_df (pd.DataFrame): Input DataFrame with 17 bioclimatic variables.
  • dominant (str): Specifies the output format.
    • "exclude": Returns probabilities for each vegetation type.
    • "include": Returns probabilities and the dominant type.
    • "only": Returns only the dominant type.
  • c3_c4_correction (bool): If True, applies the C3/C4 competition correction. Omitting co2_ppm preserves the legacy 185 ppm result. If False, predictions are uncorrected and represent the 310 ppm baseline.
  • co2_ppm (float, optional): Atmospheric CO₂ concentration used for the correction. It may only be supplied when c3_c4_correction=True.
  • age_ka_bp (float, optional): Geological age in thousands of years before 1950. PaleoVeg linearly interpolates atmospheric CO₂ from the bundled IPCC AR6 observations. It is mutually exclusive with co2_ppm and requires c3_c4_correction=True.

Returns:

  • Pandas DataFrame: Probabilities and/or dominant type based on dominant.

2. predict_map(data, dominant="exclude", c3_c4_correction=False, model=None, co2_ppm=None, age_ka_bp=None)

Predict vegetation types for 3D map-like data.

Parameters:

  • data (np.ndarray): Input Numpy array with shape (m, n, 17).
  • dominant (str): Specifies the output format.
    • "exclude": Returns probabilities (m x n x 11).
    • "only": Returns the dominant type (m x n x 1).
  • c3_c4_correction (bool): If True, applies the C3/C4 competition correction, defaulting to the legacy 185 ppm result.
  • co2_ppm (float, optional): Atmospheric CO₂ concentration. Requires c3_c4_correction=True.
  • age_ka_bp (float, optional): Geological age in ka BP relative to 1950. Mutually exclusive with co2_ppm.

Returns:

  • Numpy array: Probabilities or dominant type based on dominant.

C3/C4 Competition Factors

The factors below are the published correction at 185 ppm. At the uncorrected modern baseline of 310 ppm every factor is 1. For another concentration c, PaleoVeg calculates each class factor as:

factor(c) = 1 + ((310 - c) / (310 - 185)) × (factor(185) - 1)

Values between 185 and 310 ppm are interpolated and values outside that interval are linearly extrapolated. PaleoVeg rejects concentrations that would make any class factor zero or negative. Corrected probabilities are renormalized to sum to one.

CO₂ lookup by geological age

from paleoveg import co2_at_time

co2_ppm = co2_at_time(20)  # approximately 194.04 ppm

The bundled lookup preserves all 1,894 irregular CO₂ observations from the IPCC AR6 Figure 2.4a dataset. Source ages in kyr before 2000 are converted to ka BP by subtracting 0.05. Duplicate ages are averaged only when constructing the interpolation knots. PaleoVeg does not extrapolate beyond the dataset's −0.069 to 805.669 ka BP range.

Data source: Ahn, J. (2023), Chapter 2 of the Working Group I Contribution to the IPCC Sixth Assessment Report – data for Figure 2.4 (v20221219), NERC EDS Centre for Environmental Data Analysis, doi:10.5285/60eeb3cce51a457cb5ee1c577a0c8674, licensed under CC BY 4.0. See paleoveg/data/co2/README.md for transformation and attribution details.

Vegetation Type Competition Factor
Evergreen Needleleaf Forest 0.28
Evergreen Broadleaf Forest 0.73
Deciduous Needleleaf Forest 0.20
Deciduous Broadleaf Forest 0.76
Mixed Forest 1.00
Closed Shrubland 1.66
Open Shrubland 1.66
Woodland 1.62
Wooded Grassland 1.62
Grassland 1.69
Bare Ground 1.15

Citation and reuse

If you use PaleoVeg in research, please cite:

Schlüter, P. (2026). PaleoVeg (v1.0.0) [Software]. Zenodo. https://doi.org/10.5281/zenodo.15222519

Machine-readable citation metadata is provided in CITATION.cff. PaleoVeg can be reused under the terms of the MIT License.


License

This project is licensed under the MIT License.


Contributing

Contributions are welcome! Please submit a pull request or open an issue if you have suggestions or find bugs.


Metadata

Release files for PaleoVeg 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PaleoVeg 1.0.0
File Size Uploaded Provenance Actions
paleoveg-1.0.0.tar.gz 83.3 kB With provenance Details for paleoveg-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for PaleoVeg 1.0.0
File Interpreter ABI Platform Actions
paleoveg-1.0.0-py3-none-any.whl Python 3 none any Details for paleoveg-1.0.0-py3-none-any.whl

Total release size: 119.4 kB

Release files / paleoveg-1.0.0.tar.gz

Download URL paleoveg-1.0.0.tar.gz
Size 83.3 kB
Tags Source
SHA-256 checksum
How to use checksums
651989fcef54d0159bc349e738ff92a727966cf6b21b79bcf05a8f572f9220ab
BLAKE2b-256 checksum
How to use checksums
a8394443bf05e0768b4d0d56b33d9ef148099c8b80d4d426fa40cfdefd11f32b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Release files / paleoveg-1.0.0-py3-none-any.whl

Download URL paleoveg-1.0.0-py3-none-any.whl
Size 36.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
32ca47c06b3ff7d147d4deb40acb8d8d7302998d9976e11ec846fa5daf78c798
BLAKE2b-256 checksum
How to use checksums
2baa89b64c642839806c2589a3da98300cbe445a0ad8c129f401ba5ef40aea4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Security for PaleoVeg 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for paleoveg-1.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page