hestia-earth-models 0.70.5__py3-none-any.whl → 0.71.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 (35) hide show
  1. hestia_earth/models/cache_nodes.py +157 -0
  2. hestia_earth/models/cache_sites.py +1 -1
  3. hestia_earth/models/config/Cycle.json +0 -30
  4. hestia_earth/models/data/ecoinventV3/__init__.py +7 -5
  5. hestia_earth/models/ecoinventV3/__init__.py +8 -1
  6. hestia_earth/models/ecoinventV3AndEmberClimate/__init__.py +1 -0
  7. hestia_earth/models/emepEea2019/co2ToAirFuelCombustion.py +20 -15
  8. hestia_earth/models/emepEea2019/n2OToAirFuelCombustionDirect.py +21 -16
  9. hestia_earth/models/emepEea2019/noxToAirFuelCombustion.py +20 -15
  10. hestia_earth/models/emepEea2019/so2ToAirFuelCombustion.py +20 -15
  11. hestia_earth/models/emepEea2019/utils.py +73 -25
  12. hestia_earth/models/hestia/aboveGroundCropResidue.py +3 -3
  13. hestia_earth/models/hestia/management.py +12 -7
  14. hestia_earth/models/hestia/seed_emissions.py +25 -21
  15. hestia_earth/models/mocking/search-results.json +1506 -1502
  16. hestia_earth/models/utils/background_emissions.py +24 -0
  17. hestia_earth/models/utils/blank_node.py +4 -1
  18. hestia_earth/models/utils/pesticideAI.py +1 -1
  19. hestia_earth/models/version.py +1 -1
  20. {hestia_earth_models-0.70.5.dist-info → hestia_earth_models-0.71.0.dist-info}/METADATA +2 -2
  21. {hestia_earth_models-0.70.5.dist-info → hestia_earth_models-0.71.0.dist-info}/RECORD +31 -33
  22. tests/models/emepEea2019/test_co2ToAirFuelCombustion.py +1 -14
  23. tests/models/emepEea2019/test_n2OToAirFuelCombustionDirect.py +1 -14
  24. tests/models/emepEea2019/test_noxToAirFuelCombustion.py +1 -14
  25. tests/models/emepEea2019/test_so2ToAirFuelCombustion.py +1 -14
  26. tests/models/emepEea2019/test_utils.py +1 -49
  27. tests/models/hestia/test_management.py +2 -1
  28. tests/models/test_cache_nodes.py +31 -0
  29. hestia_earth/models/ipcc2006/co2ToAirOrganicSoilCultivation.py +0 -100
  30. hestia_earth/models/ipcc2006/n2OToAirOrganicSoilCultivationDirect.py +0 -99
  31. tests/models/ipcc2006/test_co2ToAirOrganicSoilCultivation.py +0 -49
  32. tests/models/ipcc2006/test_n2OToAirOrganicSoilCultivationDirect.py +0 -32
  33. {hestia_earth_models-0.70.5.dist-info → hestia_earth_models-0.71.0.dist-info}/LICENSE +0 -0
  34. {hestia_earth_models-0.70.5.dist-info → hestia_earth_models-0.71.0.dist-info}/WHEEL +0 -0
  35. {hestia_earth_models-0.70.5.dist-info → hestia_earth_models-0.71.0.dist-info}/top_level.txt +0 -0
@@ -1,7 +1,11 @@
1
+ from hestia_earth.schema import TermTermType
1
2
  from hestia_earth.utils.model import find_term_match
2
3
  from hestia_earth.utils.tools import flatten
4
+ from hestia_earth.utils.emission import cycle_emissions_in_system_boundary
3
5
 
6
+ from hestia_earth.models.log import logShouldRun
4
7
  from . import is_from_model
8
+ from .blank_node import get_lookup_value
5
9
 
6
10
 
7
11
  def _animal_inputs(animal: dict):
@@ -50,3 +54,23 @@ def no_gap_filled_background_emissions(cycle: dict):
50
54
  ])
51
55
 
52
56
  return check_input
57
+
58
+
59
+ def all_background_emission_term_ids(cycle: dict):
60
+ term_ids = cycle_emissions_in_system_boundary(cycle)
61
+ return list(set([
62
+ get_lookup_value({'termType': TermTermType.EMISSION.value, '@id': term_id}, 'inputProductionGroupId')
63
+ for term_id in term_ids
64
+ ]))
65
+
66
+
67
+ def log_missing_emissions(cycle: dict, **log_args):
68
+ all_emission_term_ids = all_background_emission_term_ids(cycle)
69
+
70
+ def log_input(input_term_id: str, included_emission_term_ids: list):
71
+ missing_emission_term_ids = [
72
+ term_id for term_id in all_emission_term_ids if term_id not in included_emission_term_ids
73
+ ]
74
+ for emission_id in missing_emission_term_ids:
75
+ logShouldRun(cycle, term=input_term_id, should_run=False, emission_id=emission_id, **log_args)
76
+ return log_input
@@ -113,7 +113,10 @@ def properties_logs(blank_nodes: list, properties: Union[dict, list]):
113
113
 
114
114
  def group_by_keys(group_keys: list = ['term']):
115
115
  def run(group: dict, node: dict):
116
- group_key = '-'.join(non_empty_list(map(lambda v: node.get(v, {}).get('@id'), group_keys)))
116
+ group_key = '-'.join(non_empty_list([
117
+ node.get(v, {}).get('@id') if isinstance(node.get(v), dict) else node.get(v)
118
+ for v in group_keys
119
+ ]))
117
120
  group[group_key] = group.get(group_key, []) + [node]
118
121
  return group
119
122
  return run
@@ -34,7 +34,7 @@ def impact_lookup_value(model: str, term_id: str, impact_assessment: dict, looku
34
34
  lookup_col=lookup_col,
35
35
  term_type_pesticideVeterinaryDrug_complete=is_complete,
36
36
  has_pesticides_inputs=has_pesticides_inputs,
37
- pesticides_total_value=pesticides_total_value)
37
+ impact_value_from_pesticide_ais=pesticides_total_value)
38
38
 
39
39
  should_run = is_complete and any([
40
40
  len(pesticides) == 0,
@@ -1 +1 @@
1
- VERSION = '0.70.5'
1
+ VERSION = '0.71.0'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hestia-earth-models
3
- Version: 0.70.5
3
+ Version: 0.71.0
4
4
  Summary: HESTIA's set of modules for filling gaps in the activity data using external datasets (e.g. populating soil properties with a geospatial dataset using provided coordinates) and internal lookups (e.g. populating machinery use from fuel use). Includes rules for when gaps should be filled versus not (e.g. never gap fill yield, gap fill crop residue if yield provided etc.).
5
5
  Home-page: https://gitlab.com/hestia-earth/hestia-engine-models
6
6
  Author: HESTIA Team
@@ -18,7 +18,7 @@ Requires-Dist: CurrencyConverter==0.16.8
18
18
  Requires-Dist: haversine>=2.7.0
19
19
  Requires-Dist: pydash
20
20
  Provides-Extra: spatial
21
- Requires-Dist: hestia-earth-earth-engine>=0.4.7; extra == "spatial"
21
+ Requires-Dist: hestia-earth-earth-engine>=0.5.0; extra == "spatial"
22
22
 
23
23
  # HESTIA Engine Models
24
24
 
@@ -1,10 +1,11 @@
1
1
  hestia_earth/__init__.py,sha256=G-d438vPx7m_ks5e9XTtM3u7LDRO5dSSukibukWmyPM,56
2
2
  hestia_earth/models/__init__.py,sha256=qEFeq3yuf3lQKVseALmL8aPM8fpCS54B_5pry00M3hk,76
3
- hestia_earth/models/cache_sites.py,sha256=BOhLkkdVWLJ-4Z7kxfQ8swqrYgZ43sACn1uzxYN8hMQ,6345
3
+ hestia_earth/models/cache_nodes.py,sha256=CqcTkvT0SQw-MKExUJgM3wDRt2sgdxgVYb6ylNnfC4I,5423
4
+ hestia_earth/models/cache_sites.py,sha256=VwUNMhmCXZIEnligS0jtcWDdn13GIknpzxBMWzG9kcg,6353
4
5
  hestia_earth/models/log.py,sha256=eRuH86v7Thuw-QXdKqaqVmA_MkwnOCo0UBEwtuDq4Oc,3554
5
6
  hestia_earth/models/preload_requests.py,sha256=vK_G1UzhNMhYy7ymnCtHUz_vv3cfApCSKqv29VREEBQ,1943
6
7
  hestia_earth/models/requirements.py,sha256=eU4yT443fx7BnaokhrLB_PCizJI7Y6m4auyo8vQauNg,17363
7
- hestia_earth/models/version.py,sha256=-JgBQt5n6gG1CCXDecGH4FNOIQ7MDx7slt4WV4DuX9k,19
8
+ hestia_earth/models/version.py,sha256=TGqNOASPKJDt3woGIzQvAtS3DrQDE911tyRyXtp5MVI,19
8
9
  hestia_earth/models/agribalyse2016/__init__.py,sha256=WvK0qCQbnYtg9oZxrACd1wGormZyXibPtpCnIQeDqbw,415
9
10
  hestia_earth/models/agribalyse2016/fuelElectricity.py,sha256=1ngl8pdxeNhlVV8keAeWRwGorr_1uFXM9EoPUWx-uSc,4382
10
11
  hestia_earth/models/agribalyse2016/machineryInfrastructureDepreciatedAmountPerCycle.py,sha256=queToXuzq0tQ9_XuUJ2pJgSywXmbt9uX3ZoIKgqkROM,2660
@@ -33,7 +34,7 @@ hestia_earth/models/cml2001Baseline/terrestrialAcidificationPotentialIncludingFa
33
34
  hestia_earth/models/cml2001NonBaseline/__init__.py,sha256=vI8wp8Og_e8DiJqYYvp33YoI3t4ffAC31LWlnV20JTg,419
34
35
  hestia_earth/models/cml2001NonBaseline/eutrophicationPotentialIncludingFateAverageEurope.py,sha256=lcgyRHY08KCBFPERJNqV4DYGEJCvyHBDnJXD0kEkVqM,1097
35
36
  hestia_earth/models/cml2001NonBaseline/terrestrialAcidificationPotentialExcludingFate.py,sha256=xcrxfs9UoV_EWvV-XzMt35oPWCUsTzqg2SGA3j2MFIw,1091
36
- hestia_earth/models/config/Cycle.json,sha256=fJmIc9GK16Ob3m3Qv_jqD7Po5vB1C2R6hPJ9yDfEDCM,58937
37
+ hestia_earth/models/config/Cycle.json,sha256=3akuXAYWwsTc9v4g8y0yGQooDXc_D4y8J5Q7RFLTAmg,58113
37
38
  hestia_earth/models/config/ImpactAssessment.json,sha256=R22Pa6Szl05s13xFGKmrVZ4EgKD4UyUrruxxVujsJt4,56201
38
39
  hestia_earth/models/config/Site.json,sha256=vOjDsstMWe4i6PDDfpJ236Qb7gif5I0MMmscK1-LgKM,13866
39
40
  hestia_earth/models/config/__init__.py,sha256=l1WqL7ezlank86ABP4zUia_hIvM9ba-sOE3z6wNrea8,2333
@@ -93,30 +94,30 @@ hestia_earth/models/cycle/product/value.py,sha256=JYHlfmOakU1xgDcgGWc78WzRd50HYq
93
94
  hestia_earth/models/dammgen2009/__init__.py,sha256=dZ8tIXl6e3ZEixYrWiW7rzoqRJVFOoxi4RPvM3N0L1E,412
94
95
  hestia_earth/models/dammgen2009/noxToAirExcreta.py,sha256=QTavWhklMVD00Z5YyinTrheqZwW85frjYEJPYtHWKDg,1744
95
96
  hestia_earth/models/data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
96
- hestia_earth/models/data/ecoinventV3/__init__.py,sha256=iCJsrHQpe7VhG_ifbXZ0gbwEm18Xr15nWszTum-2qSk,1222
97
+ hestia_earth/models/data/ecoinventV3/__init__.py,sha256=DK1avgh58KlsUJY4nOTAaRlKsISJF4MOrrxdByHDr4o,1240
97
98
  hestia_earth/models/deRuijterEtAl2010/__init__.py,sha256=lbH6mB98dmZZlwdZctNYtEmVwAow957l80Dv7JSPDsI,418
98
99
  hestia_earth/models/deRuijterEtAl2010/nh3ToAirCropResidueDecomposition.py,sha256=2z10WqMsGUDDO8xJ3lmXvSUHgzz2t6PPRDha5NHoT5s,3291
99
100
  hestia_earth/models/ecoalimV9/__init__.py,sha256=_evwL-DZejYohms9PUi4TNqLic44-UbOzw178wak7Pk,410
100
101
  hestia_earth/models/ecoalimV9/cycle.py,sha256=i_Ydzqt9JN3akmZMToz_JJq_nd_pCUZ-4D0wM_0BhgY,4725
101
102
  hestia_earth/models/ecoalimV9/impact_assessment.py,sha256=HY2hvAq9Fv-rreroHdWpXxRCP3s6GD_5eWpcB8UWzhs,4506
102
103
  hestia_earth/models/ecoalimV9/utils.py,sha256=AWmWQhjvze3J6s35bH-EQIGc58xCeMA8_56hQD7CX8A,1170
103
- hestia_earth/models/ecoinventV3/__init__.py,sha256=qKJRphRIlcE52yxUARkolijZgXoB27t3hJeU6nRDKpA,5084
104
+ hestia_earth/models/ecoinventV3/__init__.py,sha256=SleW3Mrg1g9mvJpyzWq_9CUDvruZfydenBOrfUNzG7o,5339
104
105
  hestia_earth/models/ecoinventV3/utils.py,sha256=RxqaHB9hr0RdTKSjfvDN0pC8DIOyxMCr4I_xjas1POw,460
105
- hestia_earth/models/ecoinventV3AndEmberClimate/__init__.py,sha256=7deu8P0SUfYe1u-Y2MOgI2psddgzr3U9BN6H3oU6n0E,5764
106
+ hestia_earth/models/ecoinventV3AndEmberClimate/__init__.py,sha256=N2XY-DADYgxHvPsery5wg7K_m_S83o-HMR0LtHd4uHE,5844
106
107
  hestia_earth/models/ecoinventV3AndEmberClimate/utils.py,sha256=AzslK6YB0jxVMLfkLVmhHpkM7mx639N0mIWbErD6GMw,1133
107
108
  hestia_earth/models/edip2003/__init__.py,sha256=nyB0CI2gNmRAXj-203aJHQMmETYhcY-dHbMABOhJ7YI,409
108
109
  hestia_earth/models/edip2003/ozoneDepletionPotential.py,sha256=YkBct4eDUidGukaVdd2iaEouq_FckuG8l_7pgBQgCBw,1033
109
110
  hestia_earth/models/emepEea2019/__init__.py,sha256=l90-pWrqIzt1ap1WNk0gF4iZeF5_TSG62hE83bIi4rQ,412
110
- hestia_earth/models/emepEea2019/co2ToAirFuelCombustion.py,sha256=ib_xzEbIg-iQwvW2L4BosD9lV6EYOXAiIs8gYhSD9GE,1431
111
- hestia_earth/models/emepEea2019/n2OToAirFuelCombustionDirect.py,sha256=H4dgGqDuvYN4S7TRxYsX3hms1xMWr8clR2gkyyO8T18,1438
111
+ hestia_earth/models/emepEea2019/co2ToAirFuelCombustion.py,sha256=TPzbKxV-AZ9yx_tJNGhuNsfRJQNfH4a0JEtPGLKc-tA,1833
112
+ hestia_earth/models/emepEea2019/n2OToAirFuelCombustionDirect.py,sha256=y0N_GhixisN6ScfKCpahrZe2CWOwl9ayDesO_erXX68,1839
112
113
  hestia_earth/models/emepEea2019/nh3ToAirExcreta.py,sha256=DssSjl_Kug9jE5laqJs9X4xOdOrJBnsXSnk-uA_anyE,2153
113
114
  hestia_earth/models/emepEea2019/nh3ToAirInorganicFertiliser.py,sha256=7G0_S0G6X9slTykxs6CDb68DvtXB7yfq1iSKg0ReXS8,6036
114
- hestia_earth/models/emepEea2019/noxToAirFuelCombustion.py,sha256=2--8lI6C6WaYtd9LQe-WZnhvW1eUsjBVAgzT8jclcsc,1431
115
+ hestia_earth/models/emepEea2019/noxToAirFuelCombustion.py,sha256=OlrCPBuOBGlvPh_ufO8fFzSvxvkJduX7tlqzEab6qzs,1833
115
116
  hestia_earth/models/emepEea2019/pm10ToAirAnimalHousing.py,sha256=7LhOEQokWMWEPspYSQO3PtsmWkygbVAonj_Nq6JAL6c,1384
116
117
  hestia_earth/models/emepEea2019/pm25ToAirAnimalHousing.py,sha256=IzGQrRv9Pk0o1Vq18HRWZ10jhmjFG59ijfn_VYAUJIA,1384
117
- hestia_earth/models/emepEea2019/so2ToAirFuelCombustion.py,sha256=8B1GVsn5gEXVW3iZYBct-s_OTRaH-asXo6JvGW_jls0,1431
118
+ hestia_earth/models/emepEea2019/so2ToAirFuelCombustion.py,sha256=OC53aE0uCmUxgZcqQjyhjjFPZ5U5Rdfv8l8wYihcYY4,1833
118
119
  hestia_earth/models/emepEea2019/tspToAirAnimalHousing.py,sha256=TaT5GyYK6MyJQHKApBe-u4fMjqXXdmuBEtUcRYnkhac,1381
119
- hestia_earth/models/emepEea2019/utils.py,sha256=oTHjbRRwJZv_tpO9MOlfpyQRmN0a1kvEZsVHUPliZpQ,4014
120
+ hestia_earth/models/emepEea2019/utils.py,sha256=YIHxVu4GwCbxBI5FzsmJ91itWNGx0vnBTCePSwlCnz8,5629
120
121
  hestia_earth/models/emissionNotRelevant/__init__.py,sha256=yAunIZI_4nGV0khRiGhbZAmXmMiuICzEH-pvzWX1lpM,3000
121
122
  hestia_earth/models/environmentalFootprintV3_1/__init__.py,sha256=tF2WrWiV1Wzi2vnRiNXdfPWfmVxgVu9w9-7eA6PA7-s,473
122
123
  hestia_earth/models/environmentalFootprintV3_1/environmentalFootprintSingleOverallScore.py,sha256=tRx2rRlSDupAWTfB9MqvqwrUCWHy-r-3gHjbgVOYLTs,5239
@@ -183,7 +184,7 @@ hestia_earth/models/haversineFormula/__init__.py,sha256=o155nR-XI67iCSBVNYIu4sPR
183
184
  hestia_earth/models/haversineFormula/transport/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
184
185
  hestia_earth/models/haversineFormula/transport/distance.py,sha256=l00mmyRgWsHWFtk4OTFrhqyOmc-73C4Wkfn5WKM99TA,3990
185
186
  hestia_earth/models/hestia/__init__.py,sha256=o5vAmPzSaK9XPgL8GCne3-lugfCOgZhHELYolNgqyyY,407
186
- hestia_earth/models/hestia/aboveGroundCropResidue.py,sha256=lo4Y3qjGsL7F-VixsoCsTZxIULJO-LQmm9HvLG03f1s,5860
187
+ hestia_earth/models/hestia/aboveGroundCropResidue.py,sha256=7OOO2_0nVoEwqslZ-daATfFTcm_GhAZR1NWBV_ULcYw,5903
187
188
  hestia_earth/models/hestia/aboveGroundCropResidueTotal.py,sha256=NcaHzSLTmTP0yTO_2mqqouNzkCVYRkDm31LZqOCiFD4,2715
188
189
  hestia_earth/models/hestia/brackishWater.py,sha256=znc-p3W7sclCeytj3Jg6YUzGu2tFD8inswjapn-_8ds,1285
189
190
  hestia_earth/models/hestia/cationExchangeCapacityPerKgSoil.py,sha256=GtF-X2ogdXLX0dKed8d2L3baI5MfpN6UXZbZm2aG3Es,3660
@@ -205,7 +206,7 @@ hestia_earth/models/hestia/landTransformation100YearAverageDuringCycle.py,sha256
205
206
  hestia_earth/models/hestia/landTransformation20YearAverageDuringCycle.py,sha256=1StzrYhMsX-hdwBTeLnLMZWl5EEnCoEYpGPRkqy8a-A,1016
206
207
  hestia_earth/models/hestia/liveAnimal.py,sha256=95HfqgFA_qRhdIeR2X5MJ9zzIm4nMHDvJ0BCnuTYe5Q,3860
207
208
  hestia_earth/models/hestia/longFallowRatio.py,sha256=LkJaER1VNDI5351-oC8tru-LgiPK3sNMg0NhB5ic9RE,1690
208
- hestia_earth/models/hestia/management.py,sha256=MhZ7eIE6jMReGbZqGKEZ6Gj7Zug4wceEdFm4MU9y36U,11060
209
+ hestia_earth/models/hestia/management.py,sha256=TJRdiV5XQBtK3YBOZsC-Off-9RMYrvYgkzylpPVRizw,11281
209
210
  hestia_earth/models/hestia/materialAndSubstrate.py,sha256=abmM_7FOY5yaNb2yZEm-ncI4wFFcbzaebtnG9XWEA6M,5130
210
211
  hestia_earth/models/hestia/milkYield.py,sha256=__3AdxRTUTWwS_GsqxFpPGklmTnnpADiN0khlRCMAss,5541
211
212
  hestia_earth/models/hestia/netPrimaryProduction.py,sha256=uU4AZ7X6tbtWgR5YClA_aLpYWtlivq9lPQGZgt3-qoQ,1856
@@ -230,7 +231,7 @@ hestia_earth/models/hestia/residueLeftOnField.py,sha256=EZoPlDhh1aNJvPT52Bvro6xc
230
231
  hestia_earth/models/hestia/residueRemoved.py,sha256=2I4wTJJcORrhkWiRJOzjwxRMIn3Jjeggh1dhFC2CK4Y,4969
231
232
  hestia_earth/models/hestia/resourceUse_utils.py,sha256=SYMN-40NW76LaVo2jVdnCbTgYN03mmSqvYRzgDzm5jI,8564
232
233
  hestia_earth/models/hestia/salineWater.py,sha256=NB9nu1oiqbUd0k-9chBsY92vOsg5mDrSf1OCR3tlA6k,1263
233
- hestia_earth/models/hestia/seed_emissions.py,sha256=Mn1iEaLrl6gz66Pqd7sD3JhR8UOrGwXLdg641nzUME0,11048
234
+ hestia_earth/models/hestia/seed_emissions.py,sha256=-XON8tXYU2qTy4QQE6rvzL1iKut91rwWsW7fcMyl44I,11372
234
235
  hestia_earth/models/hestia/soilMeasurement.py,sha256=cP4nuz2DE-FLaFbP-0fG5wbIgU28s3n4-lo8-RTFpF0,7088
235
236
  hestia_earth/models/hestia/stockingDensityAnimalHousingAverage.py,sha256=Ce0RZmAADDtGksfXzhX4lh-jdAs3WlCQqy2FAF3xFjo,1850
236
237
  hestia_earth/models/hestia/temperatureAnnual.py,sha256=IhMoO-SkSp1JBxgu9bSr1OCtr7QQlZsoCXqhsWeEprs,1963
@@ -264,7 +265,6 @@ hestia_earth/models/ipcc2006/__init__.py,sha256=ReUFPLqIyp16QEOGaiHmz41QbuwYBQYD
264
265
  hestia_earth/models/ipcc2006/aboveGroundCropResidueRemoved.py,sha256=6FDgMH5eiO1mEn20oerYpWty6t9058JS3MCdfVmeY_o,2714
265
266
  hestia_earth/models/ipcc2006/aboveGroundCropResidueTotal.py,sha256=vD_kpvOJmjTOjDEnlqSYBSZxjuPGvzpmCr0JIC84GKE,3431
266
267
  hestia_earth/models/ipcc2006/belowGroundCropResidue.py,sha256=KzeRphJb1IWB_EPVcxa9tbCoNmEe80D9lKxgQOqfKoU,4138
267
- hestia_earth/models/ipcc2006/co2ToAirOrganicSoilCultivation.py,sha256=kCWC_Zibs0uZ1a1mQy-9fXzmvVL-2l_FopDnkt-ayy0,3852
268
268
  hestia_earth/models/ipcc2006/n2OToAirCropResidueDecompositionDirect.py,sha256=_2oTngpspikbFwgFTtOWs-SgEVF8LzznvITGITTtol4,2913
269
269
  hestia_earth/models/ipcc2006/n2OToAirCropResidueDecompositionIndirect.py,sha256=kf4WjdMzs6d8h433LFuUH9LJKJ_aMHTqEHDToGY5-Xk,2315
270
270
  hestia_earth/models/ipcc2006/n2OToAirExcretaDirect.py,sha256=VvQTIh58JyhrdPk5FdJQBkjBDr5-Cv7CnGkNEcco3P4,1986
@@ -273,7 +273,6 @@ hestia_earth/models/ipcc2006/n2OToAirInorganicFertiliserDirect.py,sha256=0Lyhqh3
273
273
  hestia_earth/models/ipcc2006/n2OToAirInorganicFertiliserIndirect.py,sha256=s5-pnhzz3fEYkdMZEGGlecp7XlPh_9vxyN78VoOUP2Y,3171
274
274
  hestia_earth/models/ipcc2006/n2OToAirOrganicFertiliserDirect.py,sha256=xB-5jp551knTSWvJeeowO1ERpLCdXrZJKttN7xU_6RY,2396
275
275
  hestia_earth/models/ipcc2006/n2OToAirOrganicFertiliserIndirect.py,sha256=NAdGaG6-5Mrrwe17ED8R_3en-zuMqHFDtrRlqi9USSI,3103
276
- hestia_earth/models/ipcc2006/n2OToAirOrganicSoilCultivationDirect.py,sha256=TzwfuMnyQv_iLsi15Vq1cxU7Kgnu5VK6Ru9yWXtBQIA,3749
277
276
  hestia_earth/models/ipcc2006/utils.py,sha256=flB7HWrynzOorKlmrpbETGD63NMv45H8Wxjj3RCav98,739
278
277
  hestia_earth/models/ipcc2013ExcludingFeedbacks/__init__.py,sha256=v4Qe-X4w3tqIHGJBNnEAK81x4ZuQMwYxQYXRncugmcU,427
279
278
  hestia_earth/models/ipcc2013ExcludingFeedbacks/gwp100.py,sha256=2fFEHTXxel_XPiMXQlWbgtpdLVzockhK77gmG9Yy_So,1041
@@ -444,7 +443,7 @@ hestia_earth/models/linkedImpactAssessment/utils.py,sha256=S1zlux02gU2Lajrtoq-zQ
444
443
  hestia_earth/models/mocking/__init__.py,sha256=9VX50c-grz-snfd-7MBS0KfF7AadtbKuj7kK6PqtsgE,687
445
444
  hestia_earth/models/mocking/build_mock_search.py,sha256=p15ccEUmkmLp1RiGNznxMz3OFHbI8P1-29ExuohiQN8,1355
446
445
  hestia_earth/models/mocking/mock_search.py,sha256=ccFe_WrI73JElFmxp4hPNLCX7eeU--lBC1JFR901KJY,1069
447
- hestia_earth/models/mocking/search-results.json,sha256=IhD3vmuKGB5U2y3b_jQbiKjaWKeQaToZIhWqbK9o9KI,162459
446
+ hestia_earth/models/mocking/search-results.json,sha256=MUUOK3z0psCeafvNnBPksx-O0NJURHzsODDZCHUg4VE,162536
448
447
  hestia_earth/models/pooreNemecek2018/__init__.py,sha256=nPboL7ULJzL5nJD5q7q9VOZt_fxbKVm8fmn1Az5YkVY,417
449
448
  hestia_earth/models/pooreNemecek2018/aboveGroundCropResidueTotal.py,sha256=Qt-mel4dkhK6N5uUOutNOinCTFjbjtGzITaaI0LvYc4,2396
450
449
  hestia_earth/models/pooreNemecek2018/belowGroundCropResidue.py,sha256=JT0RybbvWVlo01FO8K0Yj41HrEaJT3Kj1xfayr2X-xw,2315
@@ -590,8 +589,8 @@ hestia_earth/models/utils/aggregated.py,sha256=gZLSY9D8MMr3VGZ2sai_5LTxdPMReuW3C
590
589
  hestia_earth/models/utils/animalProduct.py,sha256=M5IunAKGY6oZv3j1Ascl34ywyeLWApqOIlBzbtlA2FE,721
591
590
  hestia_earth/models/utils/aquacultureManagement.py,sha256=dxrbC1Xf140cohxTbSw6TxLAnAASWTdNZwBBam4yQnw,171
592
591
  hestia_earth/models/utils/array_builders.py,sha256=ko1pDZKaUudZqxOZ99vJamKAdoR6ND4ZmxVrYH6YjPc,19498
593
- hestia_earth/models/utils/background_emissions.py,sha256=R0tCA63q1_2DaZ87oI7FFjZsxAZ4Zds3Rr4fDf9KhkM,1850
594
- hestia_earth/models/utils/blank_node.py,sha256=KZizahEIqZafxJ_OXL0za7QILc4AledEnHDQoxyaNI8,55961
592
+ hestia_earth/models/utils/background_emissions.py,sha256=ywxhI_x8zHnFootp5jzimUaNGHRsInnp8F0pBGIviVg,2870
593
+ hestia_earth/models/utils/blank_node.py,sha256=zQhMFG4o7kUQY0J_7g84E8E1hwatSRZINTUb6fELB2s,56040
595
594
  hestia_earth/models/utils/cache_sources.py,sha256=MBkrPpjwNiC4ApDjeYVHZjWBbpvAerXRDrMHpjasAZ0,377
596
595
  hestia_earth/models/utils/completeness.py,sha256=iRG4uviOAQQ4T2Nr4LlelPVTS_F1felGZNJYxek_JG8,1239
597
596
  hestia_earth/models/utils/constant.py,sha256=DmB3VVuoh7Pz2QDBJqiUG6yAML2i0fOy1BPuPHmhT1w,3442
@@ -618,7 +617,7 @@ hestia_earth/models/utils/management.py,sha256=urvoHvTw5wrO12POjGQ50Or25X1Y4Gx26
618
617
  hestia_earth/models/utils/measurement.py,sha256=CzSLmddbF-YMOn5mF0Y5eT1np5kUCmsSep5HYwyf44c,11093
619
618
  hestia_earth/models/utils/method.py,sha256=ZYN2_Fyeiwr9pmvD84ZPg7ZHBlvaIY2A6XL4F_KByS0,740
620
619
  hestia_earth/models/utils/organicFertiliser.py,sha256=2HY-a0EBzUw4DkEAXClLMXVCEZTKYf0BwFHBo7lQ5Tg,363
621
- hestia_earth/models/utils/pesticideAI.py,sha256=_mlhKnA1TxF-x39CPNnOGXk6754SoSQqrkHVH2y6rv8,2038
620
+ hestia_earth/models/utils/pesticideAI.py,sha256=DQIAjgkWjKPyuMLUvnEgVkeQGCEOBjyJJktWU747b00,2047
622
621
  hestia_earth/models/utils/practice.py,sha256=GEu2G2yMPbcIHldOzgv5OFp8bQ1Jt9OFgj0c_0F_kUc,372
623
622
  hestia_earth/models/utils/product.py,sha256=Oha4lMvediC1Lc5DksA6sAUT94Q1Cs9F4LFVe_uaqP4,11177
624
623
  hestia_earth/models/utils/productivity.py,sha256=rTJX_nemxHpOcPN7jiM2hFHknoLUIW8y-hFxVxIkg70,593
@@ -650,6 +649,7 @@ hestia_earth/orchestrator/strategies/run/add_blank_node_if_missing.py,sha256=lAf
650
649
  hestia_earth/orchestrator/strategies/run/add_key_if_missing.py,sha256=t3U-v87XpbtpsvjA_r0Ftm7MhNkGB0kcUSGFlKBIK_I,352
651
650
  hestia_earth/orchestrator/strategies/run/always.py,sha256=D0In6_kr28s-fgqspawgvj5cgFClxGvepZYqtYsjWVE,217
652
651
  tests/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
652
+ tests/models/test_cache_nodes.py,sha256=lSSoBGFVXpNv_TePSetls6QbnhfLC7dNLmfiFqT6WuY,1043
653
653
  tests/models/test_cache_sites.py,sha256=eZkbgAhfA-67GhPgE4lk8byHnYvX2Ate1KPsE6jH1-c,2954
654
654
  tests/models/test_config.py,sha256=w27OA_pk9NuDbxzMD--l72Ea97SL1HS6bos6mOUCy8k,3386
655
655
  tests/models/test_ecoinventV3.py,sha256=SvBn1ZomoturZhjj4BE2EU46Sq0il-tOJIqutmGadWs,2023
@@ -743,16 +743,16 @@ tests/models/ecoalimV9/test_impact_assessment.py,sha256=9Br_jis2MT85kS1IvBfPE9x7
743
743
  tests/models/edip2003/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
744
744
  tests/models/edip2003/test_ozoneDepletionPotential.py,sha256=z0kimdTxzSr8_K5eScbkxq2SB9nbBp41IHqVNR4Nh4Y,688
745
745
  tests/models/emepEea2019/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
746
- tests/models/emepEea2019/test_co2ToAirFuelCombustion.py,sha256=z1H17R_Erox2dMg8xylGB0qt9BMZSwfLAoEMVv9z878,1518
747
- tests/models/emepEea2019/test_n2OToAirFuelCombustionDirect.py,sha256=4uemriZAyJBSn-xMttRpxqVHOFNBXlboVODHQYl65zQ,1524
746
+ tests/models/emepEea2019/test_co2ToAirFuelCombustion.py,sha256=SrCx1-mW0s-flisF9Zf6W_A8VtJ67sWga8pGgS713b8,1135
747
+ tests/models/emepEea2019/test_n2OToAirFuelCombustionDirect.py,sha256=dTkrj2i5QibBuHaCgV8n2dB02y0nJAwhR35WcOquHOQ,1141
748
748
  tests/models/emepEea2019/test_nh3ToAirExcreta.py,sha256=lTPftCJinvokmgUcUikl8hN_axFa8OyCTXvL0PaSRFg,1111
749
749
  tests/models/emepEea2019/test_nh3ToAirInorganicFertiliser.py,sha256=f623Pp6XTt9YPDr2QymAJEQ_yfx0_TZGndmawD8ZX98,2134
750
- tests/models/emepEea2019/test_noxToAirFuelCombustion.py,sha256=HpuzWyFmfatFXwTZd8TVpHb6Kfj2Ru3IO1gHnSiuKtQ,1518
750
+ tests/models/emepEea2019/test_noxToAirFuelCombustion.py,sha256=iFVQVYImXxB5JE8b38UAUG4q8grfbniZi1cWdLQoViE,1135
751
751
  tests/models/emepEea2019/test_pm10ToAirAnimalHousing.py,sha256=xGlQeJkdP638zbHivxAqvliZCRpcogMFZYVCMWw6j3c,715
752
752
  tests/models/emepEea2019/test_pm25ToAirAnimalHousing.py,sha256=cs3UaJ7ucCryOaQy0sbL9AiuC8l_N7uywmPZHcr3pC0,715
753
- tests/models/emepEea2019/test_so2ToAirFuelCombustion.py,sha256=zRTyeeQM1fRdRVFWbtCNndaddDbKHU1xLzmp_psDceE,1518
753
+ tests/models/emepEea2019/test_so2ToAirFuelCombustion.py,sha256=RkC_ux5bxo6bIdcXIG_97uRstWXBnmZO3DOW4IfgRx0,1135
754
754
  tests/models/emepEea2019/test_tspToAirAnimalHousing.py,sha256=4MNDsxIeUk5_3IvZwEZslxgoPNyQN9OQFDNY3uGNX6E,714
755
- tests/models/emepEea2019/test_utils.py,sha256=G6z8tEfWM0OPnUBaFCQgQyEi5-kRF_DqsqdYaPnzR_I,8761
755
+ tests/models/emepEea2019/test_utils.py,sha256=MUIeHgcCHLhbYWgleKIiKqO2Q4RX321J53YpOt9cogA,7060
756
756
  tests/models/environmentalFootprintV3_1/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
757
757
  tests/models/environmentalFootprintV3_1/test_environmentalFootprintSingleOverallScore.py,sha256=F4oz4UadhpBlyh4JvLPOWAxGSIKnJVTTDaSzOT3Ihgk,4909
758
758
  tests/models/environmentalFootprintV3_1/test_freshwaterEcotoxicityPotentialCtue.py,sha256=WE-DcerljCjXMYE4f3Sv5ZCVHP0oTjbWkOGuvaa4p10,926
@@ -841,7 +841,7 @@ tests/models/hestia/test_landTransformation100YearAverageDuringCycle.py,sha256=3
841
841
  tests/models/hestia/test_landTransformation20YearAverageDuringCycle.py,sha256=bUByojQuVeuCfko1_2YtNJi1PT9yktHlcbPi_p-MPvk,1001
842
842
  tests/models/hestia/test_liveAnimal.py,sha256=3K9cL1fwr6LlBl1_D8zIaeCOuiExqkDEU7BXx1JK_dk,2139
843
843
  tests/models/hestia/test_longFallowRatio.py,sha256=OVd6NByAXeCAOx9ux_m8IJwnEF-fqIaBOoKFSGWhyO0,1513
844
- tests/models/hestia/test_management.py,sha256=h5rNqAgh3ehTlH4MEGBp4ryhZOoA2EXj_Q3lZcufbUk,1738
844
+ tests/models/hestia/test_management.py,sha256=p7j5ooACr0XBf2-hZWwwYE0-sfsoakIa2qKZhE32ZUQ,1800
845
845
  tests/models/hestia/test_materialsAndSubstrate.py,sha256=szM6aBBc1_9MDQFM1-OiW4SOKvEIO6mYYEpjHB-wI9g,1430
846
846
  tests/models/hestia/test_milkYield.py,sha256=m7SRiKb_u8SDF7Q5gX39AKr4bsrNqibXgMgzSmJJEPA,1778
847
847
  tests/models/hestia/test_netPrimaryProduction.py,sha256=--q6NB90gmpeJNBR16l3AgBsXGXwww_d1vOcWiMa-k8,1110
@@ -894,7 +894,6 @@ tests/models/ipcc2006/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
894
894
  tests/models/ipcc2006/test_aboveGroundCropResidueRemoved.py,sha256=5F7eU4qWYfTZAzjUsuUOE5rA2vZ0x6e6Bm10PgmG9Zg,1177
895
895
  tests/models/ipcc2006/test_aboveGroundCropResidueTotal.py,sha256=FrSR1xBTRtJ99pXAklXLtDRC00FSW1vXSAvQNeBoXTQ,1725
896
896
  tests/models/ipcc2006/test_belowGroundCropResidue.py,sha256=cFqLDFy5pcgOyzKC9l-RClEP6CWCdVNnq48S90SITVM,1720
897
- tests/models/ipcc2006/test_co2ToAirOrganicSoilCultivation.py,sha256=wM1BYFcK28aiNVP6JUEWdc90kCd3w4rjOnpxzwuYV_o,1609
898
897
  tests/models/ipcc2006/test_n2OToAirCropResidueDecompositionDirect.py,sha256=pgUznkTiyLwhMVHzFE40wzwvtY40OsPQp1QWTsaPDqU,1815
899
898
  tests/models/ipcc2006/test_n2OToAirCropResidueDecompositionIndirect.py,sha256=cxn5rX_pZqbl7m8rhJARuyjG2P5O-BQbufeEcTmO06k,1357
900
899
  tests/models/ipcc2006/test_n2OToAirExcretaDirect.py,sha256=tm6Lm90_4qEkCU6UIFsOD6yhrMrq69lkF1LvCjXPjE4,2132
@@ -903,7 +902,6 @@ tests/models/ipcc2006/test_n2OToAirInorganicFertiliserDirect.py,sha256=Z385htV4X
903
902
  tests/models/ipcc2006/test_n2OToAirInorganicFertiliserIndirect.py,sha256=wmasF-q-IwMbEfnKzCHBGqnSQtY8Xg0OohccvofnwQY,1283
904
903
  tests/models/ipcc2006/test_n2OToAirOrganicFertiliserDirect.py,sha256=L6J9s9Xp__zIS1xzz0WUg83fpdOo8c9t6wWrNeQMuM8,1688
905
904
  tests/models/ipcc2006/test_n2OToAirOrganicFertiliserIndirect.py,sha256=NEt5s9hQ5bGk3YuqOMVOeWdBzLOXbScU-D1JsiAFNBQ,1678
906
- tests/models/ipcc2006/test_n2OToAirOrganicSoilCultivationDirect.py,sha256=M7b_uZD5nvW3cnL0wEJ_uuNPOQxho3Xk1O1xAIqflvk,1058
907
905
  tests/models/ipcc2013ExcludingFeedbacks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
908
906
  tests/models/ipcc2013ExcludingFeedbacks/test_gwp100.py,sha256=Od9ALNCag5pCVJnp2pIXOenadJLhKD4X4DDmLcgET2A,875
909
907
  tests/models/ipcc2013IncludingFeedbacks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -1243,8 +1241,8 @@ tests/orchestrator/strategies/run/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeR
1243
1241
  tests/orchestrator/strategies/run/test_add_blank_node_if_missing.py,sha256=K4xg4UAXfNhSaLyknKVPO7MGBF44Z_gD7CuZ_pe28gU,3512
1244
1242
  tests/orchestrator/strategies/run/test_add_key_if_missing.py,sha256=hKwvk1ohcBVnQUCTiDhRW99J0xEa29BpwFi1KC0yWLE,329
1245
1243
  tests/orchestrator/strategies/run/test_always.py,sha256=w5-Dhp6yLzgZGAeMRz3OrqZbbAed9gZ1O266a3z9k7w,134
1246
- hestia_earth_models-0.70.5.dist-info/LICENSE,sha256=TD25LoiRJsA5CPUNrcyt1PXlGcbUGFMAeZoBcfCrCNE,1154
1247
- hestia_earth_models-0.70.5.dist-info/METADATA,sha256=eP_74Ax32zchMTjyt6wWEglIFGifvoFlt5jIXXofrNo,4045
1248
- hestia_earth_models-0.70.5.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
1249
- hestia_earth_models-0.70.5.dist-info/top_level.txt,sha256=1dqA9TqpOLTEgpqa-YBsmbCmmNU1y56AtfFGEceZ2A0,19
1250
- hestia_earth_models-0.70.5.dist-info/RECORD,,
1244
+ hestia_earth_models-0.71.0.dist-info/LICENSE,sha256=TD25LoiRJsA5CPUNrcyt1PXlGcbUGFMAeZoBcfCrCNE,1154
1245
+ hestia_earth_models-0.71.0.dist-info/METADATA,sha256=5p6Ye5i0cwJrJ1nGa6xuPTTjP4s7vnYp-wFChLqTNCw,4045
1246
+ hestia_earth_models-0.71.0.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
1247
+ hestia_earth_models-0.71.0.dist-info/top_level.txt,sha256=1dqA9TqpOLTEgpqa-YBsmbCmmNU1y56AtfFGEceZ2A0,19
1248
+ hestia_earth_models-0.71.0.dist-info/RECORD,,
@@ -2,26 +2,13 @@ from unittest.mock import patch
2
2
  import json
3
3
  from tests.utils import fixtures_path, fake_new_emission
4
4
 
5
- from hestia_earth.models.emepEea2019.co2ToAirFuelCombustion import MODEL, TERM_ID, run, _should_run
5
+ from hestia_earth.models.emepEea2019.co2ToAirFuelCombustion import MODEL, TERM_ID, run
6
6
 
7
7
  class_path = f"hestia_earth.models.{MODEL}.{TERM_ID}"
8
8
  model_utils_path = f"hestia_earth.models.{MODEL}.utils"
9
9
  fixtures_folder = f"{fixtures_path}/{MODEL}/{TERM_ID}"
10
10
 
11
11
 
12
- @patch(f"{class_path}.get_fuel_values")
13
- def test_should_run(mock_get_fuel_values):
14
- # no fuel values => no run
15
- mock_get_fuel_values.return_value = []
16
- should_run, *args = _should_run({})
17
- assert not should_run
18
-
19
- # with fuel values => run
20
- mock_get_fuel_values.return_value = [0]
21
- should_run, *args = _should_run({})
22
- assert should_run is True
23
-
24
-
25
12
  @patch(f"{model_utils_path}._new_emission", side_effect=fake_new_emission)
26
13
  def test_run(*args):
27
14
  with open(f"{fixtures_folder}/cycle.jsonld", encoding='utf-8') as f:
@@ -2,26 +2,13 @@ from unittest.mock import patch
2
2
  import json
3
3
  from tests.utils import fixtures_path, fake_new_emission
4
4
 
5
- from hestia_earth.models.emepEea2019.n2OToAirFuelCombustionDirect import MODEL, TERM_ID, run, _should_run
5
+ from hestia_earth.models.emepEea2019.n2OToAirFuelCombustionDirect import MODEL, TERM_ID, run
6
6
 
7
7
  class_path = f"hestia_earth.models.{MODEL}.{TERM_ID}"
8
8
  model_utils_path = f"hestia_earth.models.{MODEL}.utils"
9
9
  fixtures_folder = f"{fixtures_path}/{MODEL}/{TERM_ID}"
10
10
 
11
11
 
12
- @patch(f"{class_path}.get_fuel_values")
13
- def test_should_run(mock_get_fuel_values):
14
- # no fuel values => no run
15
- mock_get_fuel_values.return_value = []
16
- should_run, *args = _should_run({})
17
- assert not should_run
18
-
19
- # with fuel values => run
20
- mock_get_fuel_values.return_value = [0]
21
- should_run, *args = _should_run({})
22
- assert should_run is True
23
-
24
-
25
12
  @patch(f"{model_utils_path}._new_emission", side_effect=fake_new_emission)
26
13
  def test_run(*args):
27
14
  with open(f"{fixtures_folder}/cycle.jsonld", encoding='utf-8') as f:
@@ -2,26 +2,13 @@ from unittest.mock import patch
2
2
  import json
3
3
  from tests.utils import fixtures_path, fake_new_emission
4
4
 
5
- from hestia_earth.models.emepEea2019.noxToAirFuelCombustion import MODEL, TERM_ID, run, _should_run
5
+ from hestia_earth.models.emepEea2019.noxToAirFuelCombustion import MODEL, TERM_ID, run
6
6
 
7
7
  class_path = f"hestia_earth.models.{MODEL}.{TERM_ID}"
8
8
  model_utils_path = f"hestia_earth.models.{MODEL}.utils"
9
9
  fixtures_folder = f"{fixtures_path}/{MODEL}/{TERM_ID}"
10
10
 
11
11
 
12
- @patch(f"{class_path}.get_fuel_values")
13
- def test_should_run(mock_get_fuel_values):
14
- # no fuel values => no run
15
- mock_get_fuel_values.return_value = []
16
- should_run, *args = _should_run({})
17
- assert not should_run
18
-
19
- # with fuel values => run
20
- mock_get_fuel_values.return_value = [0]
21
- should_run, *args = _should_run({})
22
- assert should_run is True
23
-
24
-
25
12
  @patch(f"{model_utils_path}._new_emission", side_effect=fake_new_emission)
26
13
  def test_run(*args):
27
14
  with open(f"{fixtures_folder}/cycle.jsonld", encoding='utf-8') as f:
@@ -2,26 +2,13 @@ from unittest.mock import patch
2
2
  import json
3
3
  from tests.utils import fixtures_path, fake_new_emission
4
4
 
5
- from hestia_earth.models.emepEea2019.so2ToAirFuelCombustion import MODEL, TERM_ID, run, _should_run
5
+ from hestia_earth.models.emepEea2019.so2ToAirFuelCombustion import MODEL, TERM_ID, run
6
6
 
7
7
  class_path = f"hestia_earth.models.{MODEL}.{TERM_ID}"
8
8
  model_utils_path = f"hestia_earth.models.{MODEL}.utils"
9
9
  fixtures_folder = f"{fixtures_path}/{MODEL}/{TERM_ID}"
10
10
 
11
11
 
12
- @patch(f"{class_path}.get_fuel_values")
13
- def test_should_run(mock_get_fuel_values):
14
- # no fuel values => no run
15
- mock_get_fuel_values.return_value = []
16
- should_run, *args = _should_run({})
17
- assert not should_run
18
-
19
- # with fuel values => run
20
- mock_get_fuel_values.return_value = [0]
21
- should_run, *args = _should_run({})
22
- assert should_run is True
23
-
24
-
25
12
  @patch(f"{model_utils_path}._new_emission", side_effect=fake_new_emission)
26
13
  def test_run(*args):
27
14
  with open(f"{fixtures_folder}/cycle.jsonld", encoding='utf-8') as f:
@@ -1,8 +1,6 @@
1
- from unittest.mock import patch
2
-
3
1
  import pytest
4
2
 
5
- from hestia_earth.models.emepEea2019.utils import get_fuel_values, should_run_animal, _duration_in_housing
3
+ from hestia_earth.models.emepEea2019.utils import should_run_animal, _duration_in_housing
6
4
 
7
5
  class_path = 'hestia_earth.models.emepEea2019.utils'
8
6
  TERMS = [
@@ -11,52 +9,6 @@ TERMS = [
11
9
  ]
12
10
 
13
11
 
14
- @patch(f"{class_path}._is_term_type_complete", return_value=True)
15
- def test_get_fuel_values_no_inputs_complete(*args):
16
- cycle = {'@type': 'Cycle', 'inputs': []}
17
- assert get_fuel_values('co2ToAirFuelCombustion', cycle, '') == [0]
18
-
19
-
20
- @patch(f"{class_path}._is_term_type_complete", return_value=False)
21
- def test_get_fuel_values_no_inputs_incomplete(*args):
22
- cycle = {'@type': 'Cycle', 'inputs': []}
23
- assert get_fuel_values('co2ToAirFuelCombustion', cycle, '') == []
24
-
25
- cycle = {'@type': 'Transformation', 'inputs': []}
26
- assert get_fuel_values('co2ToAirFuelCombustion', cycle, '') == []
27
-
28
-
29
- def test_get_fuel_values(*args):
30
- cycle = {
31
- '@type': 'Cycle',
32
- 'inputs': [
33
- {
34
- 'term': {'@id': 'diesel', 'termType': 'fuel'},
35
- 'value': [100]
36
- },
37
- {
38
-
39
- 'term': {'@id': 'diesel', 'termType': 'fuel'},
40
- 'operation': {'@id': 'crushingWoodMachineUnspecified', 'termType': 'operation'},
41
- 'value': [200]
42
- },
43
- {
44
-
45
- 'term': {'@id': 'diesel', 'termType': 'fuel'},
46
- 'operation': {'@id': 'helicopterUseOperationUnspecified', 'termType': 'operation'},
47
- 'value': [150]
48
- },
49
- {
50
- 'term': {'@id': 'marineGasOil', 'termType': 'fuel'},
51
- 'operation': {'@id': 'crushingWoodMachineUnspecified', 'termType': 'operation'},
52
- 'value': [50]
53
- }
54
- ]
55
- }
56
- result = get_fuel_values('co2ToAirFuelCombustion', cycle, 'co2ToAirFuelCombustionEmepEea2019')
57
- assert result == [317.0, 632.0, 475.5, 158.5]
58
-
59
-
60
12
  @pytest.mark.parametrize(
61
13
  "test_name,cycle,expected_duration",
62
14
  [
@@ -13,7 +13,8 @@ fixtures_folder = os.path.join(fixtures_path, MODEL, MODEL_KEY)
13
13
  _LAND_COVER_TERM_BY_SITE_TYPE = {
14
14
  SiteSiteType.ANIMAL_HOUSING.value: "animalHousing",
15
15
  SiteSiteType.CROPLAND.value: "cropland",
16
- SiteSiteType.AGRI_FOOD_PROCESSOR.value: "agriFoodProcessor"
16
+ SiteSiteType.AGRI_FOOD_PROCESSOR.value: "agriFoodProcessor",
17
+ SiteSiteType.PERMANENT_PASTURE.value: "permanentPasture"
17
18
  }
18
19
  _folders = [d for d in os.listdir(fixtures_folder) if os.path.isdir(os.path.join(fixtures_folder, d))]
19
20
 
@@ -0,0 +1,31 @@
1
+ import json
2
+ from unittest.mock import patch
3
+ from tests.utils import fixtures_path
4
+
5
+ from hestia_earth.models.cache_nodes import _cache_related_nodes, _cache_sources
6
+
7
+ class_path = 'hestia_earth.models.cache_nodes'
8
+ fixtures_folder = f"{fixtures_path}/cache_nodes"
9
+
10
+
11
+ def test_cache_related_nodes():
12
+ with open(f"{fixtures_folder}/nodes.json_no_validate", encoding='utf-8') as f:
13
+ data = json.load(f)
14
+
15
+ with open(f"{fixtures_folder}/cache_related_nodes/result.json_no_validate", encoding='utf-8') as f:
16
+ expected = json.load(f)
17
+
18
+ result = _cache_related_nodes(data.get('nodes'))
19
+ assert result == expected
20
+
21
+
22
+ @patch(f"{class_path}.find_sources", return_value=['source1'])
23
+ def test_cache_sources(*args):
24
+ with open(f"{fixtures_folder}/nodes.json_no_validate", encoding='utf-8') as f:
25
+ data = json.load(f)
26
+
27
+ with open(f"{fixtures_folder}/cache_sources/result.json_no_validate", encoding='utf-8') as f:
28
+ expected = json.load(f)
29
+
30
+ result = _cache_sources(data.get('nodes'))
31
+ assert result == expected
@@ -1,100 +0,0 @@
1
- from hestia_earth.schema import EmissionMethodTier
2
-
3
- from hestia_earth.models.log import logRequirements, logShouldRun
4
- from hestia_earth.models.utils.constant import Units, get_atomic_conversion
5
- from hestia_earth.models.utils.emission import _new_emission
6
- from hestia_earth.models.utils.measurement import most_relevant_measurement_value
7
- from hestia_earth.models.utils.ecoClimateZone import get_ecoClimateZone_lookup_value
8
- from hestia_earth.models.utils.cycle import land_occupation_per_ha
9
- from . import MODEL
10
-
11
- REQUIREMENTS = {
12
- "Cycle": {
13
- "or": [
14
- {
15
- "cycleDuration": "",
16
- "practices": [{"@type": "Practice", "value": "", "term.@id": "longFallowRatio"}]
17
- },
18
- {
19
- "@doc": "for plantations, additional properties are required",
20
- "practices": [
21
- {"@type": "Practice", "value": "", "term.@id": "nurseryDensity"},
22
- {"@type": "Practice", "value": "", "term.@id": "nurseryDuration"},
23
- {"@type": "Practice", "value": "", "term.@id": "plantationProductiveLifespan"},
24
- {"@type": "Practice", "value": "", "term.@id": "plantationDensity"},
25
- {"@type": "Practice", "value": "", "term.@id": "plantationLifespan"},
26
- {"@type": "Practice", "value": "", "term.@id": "rotationDuration"}
27
- ]
28
- }
29
- ],
30
- "site": {
31
- "@type": "Site",
32
- "measurements": [
33
- {"@type": "Measurement", "value": "", "term.@id": "histosol"},
34
- {"@type": "Measurement", "value": "", "term.@id": "ecoClimateZone"}
35
- ]
36
- },
37
- "optional": {
38
- "cycleDuration": ""
39
- }
40
- }
41
- }
42
- LOOKUPS = {
43
- "crop": "isPlantation",
44
- "ecoClimateZone": "IPCC_2006_ORGANIC_SOILS_TONNES_CO2-C_HECTARE"
45
- }
46
- RETURNS = {
47
- "Emission": [{
48
- "value": "",
49
- "methodTier": "tier 1"
50
- }]
51
- }
52
- TERM_ID = 'co2ToAirOrganicSoilCultivation'
53
- TIER = EmissionMethodTier.TIER_1.value
54
-
55
-
56
- def _emission(value: float):
57
- emission = _new_emission(TERM_ID, MODEL)
58
- emission['value'] = [value]
59
- emission['methodTier'] = TIER
60
- return emission
61
-
62
-
63
- def _run(histosol: float, organic_soil_factor: float, land_occupation: float):
64
- value = land_occupation * histosol / 100 * organic_soil_factor
65
- return [_emission(value)]
66
-
67
-
68
- def _get_CO2_factor(eco_climate_zone: str, site_type: str):
69
- return get_ecoClimateZone_lookup_value(
70
- eco_climate_zone, LOOKUPS['ecoClimateZone'], site_type
71
- ) * 1000 * get_atomic_conversion(Units.KG_CO2, Units.TO_C)
72
-
73
-
74
- def _should_run(cycle: dict):
75
- end_date = cycle.get('endDate')
76
- site = cycle.get('site', {})
77
- site_type = site.get('siteType', None)
78
- measurements = site.get('measurements', [])
79
-
80
- def _get_measurement_content(term_id: str):
81
- return most_relevant_measurement_value(measurements, term_id, end_date)
82
-
83
- histosol = _get_measurement_content('histosol')
84
- eco_climate_zone = _get_measurement_content('ecoClimateZone')
85
- organic_soil_factor = _get_CO2_factor(eco_climate_zone, site_type) if eco_climate_zone else 0
86
- land_occupation = land_occupation_per_ha(MODEL, TERM_ID, cycle)
87
-
88
- logRequirements(cycle, model=MODEL, term=TERM_ID,
89
- organic_soil_factor=organic_soil_factor,
90
- land_occupation=land_occupation,
91
- histosol=histosol)
92
-
93
- should_run = all([organic_soil_factor, land_occupation, histosol is not None])
94
- logShouldRun(cycle, MODEL, TERM_ID, should_run, methodTier=TIER)
95
- return should_run, histosol, organic_soil_factor, land_occupation
96
-
97
-
98
- def run(cycle: dict):
99
- should_run, histosol, organic_soil_factor, land_occupation = _should_run(cycle)
100
- return _run(histosol, organic_soil_factor, land_occupation) if should_run else []