elapid

Species distribution modeling tools, including a Python implementation of Maxent.
https://github.com/earth-chris/elapid

Category: Biosphere
Sub Category: Species Distribution Modeling

Keywords

biodiversity-informatics biogeography geospatial maxent niche-modelling species-distribution-modelling

Keywords from Contributors

conservation ecology spectral-unmixing california wildfire

Last synced: about 12 hours ago
JSON representation

Repository metadata

Species distribution modeling tools, including a python implementation of Maxent

README.md

GitHub
PyPI version
Anaconda version
PyPI downloads
GitHub last commit
DOI


Documentation: earth-chris.github.io/elapid

Source code: earth-chris/elapid


🐍 Introduction

elapid is a series of species distribution modeling tools for python. This includes a custom implementation of Maxent and a suite of methods to simplify working with biogeography data.

The name is an homage to A Biogeographic Analysis of Australian Elapid Snakes (H.A. Nix, 1986), the paper widely credited with defining the essential bioclimatic variables to use in species distribution modeling. It's also a snake pun (a python wrapper for mapping snake biogeography).


🌱 Installation

pip install elapid or conda install -c conda-forge elapid

Installing glmnet is optional, but recommended where it can be installed. The pip path for glmnet is currently broken on modern Python; use conda install -c conda-forge elapid glmnet instead, or the bundled pixi run -e dev-glmnet ... env. For more details, see this page.

The conda install is recommended for Windows users. While there is a pip distribution, you may experience some challenges. The easiest way to overcome them is to use Windows Subsystem for Linux (WSL). Otherwise, see this page for support.


🌳 Why use elapid?

The amount and quality of bioegeographic data has increased dramatically over the past decade, as have cloud-based tools for working with it. elapid was designed to provide a set of modern, python-based tools for working with species occurrence records and environmental covariates to map different dimensions of a species' niche.

elapid supports working with modern geospatial data formats and uses contemporary approaches to training statistical models. It uses sklearn conventions to fit and apply models, rasterio to handle raster operations, geopandas for vector operations, and processes data under the hood with numpy.

This makes it easier to do things like fit/apply models to multi-temporal and multi-scale data, fit geographically-weighted models, create ensembles, precisely define background point distributions, and summarize model predictions.

It does the following things reasonably well:

🌐 Point sampling

Select random geographic point samples (aka background or pseudoabsence points) within polygons or rasters, handling nodata locations, as well as sampling from bias maps (using elapid.sample_raster(), elapid.sample_vector(), or elapid.sample_bias_file()).

📈 Vector annotation

Extract and annotate point data from rasters, creating GeoDataFrames with sample locations and their matching covariate values (using elapid.annotate()). On-the-fly reprojection, dropping nodata, multi-band inputs and multi-file inputs are all supported.

📊 Zonal statistics

Calculate zonal statistics from multi-band, multi-raster data into a single GeoDataFrame from one command (using elapid.zonal_stats()).

🐛 Feature transformations

Transform covariate data into derivative features to expand data dimensionality and improve prediction accuracy (like elapid.ProductTransformer(), elapid.HingeTransformer(), or the all-in-one elapid.MaxentFeatureTransformer()).

🐦 Species distribution modeling

Train and apply species distribution models based on annotated point data, configured with sensible defaults (like elapid.MaxentModel() and elapid.NicheEnvelopeModel()).

📡 Training spatially-aware models

Compute spatially-explicit sample weights, checkerboard train/test splits, or geographically-clustered cross-validation splits to reduce spatial autocorellation effects (with elapid.distance_weights(), elapid.checkerboard_split() and elapid.GeographicKFold()).

🌏 Applying models to rasters

Apply any pixel-based model with a .predict() method to raster data to easily create prediction probability maps (like training a RandomForestClassifier() and applying with elapid.apply_model_to_rasters()).

☁️ Cloud-native geo support

Work with cloud- or web-hosted raster/vector data (on https://, gs://, s3://, etc.) to keep your disk free of temporary files.

Check out some example code snippets and workflows on the Working with Geospatial Data page.


🐍 elapid requires some effort on the user's part to draw samples and extract covariate data. This is by design.

Selecting background samples, computing sample weights, splitting train/test data, and specifying training parameters are all critical modeling choices that have profound effects on inference and interpretation.

The extra flexibility provided by elapid enables more control over the seemingly black-box approach of Maxent, enabling users to better tune and evaluate their models.


How to cite

BibTeX:

@article{
  Anderson2023,
  title = {elapid: Species distribution modeling tools for Python}, journal = {Journal of Open Source Software}
  author = {Christopher B. Anderson},
  doi = {10.21105/joss.04930},
  url = {https://doi.org/10.21105/joss.04930},
  year = {2023},
  publisher = {The Open Journal},
  volume = {8},
  number = {84},
  pages = {4930},
}

Or click "Cite this repository" on the GitHub page.


Developed by

Christopher Anderson[^1] [^2]

Twitter Follow
GitHub Stars

[^1]: Earth Observation Lab, Planet Labs PBC
[^2]: Center for Conservation Biology, Stanford University

Citation (CITATION.cff)

cff-version: "1.2.0"
authors:
- family-names: Anderson
  given-names: Christopher B.
  orcid: "https://orcid.org/0000-0001-7392-4368"
doi: 10.5281/zenodo.7813017
message: If you use this software, please cite our article in the
  Journal of Open Source Software.
preferred-citation:
  authors:
  - family-names: Anderson
    given-names: Christopher B.
    orcid: "https://orcid.org/0000-0001-7392-4368"
  date-published: 2023-04-19
  doi: 10.21105/joss.04930
  issn: 2475-9066
  issue: 84
  journal: Journal of Open Source Software
  publisher:
    name: Open Journals
  start: 4930
  title: "elapid: Species distribution modeling tools for Python"
  type: article
  url: "https://joss.theoj.org/papers/10.21105/joss.04930"
  volume: 8
title: "elapid: Species distribution modeling tools for Python"

Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 4 days ago

Total Commits: 410
Total Committers: 3
Avg Commits per committer: 136.667
Development Distribution Score (DDS): 0.007

Commits in past year: 5
Committers in past year: 3
Avg Commits per committer in past year: 1.667
Development Distribution Score (DDS) in past year: 0.6

Name Email Commits
earth-chris c****a@s****i 407
Harry Horsley h****9@g****m 2
Thomas Maschler t****r@p****m 1

Committer domains:


Issue and Pull Request metadata

Last synced: 9 days ago

Total issues: 40
Total pull requests: 75
Average time to close issues: 4 months
Average time to close pull requests: 10 days
Total issue authors: 9
Total pull request authors: 6
Average comments per issue: 1.05
Average comments per pull request: 0.36
Merged pull request: 70
Bot issues: 0
Bot pull requests: 0

Past year issues: 2
Past year pull requests: 5
Past year average time to close issues: 1 day
Past year average time to close pull requests: about 1 month
Past year issue authors: 2
Past year pull request authors: 2
Past year average comments per issue: 1.5
Past year average comments per pull request: 1.6
Past year merged pull request: 5
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/earth-chris/elapid

Top Issue Authors

  • earth-chris (28)
  • gabrieldansereau (5)
  • jeffreysmith-jrs (1)
  • bweeding (1)
  • aFewThings (1)
  • jcrangel (1)
  • outdoorCoding (1)
  • bobilong (1)
  • BachirNILU (1)

Top Pull Request Authors

  • earth-chris (67)
  • butterman0 (4)
  • osgeokr (1)
  • PC-FSU (1)
  • gabrieldansereau (1)
  • thomas-maschler (1)

Top Issue Labels

  • bug (16)
  • enhancement (12)
  • documentation (11)
  • low priority (7)
  • high priority (4)
  • help wanted (1)
  • science (1)

Top Pull Request Labels

  • enhancement (28)
  • documentation (20)
  • bug (14)
  • science (3)
  • low priority (1)
  • high priority (1)

Package metadata

proxy.golang.org: github.com/earth-chris/elapid

pypi.org: elapid

Species distribution modeling tools

  • Homepage: https://github.com/earth-chris/elapid
  • Documentation: https://earth-chris.github.io/elapid/
  • Licenses: MIT
  • Latest release: 1.0.4 (published 10 days ago)
  • Last Synced: 2026-06-18T17:00:41.578Z (4 days ago)
  • Versions: 28
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 1,472 Last month
  • Rankings:
    • Dependent packages count: 10.108%
    • Average: 16.401%
    • Downloads: 17.513%
    • Dependent repos count: 21.581%
  • Maintainers (1)
conda-forge.org: elapid

  • Homepage: https://elapid.org
  • Licenses: MIT
  • Latest release: 0.3.18 (published over 3 years ago)
  • Last Synced: 2026-04-01T13:28:26.734Z (3 months ago)
  • Versions: 4
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 17,813 Total
  • Rankings:
    • Dependent repos count: 34.025%
    • Average: 48.037%
    • Stargazers count: 49.578%
    • Dependent packages count: 51.175%
    • Forks count: 57.37%

Dependencies

.github/workflows/deploy-docs.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
.github/workflows/os-tests.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
.github/workflows/publish-pypi.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • pypa/gh-action-pypi-publish release/v1 composite
.github/workflows/run-pytest.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
pyproject.toml pypi
  • descartes >=1.1 develop
  • ipython >=8.0 develop
  • jupyter >=1.0 develop
  • mkdocs-jupyter >=0.24 develop
  • mkdocs-material >=9.5 develop
  • mkdocstrings >=0.25 develop
  • pre-commit >=3.0 develop
  • pytest >=8.3 develop
  • pytest-cov >=5.0 develop
  • pytest-xdist >=3.6 develop
  • geopandas >=1.0
  • matplotlib >=3.7
  • numpy >=2.0
  • pandas >=1.0.3,<3.0
  • pyproj >3.0
  • python >=3.9
  • rasterio >=1.2.1
  • rtree >=0.9
  • scikit-learn >=1.2,<1.6
  • scipy >=1.13
  • tqdm >=4.60

Score: 15.269863954682076