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.
Files changed (148) hide show
  1. hestia_earth/models/aware/scarcityWeightedWaterUse.py +5 -6
  2. hestia_earth/models/blonkConsultants2016/ch4ToAirNaturalVegetationBurning.py +1 -1
  3. hestia_earth/models/blonkConsultants2016/co2ToAirAboveGroundBiomassStockChangeLandUseChange.py +1 -1
  4. hestia_earth/models/blonkConsultants2016/n2OToAirNaturalVegetationBurningDirect.py +1 -1
  5. hestia_earth/models/blonkConsultants2016/utils.py +9 -9
  6. hestia_earth/models/cache_sites.py +44 -23
  7. hestia_earth/models/chaudharyBrooks2018/damageToTerrestrialEcosystemsLandOccupation.py +2 -2
  8. hestia_earth/models/chaudharyBrooks2018/damageToTerrestrialEcosystemsLandTransformation.py +2 -2
  9. hestia_earth/models/chaudharyBrooks2018/utils.py +13 -8
  10. hestia_earth/models/cml2001Baseline/abioticResourceDepletionFossilFuels.py +2 -3
  11. hestia_earth/models/cml2001Baseline/abioticResourceDepletionMineralsAndMetals.py +1 -1
  12. hestia_earth/models/config/Cycle.json +15 -0
  13. hestia_earth/models/config/ImpactAssessment.json +14 -1
  14. hestia_earth/models/config/Site.json +8 -0
  15. hestia_earth/models/cycle/excretaKgMass.py +2 -2
  16. hestia_earth/models/cycle/materialAndSubstrate.py +3 -2
  17. hestia_earth/models/cycle/pastureGrass.py +3 -3
  18. hestia_earth/models/dammgen2009/noxToAirExcreta.py +1 -1
  19. hestia_earth/models/ecoinventV3AndEmberClimate/__init__.py +1 -1
  20. hestia_earth/models/ecoinventV3AndEmberClimate/utils.py +2 -6
  21. hestia_earth/models/emissionNotRelevant/__init__.py +4 -4
  22. hestia_earth/models/environmentalFootprintV3_1/environmentalFootprintSingleOverallScore.py +30 -21
  23. hestia_earth/models/environmentalFootprintV3_1/photochemicalOzoneCreationPotentialHumanHealthNmvocEq.py +36 -0
  24. hestia_earth/models/environmentalFootprintV3_1/scarcityWeightedWaterUse.py +2 -2
  25. hestia_earth/models/environmentalFootprintV3_1/soilQualityIndexLandOccupation.py +9 -8
  26. hestia_earth/models/environmentalFootprintV3_1/soilQualityIndexLandTransformation.py +25 -22
  27. hestia_earth/models/environmentalFootprintV3_1/soilQualityIndexTotalLandUseEffects.py +7 -6
  28. hestia_earth/models/faostat2018/coldCarcassWeightPerHead.py +2 -2
  29. hestia_earth/models/faostat2018/coldDressedCarcassWeightPerHead.py +2 -2
  30. hestia_earth/models/faostat2018/liveweightPerHead.py +7 -8
  31. hestia_earth/models/faostat2018/product/price.py +34 -28
  32. hestia_earth/models/faostat2018/readyToCookWeightPerHead.py +2 -2
  33. hestia_earth/models/faostat2018/utils.py +15 -27
  34. hestia_earth/models/frischknechtEtAl2000/ionisingRadiationKbqU235Eq.py +16 -9
  35. hestia_earth/models/geospatialDatabase/altitude.py +60 -0
  36. hestia_earth/models/geospatialDatabase/croppingIntensity.py +1 -1
  37. hestia_earth/models/geospatialDatabase/ecoClimateZone.py +2 -2
  38. hestia_earth/models/geospatialDatabase/longFallowRatio.py +1 -1
  39. hestia_earth/models/geospatialDatabase/utils.py +4 -1
  40. hestia_earth/models/globalCropWaterModel2008/rootingDepth.py +2 -3
  41. hestia_earth/models/haversineFormula/transport/distance.py +3 -3
  42. hestia_earth/models/hestia/landCover.py +72 -45
  43. hestia_earth/models/hestia/seed_emissions.py +11 -7
  44. hestia_earth/models/impact_assessment/__init__.py +3 -3
  45. hestia_earth/models/ipcc2019/animal/fatContent.py +1 -1
  46. hestia_earth/models/ipcc2019/animal/hoursWorkedPerDay.py +1 -1
  47. hestia_earth/models/ipcc2019/animal/liveweightGain.py +1 -1
  48. hestia_earth/models/ipcc2019/animal/liveweightPerHead.py +1 -1
  49. hestia_earth/models/ipcc2019/animal/milkYieldPerAnimal.py +1 -1
  50. hestia_earth/models/ipcc2019/animal/pastureGrass.py +1 -1
  51. hestia_earth/models/ipcc2019/animal/pregnancyRateTotal.py +1 -1
  52. hestia_earth/models/ipcc2019/animal/trueProteinContent.py +1 -1
  53. hestia_earth/models/ipcc2019/animal/utils.py +5 -7
  54. hestia_earth/models/ipcc2019/animal/weightAtMaturity.py +1 -1
  55. hestia_earth/models/ipcc2019/ch4ToAirEntericFermentation.py +2 -2
  56. hestia_earth/models/ipcc2019/ch4ToAirExcreta.py +6 -7
  57. hestia_earth/models/ipcc2019/ch4ToAirFloodedRice.py +5 -3
  58. hestia_earth/models/ipcc2019/co2ToAirCarbonStockChange_utils.py +1 -1
  59. hestia_earth/models/ipcc2019/croppingDuration.py +3 -6
  60. hestia_earth/models/ipcc2019/nonCo2EmissionsToAirNaturalVegetationBurning.py +947 -0
  61. hestia_earth/models/ipcc2019/pastureGrass.py +1 -1
  62. hestia_earth/models/koble2014/residueBurnt.py +5 -7
  63. hestia_earth/models/koble2014/residueRemoved.py +5 -7
  64. hestia_earth/models/lcImpactAllEffects100Years/damageToHumanHealthWaterStress.py +2 -2
  65. hestia_earth/models/lcImpactAllEffectsInfinite/damageToHumanHealthWaterStress.py +2 -2
  66. hestia_earth/models/lcImpactCertainEffects100Years/damageToHumanHealthWaterStress.py +2 -2
  67. hestia_earth/models/lcImpactCertainEffectsInfinite/damageToHumanHealthWaterStress.py +2 -2
  68. hestia_earth/models/log.py +1 -1
  69. hestia_earth/models/mocking/search-results.json +3397 -1097
  70. hestia_earth/models/site/management.py +1 -1
  71. hestia_earth/models/site/post_checks/__init__.py +3 -2
  72. hestia_earth/models/site/post_checks/country.py +9 -0
  73. hestia_earth/models/site/pre_checks/__init__.py +3 -2
  74. hestia_earth/models/site/pre_checks/country.py +9 -0
  75. hestia_earth/models/site/soilMeasurement.py +2 -0
  76. hestia_earth/models/utils/__init__.py +1 -16
  77. hestia_earth/models/utils/blank_node.py +25 -25
  78. hestia_earth/models/utils/completeness.py +3 -2
  79. hestia_earth/models/utils/cycle.py +5 -4
  80. hestia_earth/models/utils/emission.py +5 -5
  81. hestia_earth/models/utils/feedipedia.py +6 -6
  82. hestia_earth/models/utils/impact_assessment.py +1 -2
  83. hestia_earth/models/utils/indicator.py +9 -7
  84. hestia_earth/models/utils/inorganicFertiliser.py +4 -6
  85. hestia_earth/models/utils/input.py +6 -5
  86. hestia_earth/models/utils/lookup.py +32 -100
  87. hestia_earth/models/utils/management.py +4 -4
  88. hestia_earth/models/utils/measurement.py +7 -8
  89. hestia_earth/models/utils/method.py +20 -0
  90. hestia_earth/models/utils/practice.py +4 -5
  91. hestia_earth/models/utils/product.py +4 -5
  92. hestia_earth/models/utils/property.py +12 -22
  93. hestia_earth/models/utils/site.py +14 -8
  94. hestia_earth/models/utils/term.py +27 -1
  95. hestia_earth/models/version.py +1 -1
  96. hestia_earth/orchestrator/log.py +0 -11
  97. hestia_earth/orchestrator/models/__init__.py +17 -4
  98. hestia_earth/orchestrator/strategies/run/add_blank_node_if_missing.py +2 -20
  99. {hestia_earth_models-0.67.1.dist-info → hestia_earth_models-0.68.1.dist-info}/METADATA +2 -2
  100. {hestia_earth_models-0.67.1.dist-info → hestia_earth_models-0.68.1.dist-info}/RECORD +146 -138
  101. tests/models/cml2001Baseline/test_abioticResourceDepletionFossilFuels.py +3 -3
  102. tests/models/cml2001Baseline/test_resourceUseEnergyDepletionDuringCycle.py +1 -1
  103. tests/models/cycle/test_coldCarcassWeightPerHead.py +1 -1
  104. tests/models/cycle/test_coldDressedCarcassWeightPerHead.py +1 -1
  105. tests/models/cycle/test_concentrateFeed.py +1 -1
  106. tests/models/cycle/test_energyContentLowerHeatingValue.py +1 -1
  107. tests/models/cycle/test_excretaKgMass.py +1 -1
  108. tests/models/cycle/test_feedConversionRatio.py +3 -3
  109. tests/models/cycle/test_pastureGrass.py +1 -1
  110. tests/models/cycle/test_readyToCookWeightPerHead.py +1 -1
  111. tests/models/environmentalFootprintV3_1/test_photochemicalOzoneCreationPotentialHumanHealthNmvocEq.py +30 -0
  112. tests/models/environmentalFootprintV3_1/test_soilQualityIndexTotalLandUseEffects.py +30 -7
  113. tests/models/faostat2018/product/test_price.py +27 -14
  114. tests/models/faostat2018/test_faostat_utils.py +4 -24
  115. tests/models/faostat2018/test_liveweightPerHead.py +9 -9
  116. tests/models/globalCropWaterModel2008/test_rootingDepth.py +7 -3
  117. tests/models/haversineFormula/transport/test_distance.py +1 -1
  118. tests/models/hestia/test_landCover.py +53 -5
  119. tests/models/ipcc2019/animal/test_pastureGrass.py +5 -3
  120. tests/models/ipcc2019/test_aboveGroundCropResidueTotal.py +4 -4
  121. tests/models/ipcc2019/test_belowGroundCropResidue.py +4 -4
  122. tests/models/ipcc2019/test_ch4ToAirEntericFermentation.py +10 -10
  123. tests/models/ipcc2019/test_croppingDuration.py +1 -1
  124. tests/models/ipcc2019/test_nonCo2EmissionsToAirNaturalVegetationBurning.py +83 -0
  125. tests/models/ipcc2019/test_organicCarbonPerHa.py +12 -12
  126. tests/models/ipcc2019/test_pastureGrass.py +5 -3
  127. tests/models/pooreNemecek2018/test_excretaKgN.py +5 -5
  128. tests/models/pooreNemecek2018/test_excretaKgVs.py +2 -2
  129. tests/models/site/post_checks/test_country.py +6 -0
  130. tests/models/site/pre_checks/test_cache_geospatialDatabase.py +1 -1
  131. tests/models/site/pre_checks/test_country.py +12 -0
  132. tests/models/test_ecoinventV3.py +7 -3
  133. tests/models/utils/test_blank_node.py +4 -12
  134. tests/models/utils/test_dataCompleteness.py +5 -5
  135. tests/models/utils/test_emission.py +2 -2
  136. tests/models/utils/test_indicator.py +2 -2
  137. tests/models/utils/test_input.py +2 -2
  138. tests/models/utils/test_measurement.py +2 -4
  139. tests/models/utils/test_practice.py +4 -2
  140. tests/models/utils/test_product.py +2 -2
  141. tests/models/utils/test_property.py +4 -2
  142. tests/models/utils/test_site.py +7 -0
  143. tests/orchestrator/strategies/run/test_add_blank_node_if_missing.py +4 -9
  144. hestia_earth/models/environmentalFootprintV3_1/utils.py +0 -17
  145. tests/models/utils/test_lookup.py +0 -10
  146. {hestia_earth_models-0.67.1.dist-info → hestia_earth_models-0.68.1.dist-info}/LICENSE +0 -0
  147. {hestia_earth_models-0.67.1.dist-info → hestia_earth_models-0.68.1.dist-info}/WHEEL +0 -0
  148. {hestia_earth_models-0.67.1.dist-info → hestia_earth_models-0.68.1.dist-info}/top_level.txt +0 -0
@@ -140,7 +140,7 @@ LOOKUPS = {
140
140
  "mjKgABNetEnergyGrowthSheepGoatsIpcc2019",
141
141
  "isWoolProducingAnimal"
142
142
  ],
143
- "system-liveAnimal-activityCoefficient-ipcc2019": "using animal term @id",
143
+ "system-liveAnimal-activityCoefficient-ipcc2019": "",
144
144
  "landCover": "grazedPastureGrassInputId",
145
145
  "crop-property": ["energyDigestibilityRuminants", "energyContentHigherHeatingValue"],
146
146
  "crop": "grazedPastureGrassInputId",
@@ -1,8 +1,8 @@
1
- from hestia_earth.utils.lookup import get_table_value, download_lookup, column_name
2
1
  from hestia_earth.utils.tools import safe_parse_float
3
2
 
4
- from hestia_earth.models.log import logRequirements, debugMissingLookup
3
+ from hestia_earth.models.log import logRequirements
5
4
  from hestia_earth.models.utils.term import get_lookup_value
5
+ from hestia_earth.models.utils.lookup import get_region_lookup_value
6
6
  from . import MODEL
7
7
  from .utils import _should_run, _practice
8
8
 
@@ -17,7 +17,7 @@ REQUIREMENTS = {
17
17
  }
18
18
  LOOKUPS = {
19
19
  "crop": ["cropGroupingResidue", "Combustion_Factor_crop_residue"],
20
- "region-crop-cropGroupingResidue-burnt": "using result from `cropGroupingResidue`"
20
+ "region-crop-cropGroupingResidue-burnt": ""
21
21
  }
22
22
  RETURNS = {
23
23
  "Practice": [{
@@ -30,12 +30,10 @@ LOOKUP_NAME = 'region-crop-cropGroupingResidue-burnt.csv'
30
30
 
31
31
  def _get_default_percent(cycle: dict, term: dict, country_id: str):
32
32
  crop_grouping = get_lookup_value(term, LOOKUPS['crop'][0], model=MODEL, term=TERM_ID)
33
- lookup = download_lookup(LOOKUP_NAME)
34
33
  percent = safe_parse_float(
35
- get_table_value(lookup, 'termid', country_id, column_name(crop_grouping)), None
34
+ get_region_lookup_value(LOOKUP_NAME, country_id, crop_grouping, model=MODEL, term=TERM_ID), None
36
35
  ) if crop_grouping else None
37
- debugMissingLookup(LOOKUP_NAME, 'termid', country_id, crop_grouping, percent, model=MODEL)
38
- comb_factor = safe_parse_float(get_lookup_value(term, LOOKUPS['crop'][1], model=MODEL, term=TERM_ID))
36
+ comb_factor = safe_parse_float(get_lookup_value(term, LOOKUPS['crop'][1]))
39
37
  logRequirements(cycle, model=MODEL, term=TERM_ID,
40
38
  crop_grouping=crop_grouping,
41
39
  country_id=country_id,
@@ -1,8 +1,8 @@
1
- from hestia_earth.utils.lookup import get_table_value, download_lookup, column_name
2
1
  from hestia_earth.utils.tools import safe_parse_float
3
2
 
4
- from hestia_earth.models.log import logRequirements, debugMissingLookup
3
+ from hestia_earth.models.log import logRequirements
5
4
  from hestia_earth.models.utils.term import get_lookup_value
5
+ from hestia_earth.models.utils.lookup import get_region_lookup_value
6
6
  from . import MODEL
7
7
  from .utils import _should_run, _practice
8
8
 
@@ -17,7 +17,7 @@ REQUIREMENTS = {
17
17
  }
18
18
  LOOKUPS = {
19
19
  "crop": "cropGroupingResidue",
20
- "region-crop-cropGroupingResidue-removed": "using result from `cropGroupingResidue`"
20
+ "region-crop-cropGroupingResidue-removed": ""
21
21
  }
22
22
  RETURNS = {
23
23
  "Practice": [{
@@ -30,11 +30,9 @@ LOOKUP_NAME = 'region-crop-cropGroupingResidue-removed.csv'
30
30
 
31
31
  def _get_default_percent(cycle: dict, term: dict, country_id: str):
32
32
  crop_grouping = get_lookup_value(term, LOOKUPS['crop'], model=MODEL, term=TERM_ID)
33
- percent = get_table_value(
34
- download_lookup(LOOKUP_NAME), 'termid', country_id, column_name(crop_grouping)
33
+ percent = get_region_lookup_value(
34
+ LOOKUP_NAME, country_id, crop_grouping, model=MODEL, term=TERM_ID
35
35
  ) if crop_grouping else None
36
- debugMissingLookup(LOOKUP_NAME, 'termid', country_id, crop_grouping, percent,
37
- model=MODEL, term=TERM_ID)
38
36
  logRequirements(cycle, model=MODEL, term=TERM_ID,
39
37
  crop_grouping=crop_grouping,
40
38
  country_id=country_id,
@@ -22,8 +22,8 @@ RETURNS = {
22
22
  }
23
23
  LOOKUPS = {
24
24
  "@doc": "Different lookup files are used depending on the situation",
25
- "awareWaterBasinId-resourceUse-WaterStressDamageToHumanHealthLCImpactCF": "using `awareWaterBasinId`",
26
- "region-resourceUse-WaterStressDamageToHumanHealthLCImpactCF": "using `region`"
25
+ "awareWaterBasinId-resourceUse-WaterStressDamageToHumanHealthLCImpactCF": "",
26
+ "region-resourceUse-WaterStressDamageToHumanHealthLCImpactCF": ""
27
27
  }
28
28
  TERM_ID = 'damageToHumanHealthWaterStress'
29
29
  LOOKUP_SUFFIX = 'resourceUse-WaterStressDamageToHumanHealthLCImpactCF'
@@ -22,8 +22,8 @@ RETURNS = {
22
22
  }
23
23
  LOOKUPS = {
24
24
  "@doc": "Different lookup files are used depending on the situation",
25
- "awareWaterBasinId-resourceUse-WaterStressDamageToHumanHealthLCImpactCF": "using `awareWaterBasinId`",
26
- "region-resourceUse-WaterStressDamageToHumanHealthLCImpactCF": "using `region`"
25
+ "awareWaterBasinId-resourceUse-WaterStressDamageToHumanHealthLCImpactCF": "",
26
+ "region-resourceUse-WaterStressDamageToHumanHealthLCImpactCF": ""
27
27
  }
28
28
  TERM_ID = 'damageToHumanHealthWaterStress'
29
29
  LOOKUP_SUFFIX = 'resourceUse-WaterStressDamageToHumanHealthLCImpactCF'
@@ -22,8 +22,8 @@ RETURNS = {
22
22
  }
23
23
  LOOKUPS = {
24
24
  "@doc": "Different lookup files are used depending on the situation",
25
- "awareWaterBasinId-resourceUse-WaterStressDamageToHumanHealthLCImpactCF": "using `awareWaterBasinId`",
26
- "region-resourceUse-WaterStressDamageToHumanHealthLCImpactCF": "using `region`"
25
+ "awareWaterBasinId-resourceUse-WaterStressDamageToHumanHealthLCImpactCF": "",
26
+ "region-resourceUse-WaterStressDamageToHumanHealthLCImpactCF": ""
27
27
  }
28
28
  TERM_ID = 'damageToHumanHealthWaterStress'
29
29
  LOOKUP_SUFFIX = 'resourceUse-WaterStressDamageToHumanHealthLCImpactCF'
@@ -22,8 +22,8 @@ RETURNS = {
22
22
  }
23
23
  LOOKUPS = {
24
24
  "@doc": "Different lookup files are used depending on the situation",
25
- "awareWaterBasinId-resourceUse-WaterStressDamageToHumanHealthLCImpactCF": "using `awareWaterBasinId`",
26
- "region-resourceUse-WaterStressDamageToHumanHealthLCImpactCF": "using `region`"
25
+ "awareWaterBasinId-resourceUse-WaterStressDamageToHumanHealthLCImpactCF": "",
26
+ "region-resourceUse-WaterStressDamageToHumanHealthLCImpactCF": ""
27
27
  }
28
28
  TERM_ID = 'damageToHumanHealthWaterStress'
29
29
  LOOKUP_SUFFIX = 'resourceUse-WaterStressDamageToHumanHealthLCImpactCF'
@@ -65,7 +65,7 @@ def logShouldRun(log_node: dict, model: str, term: Union[str, None], should_run:
65
65
  def debugMissingLookup(lookup_name: str, row: str, row_value: str, col: str, value, **kwargs):
66
66
  if value is None or value == '':
67
67
  extra = (', ' + _join_args(**kwargs)) if len(kwargs.keys()) > 0 else ''
68
- logger.warning('Missing lookup=%s, %s=%s, column=%s' + extra, lookup_name, row, row_value, col)
68
+ logger.warning(f'Missing lookup={lookup_name}, {row}={row_value}, column={col}' + extra)
69
69
 
70
70
 
71
71
  def logErrorRun(model: str, term: str, error: str):