hestia-earth-models 0.67.1__py3-none-any.whl → 0.68.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hestia_earth/models/aware/scarcityWeightedWaterUse.py +5 -6
- hestia_earth/models/blonkConsultants2016/ch4ToAirNaturalVegetationBurning.py +1 -1
- hestia_earth/models/blonkConsultants2016/co2ToAirAboveGroundBiomassStockChangeLandUseChange.py +1 -1
- hestia_earth/models/blonkConsultants2016/n2OToAirNaturalVegetationBurningDirect.py +1 -1
- hestia_earth/models/blonkConsultants2016/utils.py +9 -9
- hestia_earth/models/cache_sites.py +44 -23
- hestia_earth/models/chaudharyBrooks2018/damageToTerrestrialEcosystemsLandOccupation.py +2 -2
- hestia_earth/models/chaudharyBrooks2018/damageToTerrestrialEcosystemsLandTransformation.py +2 -2
- hestia_earth/models/chaudharyBrooks2018/utils.py +13 -8
- hestia_earth/models/cml2001Baseline/abioticResourceDepletionFossilFuels.py +2 -3
- hestia_earth/models/cml2001Baseline/abioticResourceDepletionMineralsAndMetals.py +1 -1
- hestia_earth/models/config/Cycle.json +15 -0
- hestia_earth/models/config/ImpactAssessment.json +14 -1
- hestia_earth/models/config/Site.json +8 -0
- hestia_earth/models/cycle/excretaKgMass.py +2 -2
- hestia_earth/models/cycle/materialAndSubstrate.py +3 -2
- hestia_earth/models/cycle/pastureGrass.py +3 -3
- hestia_earth/models/dammgen2009/noxToAirExcreta.py +1 -1
- hestia_earth/models/ecoinventV3AndEmberClimate/__init__.py +1 -1
- hestia_earth/models/ecoinventV3AndEmberClimate/utils.py +2 -6
- hestia_earth/models/emissionNotRelevant/__init__.py +4 -4
- hestia_earth/models/environmentalFootprintV3_1/environmentalFootprintSingleOverallScore.py +30 -21
- hestia_earth/models/environmentalFootprintV3_1/photochemicalOzoneCreationPotentialHumanHealthNmvocEq.py +36 -0
- hestia_earth/models/environmentalFootprintV3_1/scarcityWeightedWaterUse.py +2 -2
- hestia_earth/models/environmentalFootprintV3_1/soilQualityIndexLandOccupation.py +9 -8
- hestia_earth/models/environmentalFootprintV3_1/soilQualityIndexLandTransformation.py +25 -22
- hestia_earth/models/environmentalFootprintV3_1/soilQualityIndexTotalLandUseEffects.py +7 -6
- hestia_earth/models/faostat2018/coldCarcassWeightPerHead.py +2 -2
- hestia_earth/models/faostat2018/coldDressedCarcassWeightPerHead.py +2 -2
- hestia_earth/models/faostat2018/liveweightPerHead.py +7 -8
- hestia_earth/models/faostat2018/product/price.py +34 -28
- hestia_earth/models/faostat2018/readyToCookWeightPerHead.py +2 -2
- hestia_earth/models/faostat2018/utils.py +15 -27
- hestia_earth/models/frischknechtEtAl2000/ionisingRadiationKbqU235Eq.py +16 -9
- hestia_earth/models/geospatialDatabase/altitude.py +60 -0
- hestia_earth/models/geospatialDatabase/croppingIntensity.py +1 -1
- hestia_earth/models/geospatialDatabase/ecoClimateZone.py +2 -2
- hestia_earth/models/geospatialDatabase/longFallowRatio.py +1 -1
- hestia_earth/models/geospatialDatabase/utils.py +4 -1
- hestia_earth/models/globalCropWaterModel2008/rootingDepth.py +2 -3
- hestia_earth/models/haversineFormula/transport/distance.py +3 -3
- hestia_earth/models/hestia/landCover.py +72 -45
- hestia_earth/models/hestia/seed_emissions.py +11 -7
- hestia_earth/models/impact_assessment/__init__.py +3 -3
- hestia_earth/models/ipcc2019/animal/fatContent.py +1 -1
- hestia_earth/models/ipcc2019/animal/hoursWorkedPerDay.py +1 -1
- hestia_earth/models/ipcc2019/animal/liveweightGain.py +1 -1
- hestia_earth/models/ipcc2019/animal/liveweightPerHead.py +1 -1
- hestia_earth/models/ipcc2019/animal/milkYieldPerAnimal.py +1 -1
- hestia_earth/models/ipcc2019/animal/pastureGrass.py +1 -1
- hestia_earth/models/ipcc2019/animal/pregnancyRateTotal.py +1 -1
- hestia_earth/models/ipcc2019/animal/trueProteinContent.py +1 -1
- hestia_earth/models/ipcc2019/animal/utils.py +5 -7
- hestia_earth/models/ipcc2019/animal/weightAtMaturity.py +1 -1
- hestia_earth/models/ipcc2019/ch4ToAirEntericFermentation.py +2 -2
- hestia_earth/models/ipcc2019/ch4ToAirExcreta.py +6 -7
- hestia_earth/models/ipcc2019/ch4ToAirFloodedRice.py +5 -3
- hestia_earth/models/ipcc2019/co2ToAirCarbonStockChange_utils.py +1 -1
- hestia_earth/models/ipcc2019/croppingDuration.py +3 -6
- hestia_earth/models/ipcc2019/nonCo2EmissionsToAirNaturalVegetationBurning.py +947 -0
- hestia_earth/models/ipcc2019/pastureGrass.py +1 -1
- hestia_earth/models/koble2014/residueBurnt.py +5 -7
- hestia_earth/models/koble2014/residueRemoved.py +5 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToHumanHealthWaterStress.py +2 -2
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToHumanHealthWaterStress.py +2 -2
- hestia_earth/models/lcImpactCertainEffects100Years/damageToHumanHealthWaterStress.py +2 -2
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToHumanHealthWaterStress.py +2 -2
- hestia_earth/models/log.py +1 -1
- hestia_earth/models/mocking/search-results.json +3397 -1097
- hestia_earth/models/site/management.py +1 -1
- hestia_earth/models/site/post_checks/__init__.py +3 -2
- hestia_earth/models/site/post_checks/country.py +9 -0
- hestia_earth/models/site/pre_checks/__init__.py +3 -2
- hestia_earth/models/site/pre_checks/country.py +9 -0
- hestia_earth/models/site/soilMeasurement.py +2 -0
- hestia_earth/models/utils/__init__.py +1 -16
- hestia_earth/models/utils/blank_node.py +25 -25
- hestia_earth/models/utils/completeness.py +3 -2
- hestia_earth/models/utils/cycle.py +5 -4
- hestia_earth/models/utils/emission.py +5 -5
- hestia_earth/models/utils/feedipedia.py +6 -6
- hestia_earth/models/utils/impact_assessment.py +1 -2
- hestia_earth/models/utils/indicator.py +9 -7
- hestia_earth/models/utils/inorganicFertiliser.py +4 -6
- hestia_earth/models/utils/input.py +6 -5
- hestia_earth/models/utils/lookup.py +32 -100
- hestia_earth/models/utils/management.py +4 -4
- hestia_earth/models/utils/measurement.py +7 -8
- hestia_earth/models/utils/method.py +20 -0
- hestia_earth/models/utils/practice.py +4 -5
- hestia_earth/models/utils/product.py +4 -5
- hestia_earth/models/utils/property.py +12 -22
- hestia_earth/models/utils/site.py +14 -8
- hestia_earth/models/utils/term.py +27 -1
- hestia_earth/models/version.py +1 -1
- hestia_earth/orchestrator/log.py +0 -11
- hestia_earth/orchestrator/models/__init__.py +17 -4
- hestia_earth/orchestrator/strategies/run/add_blank_node_if_missing.py +2 -20
- {hestia_earth_models-0.67.1.dist-info → hestia_earth_models-0.68.1.dist-info}/METADATA +2 -2
- {hestia_earth_models-0.67.1.dist-info → hestia_earth_models-0.68.1.dist-info}/RECORD +146 -138
- tests/models/cml2001Baseline/test_abioticResourceDepletionFossilFuels.py +3 -3
- tests/models/cml2001Baseline/test_resourceUseEnergyDepletionDuringCycle.py +1 -1
- tests/models/cycle/test_coldCarcassWeightPerHead.py +1 -1
- tests/models/cycle/test_coldDressedCarcassWeightPerHead.py +1 -1
- tests/models/cycle/test_concentrateFeed.py +1 -1
- tests/models/cycle/test_energyContentLowerHeatingValue.py +1 -1
- tests/models/cycle/test_excretaKgMass.py +1 -1
- tests/models/cycle/test_feedConversionRatio.py +3 -3
- tests/models/cycle/test_pastureGrass.py +1 -1
- tests/models/cycle/test_readyToCookWeightPerHead.py +1 -1
- tests/models/environmentalFootprintV3_1/test_photochemicalOzoneCreationPotentialHumanHealthNmvocEq.py +30 -0
- tests/models/environmentalFootprintV3_1/test_soilQualityIndexTotalLandUseEffects.py +30 -7
- tests/models/faostat2018/product/test_price.py +27 -14
- tests/models/faostat2018/test_faostat_utils.py +4 -24
- tests/models/faostat2018/test_liveweightPerHead.py +9 -9
- tests/models/globalCropWaterModel2008/test_rootingDepth.py +7 -3
- tests/models/haversineFormula/transport/test_distance.py +1 -1
- tests/models/hestia/test_landCover.py +53 -5
- tests/models/ipcc2019/animal/test_pastureGrass.py +5 -3
- tests/models/ipcc2019/test_aboveGroundCropResidueTotal.py +4 -4
- tests/models/ipcc2019/test_belowGroundCropResidue.py +4 -4
- tests/models/ipcc2019/test_ch4ToAirEntericFermentation.py +10 -10
- tests/models/ipcc2019/test_croppingDuration.py +1 -1
- tests/models/ipcc2019/test_nonCo2EmissionsToAirNaturalVegetationBurning.py +83 -0
- tests/models/ipcc2019/test_organicCarbonPerHa.py +12 -12
- tests/models/ipcc2019/test_pastureGrass.py +5 -3
- tests/models/pooreNemecek2018/test_excretaKgN.py +5 -5
- tests/models/pooreNemecek2018/test_excretaKgVs.py +2 -2
- tests/models/site/post_checks/test_country.py +6 -0
- tests/models/site/pre_checks/test_cache_geospatialDatabase.py +1 -1
- tests/models/site/pre_checks/test_country.py +12 -0
- tests/models/test_ecoinventV3.py +7 -3
- tests/models/utils/test_blank_node.py +4 -12
- tests/models/utils/test_dataCompleteness.py +5 -5
- tests/models/utils/test_emission.py +2 -2
- tests/models/utils/test_indicator.py +2 -2
- tests/models/utils/test_input.py +2 -2
- tests/models/utils/test_measurement.py +2 -4
- tests/models/utils/test_practice.py +4 -2
- tests/models/utils/test_product.py +2 -2
- tests/models/utils/test_property.py +4 -2
- tests/models/utils/test_site.py +7 -0
- tests/orchestrator/strategies/run/test_add_blank_node_if_missing.py +4 -9
- hestia_earth/models/environmentalFootprintV3_1/utils.py +0 -17
- tests/models/utils/test_lookup.py +0 -10
- {hestia_earth_models-0.67.1.dist-info → hestia_earth_models-0.68.1.dist-info}/LICENSE +0 -0
- {hestia_earth_models-0.67.1.dist-info → hestia_earth_models-0.68.1.dist-info}/WHEEL +0 -0
- {hestia_earth_models-0.67.1.dist-info → hestia_earth_models-0.68.1.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
from enum import Enum
|
2
2
|
from hestia_earth.schema import EmissionMethodTier, TermTermType
|
3
|
-
from hestia_earth.utils.lookup import
|
3
|
+
from hestia_earth.utils.lookup import download_lookup, get_table_value, extract_grouped_data
|
4
4
|
from hestia_earth.utils.model import filter_list_term_type
|
5
5
|
from hestia_earth.utils.tools import safe_parse_float, list_sum
|
6
6
|
|
@@ -12,6 +12,7 @@ from hestia_earth.models.utils.productivity import PRODUCTIVITY, get_productivit
|
|
12
12
|
from hestia_earth.models.utils.emission import _new_emission
|
13
13
|
from hestia_earth.models.utils.measurement import most_relevant_measurement_value
|
14
14
|
from hestia_earth.models.utils.input import total_excreta
|
15
|
+
from hestia_earth.models.utils.lookup import get_region_lookup_value
|
15
16
|
from . import MODEL
|
16
17
|
|
17
18
|
REQUIREMENTS = {
|
@@ -29,8 +30,8 @@ REQUIREMENTS = {
|
|
29
30
|
}
|
30
31
|
LOOKUPS = {
|
31
32
|
"region": "HDI",
|
32
|
-
"region-excreta-excretaManagement-ch4B0": "
|
33
|
-
"excretaManagement-ecoClimateZone-CH4conv": "
|
33
|
+
"region-excreta-excretaManagement-ch4B0": "",
|
34
|
+
"excretaManagement-ecoClimateZone-CH4conv": ""
|
34
35
|
}
|
35
36
|
RETURNS = {
|
36
37
|
"Emission": [{
|
@@ -83,11 +84,9 @@ def _get_excreta_b0(country: dict, input: dict):
|
|
83
84
|
# a high or low value is stored in the lookup as "high"
|
84
85
|
# therefore this model defaults to "high" productivity in these cases to ascertain this value
|
85
86
|
productivity_key = get_productivity(country)
|
86
|
-
lookup_name = 'region-excreta-excretaManagement-ch4B0.csv'
|
87
|
-
lookup = download_lookup(lookup_name)
|
88
87
|
term_id = input.get('term', {}).get('@id')
|
89
|
-
|
90
|
-
|
88
|
+
lookup_name = 'region-excreta-excretaManagement-ch4B0.csv'
|
89
|
+
data_values = get_region_lookup_value(lookup_name, country.get('@id'), term_id, model=MODEL, term=TERM_ID)
|
91
90
|
return safe_parse_float(
|
92
91
|
extract_grouped_data(data_values, productivity_key.value) or
|
93
92
|
extract_grouped_data(data_values, PRODUCTIVITY.HIGH.value) # defaults to high if low is not found
|
@@ -1,6 +1,5 @@
|
|
1
1
|
from hestia_earth.schema import EmissionMethodTier, EmissionStatsDefinition, TermTermType
|
2
2
|
from hestia_earth.utils.model import filter_list_term_type, find_term_match
|
3
|
-
from hestia_earth.utils.lookup import download_lookup, get_table_value, column_name
|
4
3
|
from hestia_earth.utils.tools import list_sum, safe_parse_float
|
5
4
|
|
6
5
|
from hestia_earth.models.log import debugValues, logRequirements, logShouldRun
|
@@ -8,6 +7,7 @@ from hestia_earth.models.utils.term import get_lookup_value
|
|
8
7
|
from hestia_earth.models.utils.emission import _new_emission
|
9
8
|
from hestia_earth.models.utils.product import has_flooded_rice
|
10
9
|
from hestia_earth.models.utils.organicFertiliser import get_cycle_inputs as get_organicFertiliser_inputs
|
10
|
+
from hestia_earth.models.utils.lookup import get_region_lookup_value
|
11
11
|
from . import MODEL
|
12
12
|
|
13
13
|
REQUIREMENTS = {
|
@@ -82,8 +82,10 @@ def _emission(value: float, min: float, max: float, sd: float):
|
|
82
82
|
|
83
83
|
|
84
84
|
def _get_CH4_ef(country: str, suffix: str = ''):
|
85
|
-
|
86
|
-
return safe_parse_float(
|
85
|
+
lookup_name = 'region-ch4ef-IPCC2019.csv'
|
86
|
+
return safe_parse_float(
|
87
|
+
get_region_lookup_value(lookup_name, country, 'CH4_ef' + suffix, model=MODEL, term=TERM_ID)
|
88
|
+
)
|
87
89
|
|
88
90
|
|
89
91
|
def _get_practice_lookup(term: dict, col: str):
|
@@ -410,7 +410,7 @@ def create_should_run_function(
|
|
410
410
|
cycle_end_date = cycle.get("endDate")
|
411
411
|
|
412
412
|
site = _get_site(cycle)
|
413
|
-
cycles = related_cycles(site)
|
413
|
+
cycles = related_cycles(site, cycles_mapping={cycle_id: cycle})
|
414
414
|
|
415
415
|
carbon_stock_measurements = [
|
416
416
|
node for node in site.get("measurements", [])
|
@@ -4,12 +4,12 @@
|
|
4
4
|
The model will only run for rice crops as this is the only crop which requires the value for emission recalculations.
|
5
5
|
"""
|
6
6
|
from hestia_earth.schema import PracticeStatsDefinition
|
7
|
-
from hestia_earth.utils.lookup import download_lookup, get_table_value, column_name
|
8
7
|
from hestia_earth.utils.tools import safe_parse_float
|
9
8
|
|
10
|
-
from hestia_earth.models.log import logRequirements,
|
9
|
+
from hestia_earth.models.log import logRequirements, logShouldRun
|
11
10
|
from hestia_earth.models.utils.practice import _new_practice
|
12
11
|
from hestia_earth.models.utils.product import has_flooded_rice
|
12
|
+
from hestia_earth.models.utils.lookup import get_region_lookup_value
|
13
13
|
from . import MODEL
|
14
14
|
|
15
15
|
REQUIREMENTS = {
|
@@ -59,10 +59,7 @@ def _practice(value: float, min: float, max: float, sd: float):
|
|
59
59
|
|
60
60
|
|
61
61
|
def _get_value(country: str, col: str):
|
62
|
-
|
63
|
-
value = safe_parse_float(get_table_value(lookup, 'termid', country, column_name(col)))
|
64
|
-
debugMissingLookup(LOOKUP_TABLE, 'termid', country, col, value, model=MODEL, term=TERM_ID)
|
65
|
-
return value
|
62
|
+
return safe_parse_float(get_region_lookup_value(LOOKUP_TABLE, country, col, model=MODEL, term=TERM_ID))
|
66
63
|
|
67
64
|
|
68
65
|
def _run(country: str):
|