hestia-earth-models 0.72.1__py3-none-any.whl → 0.73.0__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 (137) hide show
  1. hestia_earth/models/{akagiEtAl2011AndIpcc2006 → akagiEtAl2011}/__init__.py +1 -1
  2. hestia_earth/models/akagiEtAl2011/ch4ToAirCropResidueBurning.py +32 -0
  3. hestia_earth/models/akagiEtAl2011/nh3ToAirCropResidueBurning.py +32 -0
  4. hestia_earth/models/akagiEtAl2011/noxToAirCropResidueBurning.py +32 -0
  5. hestia_earth/models/akagiEtAl2011/pm25ToAirCropResidueBurning.py +32 -0
  6. hestia_earth/models/akagiEtAl2011/so2ToAirCropResidueBurning.py +32 -0
  7. hestia_earth/models/akagiEtAl2011/utils.py +45 -0
  8. hestia_earth/models/aware/scarcityWeightedWaterUse.py +2 -2
  9. hestia_earth/models/chaudharyBrooks2018/damageToTerrestrialEcosystemsTotalLandUseEffects.py +1 -1
  10. hestia_earth/models/chaudharyBrooks2018/utils.py +1 -1
  11. hestia_earth/models/cml2001Baseline/resourceUseEnergyDepletionInputsProduction.py +2 -1
  12. hestia_earth/models/cml2001Baseline/resourceUseMineralsAndMetalsInputsProduction.py +2 -1
  13. hestia_earth/models/config/Cycle.json +48 -7
  14. hestia_earth/models/config/ImpactAssessment.json +22 -0
  15. hestia_earth/models/cycle/completeness/soilAmendment.py +1 -1
  16. hestia_earth/models/cycle/product/economicValueShare.py +3 -1
  17. hestia_earth/models/cycle/product/price.py +35 -10
  18. hestia_earth/models/cycle/product/revenue.py +5 -2
  19. hestia_earth/models/dammgen2009/noxToAirExcreta.py +14 -18
  20. hestia_earth/models/ecoalimV9/cycle.py +1 -0
  21. hestia_earth/models/ecoalimV9/impact_assessment.py +1 -0
  22. hestia_earth/models/ecoinventV3/__init__.py +11 -5
  23. hestia_earth/models/ecoinventV3AndEmberClimate/__init__.py +1 -0
  24. hestia_earth/models/ecoinventV3AndEmberClimate/utils.py +1 -1
  25. hestia_earth/models/emepEea2019/utils.py +2 -1
  26. hestia_earth/models/faostat2018/liveweightPerHead.py +1 -1
  27. hestia_earth/models/faostat2018/product/price.py +2 -2
  28. hestia_earth/models/faostat2018/seed.py +3 -2
  29. hestia_earth/models/faostat2018/utils.py +6 -5
  30. hestia_earth/models/geospatialDatabase/altitude.py +2 -1
  31. hestia_earth/models/geospatialDatabase/drainageClass.py +2 -1
  32. hestia_earth/models/geospatialDatabase/organicCarbonPerKgSoil.py +2 -1
  33. hestia_earth/models/geospatialDatabase/totalNitrogenPerKgSoil.py +2 -1
  34. hestia_earth/models/geospatialDatabase/totalPhosphorusPerKgSoil.py +2 -1
  35. hestia_earth/models/geospatialDatabase/utils.py +1 -1
  36. hestia_earth/models/globalCropWaterModel2008/rootingDepth.py +1 -1
  37. hestia_earth/models/hestia/brackishWater.py +1 -1
  38. hestia_earth/models/hestia/default_emissions.py +105 -0
  39. hestia_earth/models/hestia/default_resourceUse.py +110 -0
  40. hestia_earth/models/hestia/freshWater.py +1 -1
  41. hestia_earth/models/hestia/inorganicFertiliser.py +12 -12
  42. hestia_earth/models/hestia/landCover.py +7 -5
  43. hestia_earth/models/hestia/landTransformation100YearAverageDuringCycle.py +3 -0
  44. hestia_earth/models/hestia/landTransformation20YearAverageDuringCycle.py +3 -0
  45. hestia_earth/models/hestia/liveAnimal.py +1 -1
  46. hestia_earth/models/hestia/management.py +1 -1
  47. hestia_earth/models/hestia/netPrimaryProduction.py +1 -1
  48. hestia_earth/models/hestia/organicCarbonPerHa.py +2 -2
  49. hestia_earth/models/hestia/salineWater.py +1 -1
  50. hestia_earth/models/hestia/seed_emissions.py +34 -20
  51. hestia_earth/models/hestia/totalNitrogenPerKgSoil.py +1 -1
  52. hestia_earth/models/hestia/waterSalinity.py +2 -1
  53. hestia_earth/models/ipcc2006/aboveGroundCropResidueRemoved.py +2 -2
  54. hestia_earth/models/ipcc2006/aboveGroundCropResidueTotal.py +10 -6
  55. hestia_earth/models/ipcc2006/belowGroundCropResidue.py +12 -8
  56. hestia_earth/models/ipcc2019/animal/utils.py +1 -1
  57. hestia_earth/models/ipcc2019/belowGroundCropResidue.py +1 -1
  58. hestia_earth/models/ipcc2019/carbonContent.py +1 -1
  59. hestia_earth/models/ipcc2019/ch4ToAirAquacultureSystems.py +17 -9
  60. hestia_earth/models/ipcc2019/ch4ToAirEntericFermentation.py +6 -6
  61. hestia_earth/models/ipcc2019/ch4ToAirExcreta.py +4 -2
  62. hestia_earth/models/ipcc2019/co2ToAirUreaHydrolysis.py +1 -1
  63. hestia_earth/models/ipcc2019/croppingDuration.py +4 -2
  64. hestia_earth/models/ipcc2019/ligninContent.py +1 -1
  65. hestia_earth/models/{akagiEtAl2011AndIpcc2006 → ipcc2019}/n2OToAirCropResidueBurningDirect.py +8 -4
  66. hestia_earth/models/ipcc2019/nitrogenContent.py +1 -1
  67. hestia_earth/models/ipcc2019/nonCo2EmissionsToAirNaturalVegetationBurning.py +6 -2
  68. hestia_earth/models/ipcc2019/pastureGrass_utils.py +13 -12
  69. hestia_earth/models/ipcc2019/utils.py +6 -2
  70. hestia_earth/models/koble2014/residueBurnt.py +6 -3
  71. hestia_earth/models/koble2014/residueRemoved.py +1 -1
  72. hestia_earth/models/linkedImpactAssessment/emissions.py +1 -0
  73. hestia_earth/models/linkedImpactAssessment/utils.py +16 -16
  74. hestia_earth/models/mocking/search-results.json +1605 -1601
  75. hestia_earth/models/pooreNemecek2018/aboveGroundCropResidueTotal.py +1 -1
  76. hestia_earth/models/pooreNemecek2018/belowGroundCropResidue.py +1 -1
  77. hestia_earth/models/pooreNemecek2018/excretaKgVs.py +1 -1
  78. hestia_earth/models/pooreNemecek2018/freshwaterWithdrawalsDuringCycle.py +1 -1
  79. hestia_earth/models/pooreNemecek2018/longFallowDuration.py +1 -1
  80. hestia_earth/models/pooreNemecek2018/nurseryDensity.py +1 -1
  81. hestia_earth/models/pooreNemecek2018/nurseryDuration.py +1 -1
  82. hestia_earth/models/pooreNemecek2018/plantationDensity.py +1 -1
  83. hestia_earth/models/pooreNemecek2018/plantationLifespan.py +1 -1
  84. hestia_earth/models/pooreNemecek2018/plantationProductiveLifespan.py +3 -1
  85. hestia_earth/models/pooreNemecek2018/saplingsDepreciatedAmountPerCycle.py +1 -1
  86. hestia_earth/models/resourceUseNotRelevant/__init__.py +65 -0
  87. hestia_earth/models/schererPfister2015/nErosionSoilFlux.py +5 -3
  88. hestia_earth/models/schererPfister2015/pErosionSoilFlux.py +5 -3
  89. hestia_earth/models/schererPfister2015/utils.py +5 -4
  90. hestia_earth/models/stehfestBouwman2006/n2OToAirSoilFlux_utils.py +1 -1
  91. hestia_earth/models/stehfestBouwman2006GisImplementation/noxToAirSoilFlux_utils.py +3 -3
  92. hestia_earth/models/utils/background_emissions.py +14 -10
  93. hestia_earth/models/utils/blank_node.py +6 -4
  94. hestia_earth/models/utils/crop.py +1 -1
  95. hestia_earth/models/utils/cropResidue.py +16 -0
  96. hestia_earth/models/utils/cycle.py +1 -1
  97. hestia_earth/models/utils/ecoClimateZone.py +2 -2
  98. hestia_earth/models/utils/excretaManagement.py +1 -1
  99. hestia_earth/models/utils/feedipedia.py +3 -3
  100. hestia_earth/models/utils/fertiliser.py +7 -1
  101. hestia_earth/models/utils/inorganicFertiliser.py +2 -2
  102. hestia_earth/models/utils/input.py +34 -1
  103. hestia_earth/models/utils/liveAnimal.py +2 -2
  104. hestia_earth/models/utils/lookup.py +1 -1
  105. hestia_earth/models/utils/measurement.py +5 -4
  106. hestia_earth/models/utils/productivity.py +1 -1
  107. hestia_earth/models/utils/property.py +4 -2
  108. hestia_earth/models/utils/site.py +2 -1
  109. hestia_earth/models/version.py +1 -1
  110. {hestia_earth_models-0.72.1.dist-info → hestia_earth_models-0.73.0.dist-info}/METADATA +1 -1
  111. {hestia_earth_models-0.72.1.dist-info → hestia_earth_models-0.73.0.dist-info}/RECORD +131 -120
  112. tests/models/akagiEtAl2011/test_ch4ToAirCropResidueBurning.py +33 -0
  113. tests/models/akagiEtAl2011/test_nh3ToAirCropResidueBurning.py +33 -0
  114. tests/models/{akagiEtAl2011AndIpcc2006 → akagiEtAl2011}/test_noxToAirCropResidueBurning.py +5 -17
  115. tests/models/akagiEtAl2011/test_pm25ToAirCropResidueBurning.py +33 -0
  116. tests/models/akagiEtAl2011/test_so2ToAirCropResidueBurning.py +33 -0
  117. tests/models/akagiEtAl2011/test_utils.py +18 -0
  118. tests/models/cycle/product/test_price.py +1 -11
  119. tests/models/dammgen2009/test_noxToAirExcreta.py +30 -10
  120. tests/models/geospatialDatabase/test_utils.py +2 -1
  121. tests/models/hestia/test_default_emissions.py +25 -0
  122. tests/models/hestia/test_default_resourceUse.py +26 -0
  123. tests/models/hestia/test_landCover.py +2 -2
  124. tests/models/ipcc2019/test_ch4ToAirAquacultureSystems.py +2 -2
  125. tests/models/{akagiEtAl2011AndIpcc2006/test_nh3ToAirCropResidueBurning.py → ipcc2019/test_n2OToAirCropResidueBurningDirect.py} +2 -2
  126. tests/models/test_resourceUseNotRelevant.py +27 -0
  127. tests/models/{akagiEtAl2011AndIpcc2006/test_utils.py → utils/test_cropResidue.py} +6 -6
  128. hestia_earth/models/akagiEtAl2011AndIpcc2006/ch4ToAirCropResidueBurning.py +0 -57
  129. hestia_earth/models/akagiEtAl2011AndIpcc2006/nh3ToAirCropResidueBurning.py +0 -57
  130. hestia_earth/models/akagiEtAl2011AndIpcc2006/noxToAirCropResidueBurning.py +0 -57
  131. hestia_earth/models/akagiEtAl2011AndIpcc2006/utils.py +0 -15
  132. tests/models/akagiEtAl2011AndIpcc2006/test_ch4ToAirCropResidueBurning.py +0 -45
  133. tests/models/akagiEtAl2011AndIpcc2006/test_n2OToAirCropResidueBurningDirect.py +0 -46
  134. {hestia_earth_models-0.72.1.dist-info → hestia_earth_models-0.73.0.dist-info}/LICENSE +0 -0
  135. {hestia_earth_models-0.72.1.dist-info → hestia_earth_models-0.73.0.dist-info}/WHEEL +0 -0
  136. {hestia_earth_models-0.72.1.dist-info → hestia_earth_models-0.73.0.dist-info}/top_level.txt +0 -0
  137. /tests/models/{akagiEtAl2011AndIpcc2006 → akagiEtAl2011}/__init__.py +0 -0
@@ -77,6 +77,7 @@ def _run_emission(cycle: dict, emission_term_id: str, data: dict):
77
77
 
78
78
  # log run on each emission so we know it did run
79
79
  details = values.get('details', {})
80
+ logShouldRun(cycle, MODEL, input_term_id, True, methodTier=TIER, emission_id=emission_term_id)
80
81
  debugValues(cycle, model=model, term=emission_term_id,
81
82
  value=value,
82
83
  coefficient=1,
@@ -8,14 +8,14 @@ from hestia_earth.models.utils.input import load_impacts
8
8
  from . import MODEL
9
9
 
10
10
 
11
- def _indicator(term_id: str, value: float, input: dict):
12
- indicator = _new_indicator(term_id, MODEL)
11
+ def _indicator(model: str, term_id: str, value: float, input: dict):
12
+ indicator = _new_indicator(term_id, model)
13
13
  indicator['value'] = value
14
14
  indicator['inputs'] = [input]
15
15
  return indicator
16
16
 
17
17
 
18
- def _run_indicators(impact_assessment: dict, product: dict, term_id: str):
18
+ def _run_indicators(impact_assessment: dict, product: dict, term_id: str, model: str):
19
19
  def run(values: list):
20
20
  input = values[0].get('input').get('term', {})
21
21
  indicator = values[0].get('indicator')
@@ -24,22 +24,22 @@ def _run_indicators(impact_assessment: dict, product: dict, term_id: str):
24
24
  for value in values
25
25
  ])
26
26
  value = convert_value_from_cycle(
27
- impact_assessment, product, sum_values(values_from_cycle), model=MODEL, term_id=term_id
27
+ impact_assessment, product, sum_values(values_from_cycle), model=model, term_id=term_id
28
28
  )
29
29
 
30
30
  # show values per input in the logs
31
- debugValues(impact_assessment, model=MODEL, term=term_id,
31
+ debugValues(impact_assessment, model=model, term=term_id,
32
32
  value=value,
33
33
  coefficient=1,
34
34
  input=input.get('@id'))
35
35
 
36
36
  return (
37
- _indicator(term_id, value, input) | _include(indicator, ['landCover', 'previousLandCover'])
37
+ _indicator(model, term_id, value, input) | _include(indicator, ['landCover', 'previousLandCover'])
38
38
  ) if value is not None else None
39
39
  return run
40
40
 
41
41
 
42
- def _run_inputs_production(impact_assessment: dict, product: dict, term_id: str):
42
+ def _run_inputs_production(impact_assessment: dict, product: dict, term_id: str, model: str):
43
43
  cycle = impact_assessment.get('cycle', {})
44
44
 
45
45
  # group all indicators per `landCover` and `previousLandCover`
@@ -71,7 +71,7 @@ def _run_inputs_production(impact_assessment: dict, product: dict, term_id: str)
71
71
  ])
72
72
  has_indicators = bool(valid_indicators)
73
73
 
74
- logRequirements(impact_assessment, model=MODEL, term=term_id,
74
+ logRequirements(impact_assessment, model=model, term=term_id,
75
75
  indicators=log_as_table([
76
76
  {
77
77
  'indicator-id': value.get('indicator').get('term', {}).get('@id'),
@@ -83,30 +83,30 @@ def _run_inputs_production(impact_assessment: dict, product: dict, term_id: str)
83
83
  ]))
84
84
 
85
85
  should_run = all([has_indicators])
86
- logShouldRun(impact_assessment, MODEL, term_id, should_run)
86
+ logShouldRun(impact_assessment, model, term_id, should_run)
87
87
 
88
88
  return non_empty_list(flatten(
89
- map(_run_indicators(impact_assessment, product, term_id), grouped_indicators.values())
89
+ map(_run_indicators(impact_assessment, product, term_id, model), grouped_indicators.values())
90
90
  ))
91
91
 
92
92
 
93
- def _should_run_inputs_production(impact_assessment: dict, term_id: str):
93
+ def _should_run_inputs_production(impact_assessment: dict, term_id: str, model: str):
94
94
  product = get_product(impact_assessment) or {}
95
95
  product_id = product.get('term', {}).get('@id')
96
96
 
97
97
  product_value = list_sum(product.get('value', []), default=None)
98
98
  economic_value = product.get('economicValueShare')
99
99
 
100
- logRequirements(impact_assessment, model=MODEL, term=term_id,
100
+ logRequirements(impact_assessment, model=model, term=term_id,
101
101
  product_id=product_id,
102
102
  product_value=product_value,
103
103
  product_economicValueShare=economic_value)
104
104
 
105
105
  should_run = all([product, product_value, economic_value])
106
- logShouldRun(impact_assessment, MODEL, term_id, should_run)
106
+ logShouldRun(impact_assessment, model, term_id, should_run)
107
107
  return should_run, product
108
108
 
109
109
 
110
- def run_inputs_production(impact_assessment: dict, term_id: str):
111
- should_run, product = _should_run_inputs_production(impact_assessment, term_id)
112
- return _run_inputs_production(impact_assessment, product, term_id) if should_run else []
110
+ def run_inputs_production(impact_assessment: dict, term_id: str, model: str = MODEL):
111
+ should_run, product = _should_run_inputs_production(impact_assessment, term_id, model)
112
+ return _run_inputs_production(impact_assessment, product, term_id, model) if should_run else []