Skip to main content

HESTIA Engine Models

Pipeline Status Coverage Report

HESTIA's set of models for running calculations or retrieving data using external datasets and internal lookups.

Documentation

Documentation for every model can be found in the HESTIA Guide.

Install

  1. Install python 3.12 minimum
  2. Install the module:
pip install hestia_earth.models

Usage

from hestia_earth.models.pooreNemecek2018 import run

cycle_data = {"@type": "Cycle", ...}
# cycle is a JSONLD node Cycle
result = run('no3ToGroundwaterSoilFlux', cycle_data)
print(result)

This will display only the result of the no3ToGroundwaterSoilFlux model (Emission).

Additionally, to reduce the number of queries to the HESTIA API and run the models faster, prefetching can be enabled:

from hestia_earth.models.preload_requests import enable_preload

enable_preload()

Using the orchestrator

The models come with an "orchestrator", which allows you to run a pre-configured set of models instead of a single one.

The configuration for each Node (Cycle, Site or ImpactAssessment) can be found in the config folder.

Usage:

from hestia_earth.orchestrator import run
from hestia_earth.models.config import load_config

cycle = {"@type": "Cycle", ...}
result = run(cycle, load_config(cycle))
print(result)

This will display the Cycle recalculated with all HESTIA default models running.

Using Spatial Models

We have models that can gap-fill geographical information on a Site. If you want to use these models:

  1. Install the library: pip install hestia-earth-earth-engine
  2. Follow the Getting Started instructions.

Disabling the standardised drought indices

The SPEI and SPI models run by default. Set the env variable ENABLE_DROUGHT_INDEX to false to turn them off.

They are fitted over a fixed climate reference period (1979-2020), so they also fetch precipitationMonthly and potentialEvapotranspirationMonthly over that period rather than over the Site's own years only - four decades of monthly values per Site. Turning them off restores the narrower window, which is the reason to do it on a self-hosted run.

Collecting logs in JSON format

:info: This is an experimental feature and is not yet integrated in all the HESTIA tools.

To collect logs in JSON format:

  1. Set the env variable LOG_JSON_ENABLED to true
  2. Use the following code to collect contribution logs:
from hestia_earth.orchestrator import run
from hestia_earth.models.config import load_config
from hestia_earth.models.jlog import reset_collected_logs, get_collected_logs

# make sure the logs are reset before each run
reset_collected_logs()

# run the models as usual
impact = {"@type": "ImpactAssessment", ...}
result = run(impact, load_config(impact))
print(result)

# write the logs to a JSON file
logs = get_collected_logs()
with open("logs.json", "w") as f:
    f.write(to_string(logs, indent=2))

When a node is recalculated in separate passes (e.g. stage 1 then stage 2 in different processes), seed the later pass with the earlier one's logs so stage-1-only placements are not lost:

from hestia_earth.models.jlog import load_collected_logs, get_collected_logs

# stage 2: load the logs collected during stage 1, then run stage 2 as usual
load_collected_logs(stage1_logs)
result = run(impact, load_config(impact), stage=2)
logs = get_collected_logs()  # contains both stage 1 and stage 2

Collecting contribution data

:info: This is an experimental feature and is not yet integrated in all the HESTIA tools.

To collect contribution data of impacts/endpoints on ImpactAssessment:

  1. Set the env variable LOG_CONTRIBUTION_ENABLED to true
  2. Use the following code to collect contribution logs:
from hestia_earth.orchestrator import run
from hestia_earth.models.config import load_config
from hestia_earth.models.log_contribution import reset_contributions, get_contributions

# make sure the contributions are reset before each run
reset_contributions()

# run the models as usual
impact = {"@type": "ImpactAssessment", ...}
result = run(impact, load_config(impact))
print(result)

# write the contributions to a JSON file
contributions = get_contributions()
with open("contributions.json", "w") as f:
    f.write(to_string(contributions, indent=2))

The contribution data will store the factors used for each emissionsResourceUse that contributes to specific impacts, and likewise impacts that contribute to endpoints. The index in the data represents the index of the blank node in the list of contributing blank nodes.

Using the ecoinventV3 model

⚠️ This model has been deprecated and no further support will be provided.

ecoinvent is a consistent, transparent, and well validated life cycle inventory database. We use ecoinvent data to ascertain the environmental impacts of activities that occur outside of our system boundary, for example data on the environmental impacts of extracting oil and producing diesel, or the impacts of manufacturing plastics.

The ecoinventV3 model requires a valid license to run. We are currently working on a way to enable users of this code with a valid ecoinvent licence to run these models themselves, but for now, these models are only available on the public platform.

Amortising Land Use Change Emissions Using Linear Discounting

In compliance with Land Sector and Removals Standard & Guidance set by the Greenhouse Gas Protocol (2026), HESTIA amortises LUC emissions using linear discounting by default.

On the main HESTIA platform, we have chosen to amortise emissions using linear discounting, and this cannot be changed. The amortisation method can only be changed on the Community Edition.

For more information, see our guide page on linear discounting.

To opt-out of linear discounting on the Community Edition, and revert to amortising emissions using equal apportioning:

  1. Set the env variable USE_LINEAR_DISCOUNTING to false

TypeScript / JavaScript package

The model metadata is also published to npm as @hestia-earth/engine-models:

npm install @hestia-earth/engine-models

It exposes the links between models, terms and their documentation (model-links.json), and the KaTeX formulas extracted from each model, with bindings that map every symbol to a value logged at runtime (the "jlog"):

import { getFormulas } from '@hestia-earth/engine-models';

getFormulas({ model: 'ipcc2019', term: 'ch4ToAirEntericFermentation' });
// => [ { formula: 'E_{CH4} = (GE \\times Y_m) / 55.65', bindings: [...] } ]

See formulas/README.md for the full guide on getting a model's formulas, rendering them with KaTeX, and substituting the symbols with the values from a given execution.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hestia_earth_models-0.87.6.tar.gz (500.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hestia_earth_models-0.87.6-py3-none-any.whl (932.6 kB view details)

Uploaded Python 3

File details

Details for the file hestia_earth_models-0.87.6.tar.gz.

File metadata

  • Download URL: hestia_earth_models-0.87.6.tar.gz
  • Upload date:
  • Size: 500.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.14

File hashes

Hashes for hestia_earth_models-0.87.6.tar.gz
Algorithm Hash digest
SHA256 b9e0950d0f493c89b4780eb2035fc7c8926544ce49d1af7f8c6b3907e2796a9e
MD5 9d1c2ccbe78e1ff4ee3cd0be1c44271d
BLAKE2b-256 bd82af33c0b2a8caebc07a623654bc173332a5f1eb1f8161fd49ac139b3c619b

See more details on using hashes here.

File details

Details for the file hestia_earth_models-0.87.6-py3-none-any.whl.

File metadata

File hashes

Hashes for hestia_earth_models-0.87.6-py3-none-any.whl
Algorithm Hash digest
SHA256 64f9944946d560eead0c0ae396a346bd872144867ac5ad02c40771f9762b9d42
MD5 58697367129d5d8877638a801897a5a6
BLAKE2b-256 fe1ee3191d473dbd5baab8367c8ad2c5df189a61a7a3e0b1c2e8a6783cbffb73

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.87.6 This release

2 files

0.87.5

2 files

0.87.4

2 files

0.87.3

2 files

0.87.1

2 files

0.87.0

2 files

0.86.3

2 files

0.86.2

2 files

0.86.1

2 files

0.86.0

2 files

0.85.4

2 files

0.85.3

2 files

0.85.2

2 files

0.85.1

2 files

0.85.0

2 files

0.84.0

2 files

0.83.2

2 files

0.83.1

2 files

0.83.0

2 files

0.82.2

2 files

0.82.1

2 files

0.82.0

2 files

0.81.6

2 files

0.81.5

2 files

0.81.4

2 files

0.81.3

2 files

0.81.2

2 files

0.81.1

2 files

0.81.0

2 files

0.80.0

2 files

0.79.7

2 files

0.79.6

2 files

0.79.5

2 files

0.79.4

2 files

0.79.3

2 files

0.79.2.post1

2 files

0.79.2

2 files

0.79.1

2 files

0.79.0

2 files

0.78.2

2 files

0.78.1

2 files

0.78.0

2 files

0.77.1

2 files

0.77.0

2 files

0.76.10

2 files

0.76.9

2 files

0.76.8

2 files

0.76.7

2 files

0.76.6

2 files

0.76.5

2 files

0.76.4

2 files

0.76.3

2 files

0.76.2

2 files

0.76.1

2 files

0.76.0

2 files

0.75.19

2 files

0.75.18

2 files

0.75.17

2 files

0.75.16

2 files

0.75.15

2 files

0.75.14

2 files

0.75.13

2 files

0.75.12

2 files

0.75.11

2 files

0.75.10

2 files

0.75.9

2 files

0.75.8

2 files

0.75.7

2 files

0.75.6

2 files

0.75.5

2 files

0.75.4

2 files

0.75.3

2 files

0.75.2

2 files

0.75.1

2 files

0.75.0

2 files

0.74.17

2 files

0.74.16

2 files

0.74.15

2 files

0.74.14

2 files

0.74.13

2 files

0.74.12

2 files

0.74.11

2 files

0.74.10

2 files

0.74.9

2 files

0.74.8

2 files

0.74.7

2 files

0.74.6

2 files

0.74.5

2 files

0.74.4

2 files

0.74.3

2 files

0.74.2

2 files

0.74.1

2 files

0.74.0

2 files

0.73.8

2 files

0.73.7

2 files

0.73.6

2 files

0.73.5

2 files

0.73.4

2 files

0.73.3

2 files

0.73.2

2 files

0.73.1

2 files

0.73.0

2 files

0.72.2

2 files

0.72.1

2 files

0.72.0

2 files

0.71.0

2 files

0.70.6

2 files

0.70.5

2 files

0.70.4

2 files

0.70.3

2 files

0.70.2

2 files

0.70.1

2 files

0.70.0

2 files

0.69.1

2 files

0.69.0

2 files

0.68.1

2 files

0.68.0

2 files

0.67.1

2 files

0.67.0

2 files

0.66.0

2 files

0.65.11

2 files

0.65.10

2 files

0.65.9

2 files

0.65.8

2 files

0.65.7

2 files

0.65.6

2 files

0.65.5

2 files

0.65.4

2 files

0.65.3

2 files

0.65.2

2 files

0.65.1

2 files

0.65.0

2 files

0.64.14

2 files

0.64.13

2 files

0.64.12

2 files

0.64.11

2 files

0.64.10

2 files

0.64.9

2 files

0.64.8

2 files

0.64.7

2 files

0.64.6

2 files

0.64.5

2 files

0.64.4

2 files

0.64.3

2 files

0.64.2

2 files

0.64.1

2 files

0.64.0

2 files

0.63.0

2 files

0.62.6

2 files

0.62.5

2 files

0.62.4

2 files

0.62.3

2 files

0.62.2

2 files

0.62.1

2 files

0.62.0

2 files

0.61.8

2 files

0.61.7

2 files

0.61.6

2 files

0.61.5

2 files

0.61.4

2 files

0.61.3

2 files

0.61.2

2 files

0.61.1

2 files

0.61.0

2 files

0.60.1

2 files

0.60.0

2 files

0.59.7

2 files

0.59.6

2 files

0.59.5

2 files

0.59.4

2 files

0.59.3

2 files

0.59.2

2 files

0.59.1

2 files

0.59.0

2 files

0.58.0

2 files

0.57.2

2 files

0.57.1

2 files

0.57.0

2 files

0.56.2

2 files

0.56.1

2 files

0.56.0

2 files

0.55.0

2 files

0.54.3

2 files

0.54.2

2 files

0.54.1

2 files

0.54.0

2 files

0.53.12

2 files

0.53.11

2 files

0.53.10

2 files

0.53.9

2 files

0.53.8

2 files

0.53.7

2 files

0.53.6

2 files

0.53.5

2 files

0.53.4

2 files

0.53.3

2 files

0.53.2

2 files

0.53.1

2 files

0.53.0

2 files

0.52.0

2 files

0.51.1

2 files

0.51.0

2 files

0.50.0

2 files

0.49.0

2 files

0.48.0

2 files

0.47.5

2 files

0.47.4

2 files

0.47.3

2 files

0.47.2

2 files

0.47.1

2 files

0.47.0

2 files

0.46.4

2 files

0.46.3

2 files

0.46.2

2 files

0.46.1

2 files

0.46.0

2 files

0.45.0

2 files

0.44.7

2 files

0.44.6

2 files

0.44.5

2 files

0.44.4

2 files

0.44.3

2 files

0.44.2

2 files

0.44.1

2 files

0.44.0

2 files

0.43.0

2 files

0.42.0

2 files

0.41.2

2 files

0.41.1

2 files

0.41.0

2 files

0.40.1

2 files

0.40.0

2 files

0.39.1

2 files

0.39.0

2 files

0.38.0

2 files

0.37.0

2 files

0.36.2

2 files

0.36.1

2 files

0.36.0

2 files

0.35.1

2 files

0.35.0

2 files

0.34.1

2 files

0.34.0

2 files

0.33.0

2 files

0.32.2

2 files

0.32.1

2 files

0.32.0

2 files

0.31.0

2 files

0.30.2

2 files

0.30.1

2 files

0.30.0

2 files

0.29.0

2 files

0.28.0

2 files

0.27.4

2 files

0.27.3

2 files

0.27.2

2 files

0.27.1

2 files

0.27.0

2 files

0.26.0

2 files

0.25.3

2 files

0.25.2

2 files

0.25.1

2 files

0.25.0

2 files

0.24.11

2 files

0.24.10

2 files

0.24.9

2 files

0.24.8

2 files

0.24.7

2 files

0.24.6

2 files

0.24.5

2 files

0.24.4

2 files

0.24.3

2 files

0.24.2

2 files

0.24.1

2 files

0.24.0

2 files

0.23.1

2 files

0.23.0

2 files

0.22.4

2 files

0.22.3

2 files

0.22.2

2 files

0.22.1

2 files

0.22.0

2 files

0.21.1

2 files

0.21.0

2 files

0.20.1

2 files

0.20.0

2 files

0.19.2

2 files

0.19.1

2 files

0.19.0

2 files

0.18.3

2 files

0.18.2

2 files

0.18.1

2 files

0.18.0

2 files

0.17.15

2 files

0.17.14

2 files

0.17.13

2 files

0.17.12

2 files

0.17.11

2 files

0.17.10

2 files

0.17.9

2 files

0.17.8

2 files

0.17.7

2 files

0.17.6

2 files

0.17.5

2 files

0.17.4

2 files

0.17.3

2 files

0.17.2

2 files

0.17.1

2 files

0.17.0

2 files

0.16.0

2 files

0.15.2

2 files

0.15.1

2 files

0.15.0

2 files

0.14.3

2 files

0.14.2

2 files

0.14.1

2 files

0.14.0

2 files

0.13.0

2 files

0.12.3

2 files

0.12.2

2 files

0.12.1

2 files

0.12.0

2 files

0.11.5

2 files

0.11.4

2 files

0.11.3

2 files

0.11.2

2 files

0.11.1

2 files

0.11.0

2 files

0.10.1

2 files

0.10.0

2 files

0.9.1

2 files

0.9.0

2 files

0.8.8

2 files

0.8.7

2 files

0.8.6

2 files

0.8.5

2 files

0.8.4

2 files

0.8.3

2 files

0.8.2

2 files

0.8.1

2 files

0.8.0

2 files

0.7.2

2 files

0.7.1

2 files

0.7.0

2 files

0.6.1

2 files

0.6.0

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 files

0.0.8

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

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