hestia-earth-models 0.64.12__py3-none-any.whl → 0.64.14__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.

Potentially problematic release.


This version of hestia-earth-models might be problematic. Click here for more details.

Files changed (190) hide show
  1. hestia_earth/models/aware/scarcityWeightedWaterUse.py +1 -1
  2. hestia_earth/models/chaudharyBrooks2018/damageToTerrestrialEcosystemsLandOccupation.py +1 -1
  3. hestia_earth/models/chaudharyBrooks2018/damageToTerrestrialEcosystemsLandTransformation.py +1 -1
  4. hestia_earth/models/chaudharyBrooks2018/damageToTerrestrialEcosystemsTotalLandUseEffects.py +3 -2
  5. hestia_earth/models/cml2001Baseline/eutrophicationPotentialExcludingFate.py +2 -2
  6. hestia_earth/models/cml2001Baseline/terrestrialAcidificationPotentialIncludingFateAverageEurope.py +2 -2
  7. hestia_earth/models/cml2001NonBaseline/eutrophicationPotentialIncludingFateAverageEurope.py +2 -2
  8. hestia_earth/models/cml2001NonBaseline/terrestrialAcidificationPotentialExcludingFate.py +2 -2
  9. hestia_earth/models/cycle/completeness/seed.py +6 -4
  10. hestia_earth/models/cycle/concentrateFeed.py +9 -4
  11. hestia_earth/models/cycle/endDate.py +10 -1
  12. hestia_earth/models/cycle/materialAndSubstrate.py +158 -0
  13. hestia_earth/models/cycle/milkYield.py +6 -5
  14. hestia_earth/models/cycle/startDate.py +6 -4
  15. hestia_earth/models/edip2003/ozoneDepletionPotential.py +2 -2
  16. hestia_earth/models/emissionNotRelevant/__init__.py +3 -2
  17. hestia_earth/models/environmentalFootprintV3/freshwaterEcotoxicityPotentialCtue.py +2 -3
  18. hestia_earth/models/hestia/landCover.py +28 -26
  19. hestia_earth/models/ipcc2013ExcludingFeedbacks/gwp100.py +2 -2
  20. hestia_earth/models/ipcc2013IncludingFeedbacks/gwp100.py +2 -2
  21. hestia_earth/models/ipcc2019/aboveGroundBiomass.py +4 -8
  22. hestia_earth/models/ipcc2019/animal/milkYieldPerAnimal.py +2 -2
  23. hestia_earth/models/ipcc2019/belowGroundBiomass.py +4 -8
  24. hestia_earth/models/ipcc2019/biomass_utils.py +11 -0
  25. hestia_earth/models/ipcc2019/ch4ToAirEntericFermentation.py +3 -3
  26. hestia_earth/models/ipcc2019/ch4ToAirExcreta.py +1 -2
  27. hestia_earth/models/ipcc2019/co2ToAirCarbonStockChange_utils.py +7 -3
  28. hestia_earth/models/ipcc2019/n2OToAirExcretaDirect.py +14 -9
  29. hestia_earth/models/ipcc2019/organicCarbonPerHa_tier_1_utils.py +9 -3
  30. hestia_earth/models/ipcc2019/organicCarbonPerHa_tier_2_utils.py +1 -2
  31. hestia_earth/models/koble2014/aboveGroundCropResidue.py +5 -1
  32. hestia_earth/models/lcImpactAllEffects100Years/damageToFreshwaterEcosystemsClimateChange.py +2 -2
  33. hestia_earth/models/lcImpactAllEffects100Years/damageToFreshwaterEcosystemsFreshwaterEcotoxicity.py +2 -3
  34. hestia_earth/models/lcImpactAllEffects100Years/damageToFreshwaterEcosystemsPdfYear.py +2 -2
  35. hestia_earth/models/lcImpactAllEffects100Years/damageToHumanHealth.py +2 -2
  36. hestia_earth/models/lcImpactAllEffects100Years/damageToHumanHealthClimateChange.py +2 -2
  37. hestia_earth/models/lcImpactAllEffects100Years/damageToHumanHealthHumanToxicityCancerogenic.py +2 -3
  38. hestia_earth/models/lcImpactAllEffects100Years/damageToHumanHealthHumanToxicityNonCancerogenic.py +2 -3
  39. hestia_earth/models/lcImpactAllEffects100Years/damageToHumanHealthStratosphericOzoneDepletion.py +2 -2
  40. hestia_earth/models/lcImpactAllEffects100Years/damageToMarineEcosystemsMarineEcotoxicity.py +2 -3
  41. hestia_earth/models/lcImpactAllEffects100Years/damageToMarineEcosystemsPdfYear.py +2 -2
  42. hestia_earth/models/lcImpactAllEffects100Years/damageToTerrestrialEcosystemsClimateChange.py +2 -2
  43. hestia_earth/models/lcImpactAllEffects100Years/damageToTerrestrialEcosystemsPdfYear.py +2 -2
  44. hestia_earth/models/lcImpactAllEffects100Years/damageToTerrestrialEcosystemsTerrestrialEcotoxicity.py +2 -3
  45. hestia_earth/models/lcImpactAllEffectsInfinite/damageToFreshwaterEcosystemsClimateChange.py +2 -2
  46. hestia_earth/models/lcImpactAllEffectsInfinite/damageToFreshwaterEcosystemsFreshwaterEcotoxicity.py +2 -3
  47. hestia_earth/models/lcImpactAllEffectsInfinite/damageToFreshwaterEcosystemsPdfYear.py +2 -2
  48. hestia_earth/models/lcImpactAllEffectsInfinite/damageToHumanHealth.py +2 -2
  49. hestia_earth/models/lcImpactAllEffectsInfinite/damageToHumanHealthClimateChange.py +2 -2
  50. hestia_earth/models/lcImpactAllEffectsInfinite/damageToHumanHealthHumanToxicityCancerogenic.py +2 -3
  51. hestia_earth/models/lcImpactAllEffectsInfinite/damageToHumanHealthHumanToxicityNonCancerogenic.py +2 -3
  52. hestia_earth/models/lcImpactAllEffectsInfinite/damageToHumanHealthStratosphericOzoneDepletion.py +2 -2
  53. hestia_earth/models/lcImpactAllEffectsInfinite/damageToMarineEcosystemsMarineEcotoxicity.py +2 -3
  54. hestia_earth/models/lcImpactAllEffectsInfinite/damageToMarineEcosystemsPdfYear.py +2 -2
  55. hestia_earth/models/lcImpactAllEffectsInfinite/damageToTerrestrialEcosystemsClimateChange.py +2 -2
  56. hestia_earth/models/lcImpactAllEffectsInfinite/damageToTerrestrialEcosystemsPdfYear.py +2 -2
  57. hestia_earth/models/lcImpactAllEffectsInfinite/damageToTerrestrialEcosystemsTerrestrialEcotoxicity.py +2 -3
  58. hestia_earth/models/lcImpactCertainEffects100Years/damageToFreshwaterEcosystemsFreshwaterEcotoxicity.py +2 -3
  59. hestia_earth/models/lcImpactCertainEffects100Years/damageToFreshwaterEcosystemsPdfYear.py +2 -2
  60. hestia_earth/models/lcImpactCertainEffects100Years/damageToHumanHealth.py +2 -2
  61. hestia_earth/models/lcImpactCertainEffects100Years/damageToHumanHealthClimateChange.py +2 -2
  62. hestia_earth/models/lcImpactCertainEffects100Years/damageToHumanHealthHumanToxicityCancerogenic.py +2 -3
  63. hestia_earth/models/lcImpactCertainEffects100Years/damageToHumanHealthHumanToxicityNonCancerogenic.py +2 -3
  64. hestia_earth/models/lcImpactCertainEffects100Years/damageToHumanHealthStratosphericOzoneDepletion.py +2 -2
  65. hestia_earth/models/lcImpactCertainEffects100Years/damageToMarineEcosystemsMarineEcotoxicity.py +2 -3
  66. hestia_earth/models/lcImpactCertainEffects100Years/damageToMarineEcosystemsPdfYear.py +2 -2
  67. hestia_earth/models/lcImpactCertainEffects100Years/damageToTerrestrialEcosystemsClimateChange.py +2 -2
  68. hestia_earth/models/lcImpactCertainEffects100Years/damageToTerrestrialEcosystemsPdfYear.py +2 -2
  69. hestia_earth/models/lcImpactCertainEffects100Years/damageToTerrestrialEcosystemsTerrestrialEcotoxicity.py +2 -3
  70. hestia_earth/models/lcImpactCertainEffectsInfinite/damageToFreshwaterEcosystemsFreshwaterEcotoxicity.py +2 -3
  71. hestia_earth/models/lcImpactCertainEffectsInfinite/damageToFreshwaterEcosystemsPdfYear.py +2 -2
  72. hestia_earth/models/lcImpactCertainEffectsInfinite/damageToHumanHealth.py +2 -2
  73. hestia_earth/models/lcImpactCertainEffectsInfinite/damageToHumanHealthClimateChange.py +2 -2
  74. hestia_earth/models/lcImpactCertainEffectsInfinite/damageToHumanHealthHumanToxicityCancerogenic.py +2 -3
  75. hestia_earth/models/lcImpactCertainEffectsInfinite/damageToHumanHealthHumanToxicityNonCancerogenic.py +2 -3
  76. hestia_earth/models/lcImpactCertainEffectsInfinite/damageToHumanHealthStratosphericOzoneDepletion.py +2 -2
  77. hestia_earth/models/lcImpactCertainEffectsInfinite/damageToMarineEcosystemsMarineEcotoxicity.py +2 -3
  78. hestia_earth/models/lcImpactCertainEffectsInfinite/damageToMarineEcosystemsPdfYear.py +2 -2
  79. hestia_earth/models/lcImpactCertainEffectsInfinite/damageToTerrestrialEcosystemsClimateChange.py +2 -2
  80. hestia_earth/models/lcImpactCertainEffectsInfinite/damageToTerrestrialEcosystemsPdfYear.py +2 -2
  81. hestia_earth/models/lcImpactCertainEffectsInfinite/damageToTerrestrialEcosystemsTerrestrialEcotoxicity.py +2 -3
  82. hestia_earth/models/linkedImpactAssessment/emissions.py +3 -0
  83. hestia_earth/models/log.py +4 -3
  84. hestia_earth/models/mocking/__init__.py +1 -1
  85. hestia_earth/models/mocking/search-results.json +1021 -1021
  86. hestia_earth/models/pooreNemecek2018/excretaKgN.py +4 -4
  87. hestia_earth/models/pooreNemecek2018/excretaKgVs.py +4 -4
  88. hestia_earth/models/pooreNemecek2018/no3ToGroundwaterCropResidueDecomposition.py +1 -1
  89. hestia_earth/models/pooreNemecek2018/no3ToGroundwaterExcreta.py +1 -1
  90. hestia_earth/models/pooreNemecek2018/no3ToGroundwaterInorganicFertiliser.py +1 -1
  91. hestia_earth/models/pooreNemecek2018/no3ToGroundwaterOrganicFertiliser.py +1 -1
  92. hestia_earth/models/pooreNemecek2018/{saplings.py → saplingsDepreciatedAmountPerCycle.py} +1 -1
  93. hestia_earth/models/pooreNemecek2018/utils.py +7 -1
  94. hestia_earth/models/preload_requests.py +24 -4
  95. hestia_earth/models/recipe2016Egalitarian/damageToFreshwaterEcosystemsSpeciesYear.py +2 -2
  96. hestia_earth/models/recipe2016Egalitarian/damageToHumanHealth.py +2 -2
  97. hestia_earth/models/recipe2016Egalitarian/damageToMarineEcosystemsSpeciesYear.py +2 -2
  98. hestia_earth/models/recipe2016Egalitarian/damageToTerrestrialEcosystemsSpeciesYear.py +2 -2
  99. hestia_earth/models/recipe2016Egalitarian/freshwaterAquaticEcotoxicityPotential14Dcbeq.py +2 -3
  100. hestia_earth/models/recipe2016Egalitarian/freshwaterEutrophicationPotential.py +2 -2
  101. hestia_earth/models/recipe2016Egalitarian/humanCarcinogenicToxicity.py +2 -3
  102. hestia_earth/models/recipe2016Egalitarian/humanNonCarcinogenicToxicity.py +2 -3
  103. hestia_earth/models/recipe2016Egalitarian/marineAquaticEcotoxicityPotential14Dcbeq.py +2 -3
  104. hestia_earth/models/recipe2016Egalitarian/marineEutrophicationPotential.py +2 -2
  105. hestia_earth/models/recipe2016Egalitarian/ozoneDepletionPotential.py +2 -2
  106. hestia_earth/models/recipe2016Egalitarian/terrestrialAcidificationPotential.py +2 -2
  107. hestia_earth/models/recipe2016Egalitarian/terrestrialEcotoxicityPotential14Dcbeq.py +2 -3
  108. hestia_earth/models/recipe2016Hierarchist/damageToFreshwaterEcosystemsSpeciesYear.py +2 -2
  109. hestia_earth/models/recipe2016Hierarchist/damageToHumanHealth.py +2 -2
  110. hestia_earth/models/recipe2016Hierarchist/damageToMarineEcosystemsSpeciesYear.py +2 -2
  111. hestia_earth/models/recipe2016Hierarchist/damageToTerrestrialEcosystemsSpeciesYear.py +2 -2
  112. hestia_earth/models/recipe2016Hierarchist/freshwaterAquaticEcotoxicityPotential14Dcbeq.py +2 -3
  113. hestia_earth/models/recipe2016Hierarchist/freshwaterEutrophicationPotential.py +2 -2
  114. hestia_earth/models/recipe2016Hierarchist/humanCarcinogenicToxicity.py +2 -3
  115. hestia_earth/models/recipe2016Hierarchist/humanNonCarcinogenicToxicity.py +2 -3
  116. hestia_earth/models/recipe2016Hierarchist/marineAquaticEcotoxicityPotential14Dcbeq.py +2 -3
  117. hestia_earth/models/recipe2016Hierarchist/marineEutrophicationPotential.py +2 -2
  118. hestia_earth/models/recipe2016Hierarchist/ozoneDepletionPotential.py +2 -2
  119. hestia_earth/models/recipe2016Hierarchist/terrestrialAcidificationPotential.py +2 -2
  120. hestia_earth/models/recipe2016Hierarchist/terrestrialEcotoxicityPotential14Dcbeq.py +2 -3
  121. hestia_earth/models/recipe2016Individualist/damageToFreshwaterEcosystemsSpeciesYear.py +2 -2
  122. hestia_earth/models/recipe2016Individualist/damageToHumanHealth.py +2 -2
  123. hestia_earth/models/recipe2016Individualist/damageToMarineEcosystemsSpeciesYear.py +2 -2
  124. hestia_earth/models/recipe2016Individualist/damageToTerrestrialEcosystemsSpeciesYear.py +2 -2
  125. hestia_earth/models/recipe2016Individualist/freshwaterAquaticEcotoxicityPotential14Dcbeq.py +2 -3
  126. hestia_earth/models/recipe2016Individualist/freshwaterEutrophicationPotential.py +2 -2
  127. hestia_earth/models/recipe2016Individualist/humanCarcinogenicToxicity.py +2 -3
  128. hestia_earth/models/recipe2016Individualist/humanNonCarcinogenicToxicity.py +2 -3
  129. hestia_earth/models/recipe2016Individualist/marineAquaticEcotoxicityPotential14Dcbeq.py +2 -3
  130. hestia_earth/models/recipe2016Individualist/marineEutrophicationPotential.py +2 -2
  131. hestia_earth/models/recipe2016Individualist/ozoneDepletionPotential.py +2 -2
  132. hestia_earth/models/recipe2016Individualist/terrestrialAcidificationPotential.py +2 -2
  133. hestia_earth/models/recipe2016Individualist/terrestrialEcotoxicityPotential14Dcbeq.py +2 -3
  134. hestia_earth/models/site/management.py +142 -144
  135. hestia_earth/models/stehfestBouwman2006/n2OToAirCropResidueDecompositionDirect.py +1 -1
  136. hestia_earth/models/stehfestBouwman2006/n2OToAirExcretaDirect.py +1 -1
  137. hestia_earth/models/stehfestBouwman2006/n2OToAirInorganicFertiliserDirect.py +1 -1
  138. hestia_earth/models/stehfestBouwman2006/n2OToAirOrganicFertiliserDirect.py +1 -1
  139. hestia_earth/models/stehfestBouwman2006/noxToAirCropResidueDecomposition.py +1 -1
  140. hestia_earth/models/stehfestBouwman2006/noxToAirExcreta.py +1 -1
  141. hestia_earth/models/stehfestBouwman2006/noxToAirInorganicFertiliser.py +1 -1
  142. hestia_earth/models/stehfestBouwman2006/noxToAirOrganicFertiliser.py +1 -1
  143. hestia_earth/models/stehfestBouwman2006GisImplementation/noxToAirCropResidueDecomposition.py +1 -1
  144. hestia_earth/models/stehfestBouwman2006GisImplementation/noxToAirExcreta.py +1 -1
  145. hestia_earth/models/stehfestBouwman2006GisImplementation/noxToAirInorganicFertiliser.py +1 -1
  146. hestia_earth/models/stehfestBouwman2006GisImplementation/noxToAirOrganicFertiliser.py +1 -1
  147. hestia_earth/models/usetoxV2/freshwaterEcotoxicityPotentialCtue.py +2 -3
  148. hestia_earth/models/utils/__init__.py +4 -1
  149. hestia_earth/models/utils/blank_node.py +34 -14
  150. hestia_earth/models/utils/constant.py +3 -0
  151. hestia_earth/models/utils/emission.py +1 -8
  152. hestia_earth/models/utils/management.py +11 -0
  153. hestia_earth/models/utils/pesticideAI.py +11 -17
  154. hestia_earth/models/utils/term.py +2 -1
  155. hestia_earth/models/version.py +1 -1
  156. {hestia_earth_models-0.64.12.dist-info → hestia_earth_models-0.64.14.dist-info}/METADATA +4 -4
  157. {hestia_earth_models-0.64.12.dist-info → hestia_earth_models-0.64.14.dist-info}/RECORD +186 -187
  158. {hestia_earth_models-0.64.12.dist-info → hestia_earth_models-0.64.14.dist-info}/WHEEL +1 -1
  159. tests/models/cycle/completeness/test_seed.py +1 -1
  160. tests/models/cycle/test_endDate.py +18 -2
  161. tests/models/cycle/test_materialsAndSubstrate.py +49 -0
  162. tests/models/cycle/test_startDate.py +21 -3
  163. tests/models/hestia/test_landCover.py +3 -2
  164. tests/models/ipcc2019/test_aboveGroundBiomass.py +2 -1
  165. tests/models/ipcc2019/test_belowGroundBiomass.py +2 -1
  166. tests/models/ipcc2019/test_co2ToAirAboveGroundBiomassStockChange.py +4 -3
  167. tests/models/ipcc2019/test_co2ToAirBelowGroundBiomassStockChange.py +3 -3
  168. tests/models/ipcc2019/test_co2ToAirSoilOrganicCarbonStockChange.py +1 -1
  169. tests/models/ipcc2019/test_n2OToAirExcretaDirect.py +12 -0
  170. tests/models/ipcc2019/test_organicCarbonPerHa.py +1 -0
  171. tests/models/koble2014/test_aboveGroundCropResidue.py +13 -0
  172. tests/models/pooreNemecek2018/test_no3ToGroundwaterCropResidueDecomposition.py +3 -2
  173. tests/models/pooreNemecek2018/test_no3ToGroundwaterExcreta.py +3 -2
  174. tests/models/pooreNemecek2018/test_no3ToGroundwaterInorganicFertiliser.py +3 -2
  175. tests/models/pooreNemecek2018/test_no3ToGroundwaterOrganicFertiliser.py +3 -2
  176. tests/models/pooreNemecek2018/{test_saplings.py → test_saplingsDepreciatedAmountPerCycle.py} +1 -1
  177. tests/models/site/test_management.py +18 -151
  178. tests/models/utils/test_blank_node.py +57 -1
  179. tests/models/utils/test_emission.py +1 -6
  180. tests/models/utils/test_site.py +33 -2
  181. tests/models/pooreNemecek2018/test_no3ToGroundwaterSoilFlux.py +0 -90
  182. tests/models/stehfestBouwman2006/test_n2OToAirSoilFlux.py +0 -41
  183. tests/models/stehfestBouwman2006/test_noxToAirSoilFlux.py +0 -40
  184. tests/models/stehfestBouwman2006GisImplementation/test_noxToAirSoilFlux.py +0 -33
  185. /hestia_earth/models/pooreNemecek2018/{no3ToGroundwaterSoilFlux.py → no3ToGroundwaterSoilFlux_utils.py} +0 -0
  186. /hestia_earth/models/stehfestBouwman2006/{n2OToAirSoilFlux.py → n2OToAirSoilFlux_utils.py} +0 -0
  187. /hestia_earth/models/stehfestBouwman2006/{noxToAirSoilFlux.py → noxToAirSoilFlux_utils.py} +0 -0
  188. /hestia_earth/models/stehfestBouwman2006GisImplementation/{noxToAirSoilFlux.py → noxToAirSoilFlux_utils.py} +0 -0
  189. {hestia_earth_models-0.64.12.dist-info → hestia_earth_models-0.64.14.dist-info}/LICENSE +0 -0
  190. {hestia_earth_models-0.64.12.dist-info → hestia_earth_models-0.64.14.dist-info}/top_level.txt +0 -0
@@ -5,9 +5,12 @@ from numpy import random
5
5
  from numpy.typing import NDArray
6
6
  from typing import Callable, Optional, Union
7
7
 
8
+ from hestia_earth.schema import TermTermType
8
9
  from hestia_earth.utils.blank_node import get_node_value
10
+ from hestia_earth.utils.model import filter_list_term_type
9
11
 
10
12
  from hestia_earth.models.utils.array_builders import repeat_single, truncated_normal_1d
13
+ from hestia_earth.models.utils.blank_node import validate_start_date_end_date
11
14
  from hestia_earth.models.utils.ecoClimateZone import EcoClimateZone, get_ecoClimateZone_lookup_grouped_value
12
15
  from hestia_earth.models.utils.term import get_lookup_value
13
16
 
@@ -404,3 +407,11 @@ _KWARGS_TO_SAMPLE_FUNC = {
404
407
  ("value", "error"): sample_plus_minus_error,
405
408
  ("value",): sample_constant
406
409
  }
410
+
411
+
412
+ def get_valid_land_cover_terms(site: dict) -> list[dict]:
413
+ """Retrieve valid `landCover` nodes from a site's management."""
414
+ return [
415
+ node for node in filter_list_term_type(site.get("management", []), TermTermType.LANDCOVER)
416
+ if validate_start_date_end_date(node)
417
+ ]
@@ -141,10 +141,10 @@ DE_MAPPING = {
141
141
  def _get_grouped_data_key(keys: list, DE: float, NDF: float, ionophore: bool, milk_yield: float):
142
142
  # test conditions one by one and return the key associated for the first one that passes
143
143
  return (
144
- next(
144
+ (next(
145
145
  (key for key in keys if key in DE_NDF_MAPPING and DE_NDF_MAPPING[key](DE, NDF)),
146
146
  None
147
- ) or next(
147
+ ) if all([DE is not None, NDF is not None]) else None) or next(
148
148
  (key for key in keys if key in DE_MAPPING and DE_MAPPING[key](DE, ionophore)),
149
149
  None
150
150
  ) if DE else None
@@ -250,7 +250,7 @@ def _should_run(cycle: dict):
250
250
  milk_yield=milk_yield,
251
251
  enteric_factor=enteric_factor,
252
252
  enteric_sd=enteric_sd,
253
- default_values=default_values)
253
+ default_values=';'.join(map(str, default_values)))
254
254
 
255
255
  logRequirements(cycle, model=MODEL, term=TERM_ID,
256
256
  term_type_animalFeed_complete=is_animalFeed_complete,
@@ -6,7 +6,7 @@ from hestia_earth.utils.tools import safe_parse_float, list_sum
6
6
 
7
7
  from hestia_earth.models.log import debugValues, logRequirements, debugMissingLookup, logShouldRun, log_as_table
8
8
  from hestia_earth.models.utils import _filter_list_term_unit
9
- from hestia_earth.models.utils.constant import Units
9
+ from hestia_earth.models.utils.constant import Units, DAYS_PER_MONTH
10
10
  from hestia_earth.models.utils.completeness import _is_term_type_complete
11
11
  from hestia_earth.models.utils.productivity import PRODUCTIVITY, get_productivity
12
12
  from hestia_earth.models.utils.emission import _new_emission
@@ -40,7 +40,6 @@ RETURNS = {
40
40
  }
41
41
  TERM_ID = 'ch4ToAirExcreta'
42
42
  TIER = EmissionMethodTier.TIER_2.value
43
- DAYS_PER_MONTH = 365.25/12
44
43
 
45
44
 
46
45
  class DURATION(Enum):
@@ -24,7 +24,7 @@ from hestia_earth.models.utils import pairwise
24
24
  from hestia_earth.models.utils.array_builders import correlated_normal_2d, gen_seed
25
25
  from hestia_earth.models.utils.blank_node import (
26
26
  _gapfill_datestr, _get_datestr_format, DatestrGapfillMode, DatestrFormat, group_nodes_by_year, node_term_match,
27
- split_node_by_dates
27
+ split_node_by_dates, validate_start_date_end_date
28
28
  )
29
29
  from hestia_earth.models.utils.constant import Units, get_atomic_conversion
30
30
  from hestia_earth.models.utils.descriptive_stats import calc_descriptive_stats
@@ -408,7 +408,8 @@ def create_should_run_function(
408
408
  cycles = related_cycles(site)
409
409
 
410
410
  carbon_stock_measurements = [
411
- node for node in site.get("measurements", []) if all([
411
+ node for node in site.get("measurements", [])
412
+ if all([
412
413
  node_term_match(node, carbon_stock_term_id),
413
414
  _has_valid_array_fields(node),
414
415
  _has_valid_dates(node),
@@ -417,7 +418,10 @@ def create_should_run_function(
417
418
  ])
418
419
  ]
419
420
 
420
- land_cover_nodes = filter_list_term_type(site.get("management", []), TermTermType.LANDCOVER)
421
+ land_cover_nodes = [
422
+ node for node in filter_list_term_type(site.get("management", []), TermTermType.LANDCOVER)
423
+ if validate_start_date_end_date(node)
424
+ ]
421
425
 
422
426
  seed = gen_seed(site) # All cycles linked to the same site should be consistent
423
427
  rng = random.default_rng(seed)
@@ -10,7 +10,12 @@ from . import MODEL
10
10
 
11
11
  REQUIREMENTS = {
12
12
  "Cycle": {
13
- "completeness.excreta": "True",
13
+ "or": {
14
+ "completeness.excreta": "True",
15
+ "inputs": [
16
+ {"@type": "Input", "term.termType": "excreta", "units": "kg N"}
17
+ ]
18
+ },
14
19
  "practices": [
15
20
  {"@type": "Practice", "value": "", "term.termType": "excretaManagement"}
16
21
  ]
@@ -36,26 +41,26 @@ def _emission(value: float):
36
41
  return emission
37
42
 
38
43
 
39
- def _run(excretaKgN: float, N2O_N_EF: float):
40
- value = N2O_N_EF * excretaKgN * get_atomic_conversion(Units.KG_N2O, Units.TO_N)
44
+ def _run(N_total: float, N2O_N_EF: float):
45
+ value = (N2O_N_EF or 0) * (N_total or 0) * get_atomic_conversion(Units.KG_N2O, Units.TO_N)
41
46
  return [_emission(value)]
42
47
 
43
48
 
44
49
  def _should_run(cycle: dict):
45
- excretaKgN = total_excreta(cycle.get('inputs', []))
50
+ N_total = total_excreta(cycle.get('inputs', []))
46
51
  N2O_N_EF = get_lookup_factor(cycle.get('practices', []), LOOKUPS['excretaManagement'])
47
52
  term_type_complete = _is_term_type_complete(cycle, TermTermType.EXCRETA)
48
53
 
49
54
  logRequirements(cycle, model=MODEL, term=TERM_ID,
50
- excretaKgN=excretaKgN,
55
+ N_total=N_total,
51
56
  N2O_N_EF=N2O_N_EF,
52
57
  term_type_excreta_complete=term_type_complete)
53
58
 
54
- should_run = all([excretaKgN, N2O_N_EF])
59
+ should_run = all([N_total, N2O_N_EF]) or all([not N_total, term_type_complete])
55
60
  logShouldRun(cycle, MODEL, TERM_ID, should_run, methodTier=TIER)
56
- return should_run, excretaKgN, N2O_N_EF
61
+ return should_run, N_total, N2O_N_EF
57
62
 
58
63
 
59
64
  def run(cycle: dict):
60
- should_run, excretaKgN, N2O_N_EF = _should_run(cycle)
61
- return _run(excretaKgN, N2O_N_EF) if should_run else []
65
+ should_run, N_total, N2O_N_EF = _should_run(cycle)
66
+ return _run(N_total, N2O_N_EF) if should_run else []
@@ -24,7 +24,7 @@ from hestia_earth.utils.blank_node import get_node_value
24
24
  from hestia_earth.models.utils.array_builders import gen_seed
25
25
  from hestia_earth.models.utils.blank_node import (
26
26
  cumulative_nodes_match, cumulative_nodes_lookup_match, cumulative_nodes_term_match,
27
- node_lookup_match, node_term_match, group_nodes_by_year
27
+ node_lookup_match, node_term_match, group_nodes_by_year, validate_start_date_end_date
28
28
  )
29
29
  from hestia_earth.models.utils.ecoClimateZone import EcoClimateZone, get_eco_climate_zone_value
30
30
  from hestia_earth.models.utils.descriptive_stats import calc_descriptive_stats
@@ -1209,8 +1209,14 @@ def _assign_ipcc_land_use_category(
1209
1209
  DECISION_TREE = _LAND_USE_CATEGORY_DECISION_TREE
1210
1210
  DEFAULT = IpccLandUseCategory.OTHER
1211
1211
 
1212
- land_cover_nodes = filter_list_term_type(management_nodes, [TermTermType.LANDCOVER])
1213
- water_regime_nodes = filter_list_term_type(management_nodes, [TermTermType.WATERREGIME])
1212
+ land_cover_nodes = [
1213
+ node for node in filter_list_term_type(management_nodes, [TermTermType.LANDCOVER])
1214
+ if validate_start_date_end_date(node)
1215
+ ]
1216
+ water_regime_nodes = [
1217
+ node for node in filter_list_term_type(management_nodes, [TermTermType.WATERREGIME])
1218
+ if validate_start_date_end_date(node)
1219
+ ]
1214
1220
 
1215
1221
  has_irrigation = check_irrigation(water_regime_nodes)
1216
1222
  has_upland_rice = _has_upland_rice(land_cover_nodes)
@@ -1271,8 +1271,7 @@ def _get_irrigated_monthly(year: int, cycles: list[dict]) -> list[bool]:
1271
1271
  irrigation_nodes = non_empty_list(flatten([
1272
1272
  [
1273
1273
  {
1274
- "startDate": cycle.get("startDate"),
1275
- "endDate": cycle.get("endDate"),
1274
+ **{key: cycle.get(key) for key in ["startDate", "endDate"] if cycle.get(key)},
1276
1275
  **node
1277
1276
  } for node in cycle.get("practices", [])
1278
1277
  ] for cycle in cycles
@@ -94,6 +94,10 @@ def _model_value(term_id: str, products: list):
94
94
  return list_average(values) if len(values) > 0 else 0
95
95
 
96
96
 
97
+ def _remaining_model_value(products: list):
98
+ return list_sum(find_term_match(products, REMAINING_MODEL).get('value', []), 0)
99
+
100
+
97
101
  def _run(cycle: dict, total_values: list):
98
102
  products = cycle.get('products', [])
99
103
  total_value = list_average(total_values)
@@ -126,7 +130,7 @@ def _run(cycle: dict, total_values: list):
126
130
 
127
131
  return values + [
128
132
  # whatever remains is "left on field"
129
- _product(REMAINING_MODEL, remaining_value)
133
+ _product(REMAINING_MODEL, remaining_value + _remaining_model_value(products))
130
134
  ] if remaining_value > 0 else values
131
135
 
132
136
 
@@ -29,5 +29,5 @@ def run(impact_assessment: dict):
29
29
  value = impact_emission_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['emission'])
30
30
  logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
31
31
  value=value)
32
- logShouldRun(impact_assessment, MODEL, TERM_ID, True)
33
- return _indicator(value)
32
+ logShouldRun(impact_assessment, MODEL, TERM_ID, value is not None)
33
+ return _indicator(value) if value is not None else None
@@ -1,5 +1,5 @@
1
1
  from hestia_earth.models.utils.indicator import _new_indicator
2
- from hestia_earth.models.utils.pesticideAI import impact_lookup_value, impact_value_set_none
2
+ from hestia_earth.models.utils.pesticideAI import impact_lookup_value
3
3
  from . import MODEL
4
4
 
5
5
  REQUIREMENTS = {
@@ -30,5 +30,4 @@ def _indicator(value: float):
30
30
 
31
31
  def run(impact_assessment: dict):
32
32
  value = impact_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['pesticideAI'])
33
- should_run = any([value is not None, impact_value_set_none(impact_assessment)])
34
- return _indicator(value) if should_run else None
33
+ return _indicator(value) if value is not None else None
@@ -33,5 +33,5 @@ def run(impact_assessment: dict):
33
33
  value = impact_endpoint_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['characterisedIndicator'])
34
34
  logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
35
35
  value=value)
36
- logShouldRun(impact_assessment, MODEL, TERM_ID, True)
37
- return _indicator(value)
36
+ logShouldRun(impact_assessment, MODEL, TERM_ID, value is not None)
37
+ return _indicator(value) if value is not None else None
@@ -33,5 +33,5 @@ def run(impact_assessment: dict):
33
33
  value = impact_endpoint_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['characterisedIndicator'])
34
34
  logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
35
35
  value=value)
36
- logShouldRun(impact_assessment, MODEL, TERM_ID, True)
37
- return _indicator(value)
36
+ logShouldRun(impact_assessment, MODEL, TERM_ID, value is not None)
37
+ return _indicator(value) if value is not None else None
@@ -29,5 +29,5 @@ def run(impact_assessment: dict):
29
29
  value = impact_emission_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['emission'])
30
30
  logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
31
31
  value=value)
32
- logShouldRun(impact_assessment, MODEL, TERM_ID, True)
33
- return _indicator(value)
32
+ logShouldRun(impact_assessment, MODEL, TERM_ID, value is not None)
33
+ return _indicator(value) if value is not None else None
@@ -1,5 +1,5 @@
1
1
  from hestia_earth.models.utils.indicator import _new_indicator
2
- from hestia_earth.models.utils.pesticideAI import impact_lookup_value, impact_value_set_none
2
+ from hestia_earth.models.utils.pesticideAI import impact_lookup_value
3
3
  from . import MODEL
4
4
 
5
5
  REQUIREMENTS = {
@@ -30,5 +30,4 @@ def _indicator(value: float):
30
30
 
31
31
  def run(impact_assessment: dict):
32
32
  value = impact_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['pesticideAI'])
33
- should_run = any([value is not None, impact_value_set_none(impact_assessment)])
34
- return _indicator(value) if should_run else None
33
+ return _indicator(value) if value is not None else None
@@ -1,5 +1,5 @@
1
1
  from hestia_earth.models.utils.indicator import _new_indicator
2
- from hestia_earth.models.utils.pesticideAI import impact_lookup_value, impact_value_set_none
2
+ from hestia_earth.models.utils.pesticideAI import impact_lookup_value
3
3
  from . import MODEL
4
4
 
5
5
  REQUIREMENTS = {
@@ -30,5 +30,4 @@ def _indicator(value: float):
30
30
 
31
31
  def run(impact_assessment: dict):
32
32
  value = impact_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['pesticideAI'])
33
- should_run = any([value is not None, impact_value_set_none(impact_assessment)])
34
- return _indicator(value) if should_run else None
33
+ return _indicator(value) if value is not None else None
@@ -29,5 +29,5 @@ def run(impact_assessment: dict):
29
29
  value = impact_emission_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['emission'])
30
30
  logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
31
31
  value=value)
32
- logShouldRun(impact_assessment, MODEL, TERM_ID, True)
33
- return _indicator(value)
32
+ logShouldRun(impact_assessment, MODEL, TERM_ID, value is not None)
33
+ return _indicator(value) if value is not None else None
@@ -1,5 +1,5 @@
1
1
  from hestia_earth.models.utils.indicator import _new_indicator
2
- from hestia_earth.models.utils.pesticideAI import impact_lookup_value, impact_value_set_none
2
+ from hestia_earth.models.utils.pesticideAI import impact_lookup_value
3
3
  from . import MODEL
4
4
 
5
5
  REQUIREMENTS = {
@@ -30,5 +30,4 @@ def _indicator(value: float):
30
30
 
31
31
  def run(impact_assessment: dict):
32
32
  value = impact_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['pesticideAI'])
33
- should_run = any([value is not None, impact_value_set_none(impact_assessment)])
34
- return _indicator(value) if should_run else None
33
+ return _indicator(value) if value is not None else None
@@ -33,5 +33,5 @@ def run(impact_assessment: dict):
33
33
  value = impact_endpoint_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['characterisedIndicator'])
34
34
  logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
35
35
  value=value)
36
- logShouldRun(impact_assessment, MODEL, TERM_ID, True)
37
- return _indicator(value)
36
+ logShouldRun(impact_assessment, MODEL, TERM_ID, value is not None)
37
+ return _indicator(value) if value is not None else None
@@ -29,5 +29,5 @@ def run(impact_assessment: dict):
29
29
  value = impact_emission_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['emission'])
30
30
  logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
31
31
  value=value)
32
- logShouldRun(impact_assessment, MODEL, TERM_ID, True)
33
- return _indicator(value)
32
+ logShouldRun(impact_assessment, MODEL, TERM_ID, value is not None)
33
+ return _indicator(value) if value is not None else None
@@ -33,5 +33,5 @@ def run(impact_assessment: dict):
33
33
  value = impact_endpoint_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['characterisedIndicator'])
34
34
  logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
35
35
  value=value)
36
- logShouldRun(impact_assessment, MODEL, TERM_ID, True)
37
- return _indicator(value)
36
+ logShouldRun(impact_assessment, MODEL, TERM_ID, value is not None)
37
+ return _indicator(value) if value is not None else None
@@ -1,5 +1,5 @@
1
1
  from hestia_earth.models.utils.indicator import _new_indicator
2
- from hestia_earth.models.utils.pesticideAI import impact_lookup_value, impact_value_set_none
2
+ from hestia_earth.models.utils.pesticideAI import impact_lookup_value
3
3
  from . import MODEL
4
4
 
5
5
  REQUIREMENTS = {
@@ -30,5 +30,4 @@ def _indicator(value: float):
30
30
 
31
31
  def run(impact_assessment: dict):
32
32
  value = impact_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['pesticideAI'])
33
- should_run = any([value is not None, impact_value_set_none(impact_assessment)])
34
- return _indicator(value) if should_run else None
33
+ return _indicator(value) if value is not None else None
@@ -29,5 +29,5 @@ def run(impact_assessment: dict):
29
29
  value = impact_emission_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['emission'])
30
30
  logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
31
31
  value=value)
32
- logShouldRun(impact_assessment, MODEL, TERM_ID, True)
33
- return _indicator(value)
32
+ logShouldRun(impact_assessment, MODEL, TERM_ID, value is not None)
33
+ return _indicator(value) if value is not None else None
@@ -1,5 +1,5 @@
1
1
  from hestia_earth.models.utils.indicator import _new_indicator
2
- from hestia_earth.models.utils.pesticideAI import impact_lookup_value, impact_value_set_none
2
+ from hestia_earth.models.utils.pesticideAI import impact_lookup_value
3
3
  from . import MODEL
4
4
 
5
5
  REQUIREMENTS = {
@@ -30,5 +30,4 @@ def _indicator(value: float):
30
30
 
31
31
  def run(impact_assessment: dict):
32
32
  value = impact_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['pesticideAI'])
33
- should_run = any([value is not None, impact_value_set_none(impact_assessment)])
34
- return _indicator(value) if should_run else None
33
+ return _indicator(value) if value is not None else None
@@ -33,5 +33,5 @@ def run(impact_assessment: dict):
33
33
  value = impact_endpoint_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['characterisedIndicator'])
34
34
  logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
35
35
  value=value)
36
- logShouldRun(impact_assessment, MODEL, TERM_ID, True)
37
- return _indicator(value)
36
+ logShouldRun(impact_assessment, MODEL, TERM_ID, value is not None)
37
+ return _indicator(value) if value is not None else None
@@ -33,5 +33,5 @@ def run(impact_assessment: dict):
33
33
  value = impact_endpoint_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['characterisedIndicator'])
34
34
  logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
35
35
  value=value)
36
- logShouldRun(impact_assessment, MODEL, TERM_ID, True)
37
- return _indicator(value)
36
+ logShouldRun(impact_assessment, MODEL, TERM_ID, value is not None)
37
+ return _indicator(value) if value is not None else None
@@ -29,5 +29,5 @@ def run(impact_assessment: dict):
29
29
  value = impact_emission_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['emission'])
30
30
  logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
31
31
  value=value)
32
- logShouldRun(impact_assessment, MODEL, TERM_ID, True)
33
- return _indicator(value)
32
+ logShouldRun(impact_assessment, MODEL, TERM_ID, value is not None)
33
+ return _indicator(value) if value is not None else None
@@ -1,5 +1,5 @@
1
1
  from hestia_earth.models.utils.indicator import _new_indicator
2
- from hestia_earth.models.utils.pesticideAI import impact_lookup_value, impact_value_set_none
2
+ from hestia_earth.models.utils.pesticideAI import impact_lookup_value
3
3
  from . import MODEL
4
4
 
5
5
  REQUIREMENTS = {
@@ -30,5 +30,4 @@ def _indicator(value: float):
30
30
 
31
31
  def run(impact_assessment: dict):
32
32
  value = impact_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['pesticideAI'])
33
- should_run = any([value is not None, impact_value_set_none(impact_assessment)])
34
- return _indicator(value) if should_run else None
33
+ return _indicator(value) if value is not None else None
@@ -1,5 +1,5 @@
1
1
  from hestia_earth.models.utils.indicator import _new_indicator
2
- from hestia_earth.models.utils.pesticideAI import impact_lookup_value, impact_value_set_none
2
+ from hestia_earth.models.utils.pesticideAI import impact_lookup_value
3
3
  from . import MODEL
4
4
 
5
5
  REQUIREMENTS = {
@@ -30,5 +30,4 @@ def _indicator(value: float):
30
30
 
31
31
  def run(impact_assessment: dict):
32
32
  value = impact_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['pesticideAI'])
33
- should_run = any([value is not None, impact_value_set_none(impact_assessment)])
34
- return _indicator(value) if should_run else None
33
+ return _indicator(value) if value is not None else None
@@ -29,5 +29,5 @@ def run(impact_assessment: dict):
29
29
  value = impact_emission_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['emission'])
30
30
  logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
31
31
  value=value)
32
- logShouldRun(impact_assessment, MODEL, TERM_ID, True)
33
- return _indicator(value)
32
+ logShouldRun(impact_assessment, MODEL, TERM_ID, value is not None)
33
+ return _indicator(value) if value is not None else None
@@ -1,5 +1,5 @@
1
1
  from hestia_earth.models.utils.indicator import _new_indicator
2
- from hestia_earth.models.utils.pesticideAI import impact_lookup_value, impact_value_set_none
2
+ from hestia_earth.models.utils.pesticideAI import impact_lookup_value
3
3
  from . import MODEL
4
4
 
5
5
  REQUIREMENTS = {
@@ -30,5 +30,4 @@ def _indicator(value: float):
30
30
 
31
31
  def run(impact_assessment: dict):
32
32
  value = impact_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['pesticideAI'])
33
- should_run = any([value is not None, impact_value_set_none(impact_assessment)])
34
- return _indicator(value) if should_run else None
33
+ return _indicator(value) if value is not None else None
@@ -33,5 +33,5 @@ def run(impact_assessment: dict):
33
33
  value = impact_endpoint_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['characterisedIndicator'])
34
34
  logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
35
35
  value=value)
36
- logShouldRun(impact_assessment, MODEL, TERM_ID, True)
37
- return _indicator(value)
36
+ logShouldRun(impact_assessment, MODEL, TERM_ID, value is not None)
37
+ return _indicator(value) if value is not None else None
@@ -29,5 +29,5 @@ def run(impact_assessment: dict):
29
29
  value = impact_emission_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['emission'])
30
30
  logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
31
31
  value=value)
32
- logShouldRun(impact_assessment, MODEL, TERM_ID, True)
33
- return _indicator(value)
32
+ logShouldRun(impact_assessment, MODEL, TERM_ID, value is not None)
33
+ return _indicator(value) if value is not None else None
@@ -33,5 +33,5 @@ def run(impact_assessment: dict):
33
33
  value = impact_endpoint_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['characterisedIndicator'])
34
34
  logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
35
35
  value=value)
36
- logShouldRun(impact_assessment, MODEL, TERM_ID, True)
37
- return _indicator(value)
36
+ logShouldRun(impact_assessment, MODEL, TERM_ID, value is not None)
37
+ return _indicator(value) if value is not None else None
@@ -1,5 +1,5 @@
1
1
  from hestia_earth.models.utils.indicator import _new_indicator
2
- from hestia_earth.models.utils.pesticideAI import impact_lookup_value, impact_value_set_none
2
+ from hestia_earth.models.utils.pesticideAI import impact_lookup_value
3
3
  from . import MODEL
4
4
 
5
5
  REQUIREMENTS = {
@@ -30,5 +30,4 @@ def _indicator(value: float):
30
30
 
31
31
  def run(impact_assessment: dict):
32
32
  value = impact_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['pesticideAI'])
33
- should_run = any([value is not None, impact_value_set_none(impact_assessment)])
34
- return _indicator(value) if should_run else None
33
+ return _indicator(value) if value is not None else None
@@ -1,5 +1,5 @@
1
1
  from hestia_earth.models.utils.indicator import _new_indicator
2
- from hestia_earth.models.utils.pesticideAI import impact_lookup_value, impact_value_set_none
2
+ from hestia_earth.models.utils.pesticideAI import impact_lookup_value
3
3
  from . import MODEL
4
4
 
5
5
  REQUIREMENTS = {
@@ -30,5 +30,4 @@ def _indicator(value: float):
30
30
 
31
31
  def run(impact_assessment: dict):
32
32
  value = impact_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['pesticideAI'])
33
- should_run = any([value is not None, impact_value_set_none(impact_assessment)])
34
- return _indicator(value) if should_run else None
33
+ return _indicator(value) if value is not None else None
@@ -33,5 +33,5 @@ def run(impact_assessment: dict):
33
33
  value = impact_endpoint_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['characterisedIndicator'])
34
34
  logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
35
35
  value=value)
36
- logShouldRun(impact_assessment, MODEL, TERM_ID, True)
37
- return _indicator(value)
36
+ logShouldRun(impact_assessment, MODEL, TERM_ID, value is not None)
37
+ return _indicator(value) if value is not None else None
@@ -33,5 +33,5 @@ def run(impact_assessment: dict):
33
33
  value = impact_endpoint_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['characterisedIndicator'])
34
34
  logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
35
35
  value=value)
36
- logShouldRun(impact_assessment, MODEL, TERM_ID, True)
37
- return _indicator(value)
36
+ logShouldRun(impact_assessment, MODEL, TERM_ID, value is not None)
37
+ return _indicator(value) if value is not None else None
@@ -29,5 +29,5 @@ def run(impact_assessment: dict):
29
29
  value = impact_emission_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['emission'])
30
30
  logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
31
31
  value=value)
32
- logShouldRun(impact_assessment, MODEL, TERM_ID, True)
33
- return _indicator(value)
32
+ logShouldRun(impact_assessment, MODEL, TERM_ID, value is not None)
33
+ return _indicator(value) if value is not None else None
@@ -1,5 +1,5 @@
1
1
  from hestia_earth.models.utils.indicator import _new_indicator
2
- from hestia_earth.models.utils.pesticideAI import impact_lookup_value, impact_value_set_none
2
+ from hestia_earth.models.utils.pesticideAI import impact_lookup_value
3
3
  from . import MODEL
4
4
 
5
5
  REQUIREMENTS = {
@@ -30,5 +30,4 @@ def _indicator(value: float):
30
30
 
31
31
  def run(impact_assessment: dict):
32
32
  value = impact_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['pesticideAI'])
33
- should_run = any([value is not None, impact_value_set_none(impact_assessment)])
34
- return _indicator(value) if should_run else None
33
+ return _indicator(value) if value is not None else None
@@ -1,5 +1,5 @@
1
1
  from hestia_earth.models.utils.indicator import _new_indicator
2
- from hestia_earth.models.utils.pesticideAI import impact_lookup_value, impact_value_set_none
2
+ from hestia_earth.models.utils.pesticideAI import impact_lookup_value
3
3
  from . import MODEL
4
4
 
5
5
  REQUIREMENTS = {
@@ -30,5 +30,4 @@ def _indicator(value: float):
30
30
 
31
31
  def run(impact_assessment: dict):
32
32
  value = impact_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['pesticideAI'])
33
- should_run = any([value is not None, impact_value_set_none(impact_assessment)])
34
- return _indicator(value) if should_run else None
33
+ return _indicator(value) if value is not None else None
@@ -29,5 +29,5 @@ def run(impact_assessment: dict):
29
29
  value = impact_emission_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['emission'])
30
30
  logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
31
31
  value=value)
32
- logShouldRun(impact_assessment, MODEL, TERM_ID, True)
33
- return _indicator(value)
32
+ logShouldRun(impact_assessment, MODEL, TERM_ID, value is not None)
33
+ return _indicator(value) if value is not None else None
@@ -1,5 +1,5 @@
1
1
  from hestia_earth.models.utils.indicator import _new_indicator
2
- from hestia_earth.models.utils.pesticideAI import impact_lookup_value, impact_value_set_none
2
+ from hestia_earth.models.utils.pesticideAI import impact_lookup_value
3
3
  from . import MODEL
4
4
 
5
5
  REQUIREMENTS = {
@@ -30,5 +30,4 @@ def _indicator(value: float):
30
30
 
31
31
  def run(impact_assessment: dict):
32
32
  value = impact_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['pesticideAI'])
33
- should_run = any([value is not None, impact_value_set_none(impact_assessment)])
34
- return _indicator(value) if should_run else None
33
+ return _indicator(value) if value is not None else None
@@ -33,5 +33,5 @@ def run(impact_assessment: dict):
33
33
  value = impact_endpoint_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['characterisedIndicator'])
34
34
  logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
35
35
  value=value)
36
- logShouldRun(impact_assessment, MODEL, TERM_ID, True)
37
- return _indicator(value)
36
+ logShouldRun(impact_assessment, MODEL, TERM_ID, value is not None)
37
+ return _indicator(value) if value is not None else None
@@ -29,5 +29,5 @@ def run(impact_assessment: dict):
29
29
  value = impact_emission_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['emission'])
30
30
  logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
31
31
  value=value)
32
- logShouldRun(impact_assessment, MODEL, TERM_ID, True)
33
- return _indicator(value)
32
+ logShouldRun(impact_assessment, MODEL, TERM_ID, value is not None)
33
+ return _indicator(value) if value is not None else None