LIFE

Implementation of the methodology for the Eyres et al LIFE biodiversity metric.
https://github.com/quantifyearth/life

Category: Biosphere
Sub Category: Biodiversity Analysis and Metrics

Keywords

aoh biodiversity ecology extinction

Last synced: about 16 hours ago
JSON representation

Repository metadata

Implementation of the methodology for the Eyres et al LIFE biodiversity metric

README.md

LIFE implementation

This repository implements the LIFE extinction risk methodology as published in Eyres et al. The code will generate maps that cover the impact to extinction risk in an area under the two scenarios: conversion of the land to arable use, and coversion of the land to pre-human.

Running the code

The methodology is explained in more detail in method.md. The pipeline is implemented as a Snakemake workflow in workflow/.

Prerequisites

The following tools must be available on PATH:

  • reclaimer — downloads inputs from Zenodo (quantifyearth/reclaimer)
  • aoh-calc, aoh-habitat-process, aoh-collate-data, aoh-species-richness, aoh-endemism, aoh-validate-prevalence — from the aoh Python package
  • gdalwarp — part of GDAL

The following environment variables must be set:

Variable Purpose
DATADIR Root directory for all input/output data
DB_HOST, DB_NAME, DB_USER, DB_PASSWORD PostgreSQL credentials for IUCN species database

For GBIF occurrence validation (optional):

Variable Purpose
GBIF_USERNAME, GBIF_EMAIL, GBIF_PASSWORD GBIF account credentials

Running the pipeline

# Full pipeline: delta P maps for all scenarios + model validation
snakemake --cores N all

# Delta P maps only, without validation
snakemake --cores N life

# Species richness and endemism maps (not included in 'all')
snakemake --cores N summaries

# Model validation only
snakemake --cores N validation

# GBIF occurrence validation (expensive — downloads gigabytes of data)
snakemake --cores N occurrence_validation

Other useful targets for incremental runs:

snakemake --cores N prepare       # Download and warp all base layers
snakemake --cores N species_data  # Extract species data from the database
snakemake --cores N aohs          # Generate all AOH rasters and collated CSVs

Precious layers

The habitat and elevation layers are expensive to generate and are treated as precious: they will only be rebuilt if their output files are explicitly deleted, even if upstream inputs or code have changed. This applies to:

  • habitat_layers/current/ — food-enhanced current habitat map at ~1.67km resolution
  • habitat_layers/{scenario}/ — per-scenario fractional habitat maps
  • habitat_layers/pnv/ — potential natural vegetation fractional maps
  • elevation-max.tif, elevation-min.tif — warped elevation layers

To force a rebuild of any of these, delete the relevant .sentinel file (or the output file itself) before re-running.

Configuration

Pipeline parameters are in config/config.yaml:

  • taxa — taxonomic classes to process (default: AMPHIBIA, AVES, MAMMALIA, REPTILIA)
  • scenarios — habitat change scenarios to evaluate (default: arable, restore)
  • curve — extinction curve exponent for delta P (default: "0.25")
  • pixel_scale — output raster resolution in degrees (default: ~5 arc-seconds)

Inspecting the pipeline graph

The rule graph can be generated with:

snakemake --forceall --rulegraph 2>/dev/null | dot -Tsvg > graph.svg

Note that rules whose inputs are determined by the species-extraction checkpoint (generate_aoh, calculate_delta_p) will not appear in the static rule graph — this is a known snakemake limitation with checkpoint-based expansion. To see the complete job graph after species data has been extracted:

snakemake --forceall --dag 2>/dev/null | unflatten -f -l 5 | dot -Tsvg > dag.svg

Credits

Originally derived from and using IUCN modlib and aoh lib by Daniele Baisero.


Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 9 days ago

Total Commits: 278
Total Committers: 6
Avg Commits per committer: 46.333
Development Distribution Score (DDS): 0.115

Commits in past year: 72
Committers in past year: 3
Avg Commits per committer in past year: 24.0
Development Distribution Score (DDS) in past year: 0.139

Name Email Commits
Michael Dales m****4@c****k 246
mwd24 m****4@c****k 23
alieyres a****s@g****m 3
Ali a****1@c****k 3
thomasball42 t****2@c****k 2
Miranda Black M****k@o****m 1

Committer domains:


Issue and Pull Request metadata

Last synced: 20 days ago

Total issues: 6
Total pull requests: 17
Average time to close issues: over 1 year
Average time to close pull requests: 7 days
Total issue authors: 2
Total pull request authors: 1
Average comments per issue: 1.83
Average comments per pull request: 0.0
Merged pull request: 15
Bot issues: 0
Bot pull requests: 0

Past year issues: 1
Past year pull requests: 12
Past year average time to close issues: 17 days
Past year average time to close pull requests: 10 days
Past year issue authors: 1
Past year pull request authors: 1
Past year average comments per issue: 1.0
Past year average comments per pull request: 0.0
Past year merged pull request: 10
Past year bot issues: 0
Past year bot pull requests: 0

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

Top Issue Authors

  • alieyres (4)
  • mdales (2)

Top Pull Request Authors

  • mdales (17)

Top Issue Labels

Top Pull Request Labels

  • 🏗️ enhancement (1)

Dependencies

.github/workflows/python-package.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v3 composite
Dockerfile docker
  • ghcr.io/osgeo/gdal ubuntu-small-3.6.4 build
  • golang bullseye build
requirements.txt pypi
  • alive-progress *
  • gdal ==3.9.3
  • geopandas *
  • mypy *
  • numpy <2
  • pandas *
  • pandas-stubs *
  • postgis *
  • psutil *
  • psycopg2 *
  • pyarrow *
  • pylint *
  • pyproj *
  • pytest *
  • rasterio *
  • requests *
  • scikit-image *
  • scipy *
  • types-requests *

Score: 3.8712010109078907