hestia-earth-models 0.62.3__py3-none-any.whl → 0.62.5__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 (38) hide show
  1. hestia_earth/models/emepEea2019/co2ToAirFuelCombustion.py +2 -10
  2. hestia_earth/models/emepEea2019/n2OToAirFuelCombustionDirect.py +2 -10
  3. hestia_earth/models/emepEea2019/nh3ToAirExcreta.py +2 -9
  4. hestia_earth/models/emepEea2019/nh3ToAirInorganicFertiliser.py +2 -9
  5. hestia_earth/models/emepEea2019/noxToAirFuelCombustion.py +2 -10
  6. hestia_earth/models/emepEea2019/pm10ToAirAnimalHousing.py +57 -0
  7. hestia_earth/models/emepEea2019/pm25ToAirAnimalHousing.py +57 -0
  8. hestia_earth/models/emepEea2019/so2ToAirFuelCombustion.py +2 -10
  9. hestia_earth/models/emepEea2019/tspToAirAnimalHousing.py +57 -0
  10. hestia_earth/models/emepEea2019/utils.py +60 -1
  11. hestia_earth/models/faostat2018/liveweightPerHead.py +1 -1
  12. hestia_earth/models/ipcc2019/animal/pastureGrass.py +2 -2
  13. hestia_earth/models/ipcc2019/pastureGrass.py +2 -2
  14. hestia_earth/models/ipcc2019/pastureGrass_utils.py +1 -10
  15. hestia_earth/models/log.py +1 -1
  16. hestia_earth/models/mocking/search-results.json +145 -1
  17. hestia_earth/models/site/management.py +63 -35
  18. hestia_earth/models/utils/cycle.py +10 -1
  19. hestia_earth/models/utils/site.py +7 -0
  20. hestia_earth/models/utils/term.py +21 -1
  21. hestia_earth/models/version.py +1 -1
  22. {hestia_earth_models-0.62.3.dist-info → hestia_earth_models-0.62.5.dist-info}/METADATA +1 -1
  23. {hestia_earth_models-0.62.3.dist-info → hestia_earth_models-0.62.5.dist-info}/RECORD +38 -32
  24. tests/models/emepEea2019/test_co2ToAirFuelCombustion.py +3 -2
  25. tests/models/emepEea2019/test_n2OToAirFuelCombustionDirect.py +3 -2
  26. tests/models/emepEea2019/test_nh3ToAirExcreta.py +2 -1
  27. tests/models/emepEea2019/test_nh3ToAirInorganicFertiliser.py +4 -3
  28. tests/models/emepEea2019/test_noxToAirFuelCombustion.py +3 -2
  29. tests/models/emepEea2019/test_pm10ToAirAnimalHousing.py +21 -0
  30. tests/models/emepEea2019/test_pm25ToAirAnimalHousing.py +21 -0
  31. tests/models/emepEea2019/test_so2ToAirFuelCombustion.py +3 -2
  32. tests/models/emepEea2019/test_tspToAirAnimalHousing.py +21 -0
  33. tests/models/emepEea2019/test_utils.py +198 -1
  34. tests/models/faostat2018/test_liveweightPerHead.py +9 -0
  35. tests/models/site/test_management.py +55 -7
  36. {hestia_earth_models-0.62.3.dist-info → hestia_earth_models-0.62.5.dist-info}/LICENSE +0 -0
  37. {hestia_earth_models-0.62.3.dist-info → hestia_earth_models-0.62.5.dist-info}/WHEEL +0 -0
  38. {hestia_earth_models-0.62.3.dist-info → hestia_earth_models-0.62.5.dist-info}/top_level.txt +0 -0
@@ -15,16 +15,17 @@ condensed into a single node to aid readability.
15
15
  """
16
16
  from functools import reduce
17
17
 
18
- from hestia_earth.schema import SchemaType, TermTermType
18
+ from hestia_earth.schema import SchemaType, TermTermType, SiteSiteType
19
19
  from hestia_earth.utils.api import download_hestia
20
20
  from hestia_earth.utils.model import filter_list_term_type, linked_node
21
- from hestia_earth.utils.tools import flatten, safe_parse_float
21
+ from hestia_earth.utils.tools import safe_parse_float, flatten, non_empty_list
22
22
  from hestia_earth.utils.blank_node import get_node_value
23
23
 
24
24
  from hestia_earth.models.log import logRequirements, logShouldRun, log_blank_nodes_id
25
25
  from hestia_earth.models.utils.term import get_lookup_value
26
26
  from hestia_earth.models.utils.blank_node import condense_nodes
27
27
  from hestia_earth.models.utils.site import related_cycles
28
+ from hestia_earth.models.utils.site import get_land_cover_term_id as get_landCover_term_id_from_site_type
28
29
  from . import MODEL
29
30
 
30
31
  REQUIREMENTS = {
@@ -47,7 +48,8 @@ REQUIREMENTS = {
47
48
  "waterRegime",
48
49
  "tillage",
49
50
  "cropResidueManagement",
50
- "landUseManagement"
51
+ "landUseManagement",
52
+ "system"
51
53
  ],
52
54
  "units": ["% area", "boolean"],
53
55
  "value": ""
@@ -71,7 +73,7 @@ RETURNS = {
71
73
  "Management": [{
72
74
  "@type": "Management",
73
75
  "term.termType": [
74
- "landCover", "waterRegime", "tillage", "cropResidueManagement", "landUseManagement"
76
+ "landCover", "waterRegime", "tillage", "cropResidueManagement", "landUseManagement", "system"
75
77
  ],
76
78
  "value": "",
77
79
  "endDate": "",
@@ -119,6 +121,9 @@ INPUT_RULES = {
119
121
  )
120
122
  )
121
123
  }
124
+ _SKIP_LAND_COVER_SITE_TYPES = [
125
+ SiteSiteType.CROPLAND.value
126
+ ]
122
127
 
123
128
 
124
129
  def management(data: dict):
@@ -130,14 +135,15 @@ def _extract_node_value(node: dict) -> dict:
130
135
  return node | {'value': get_node_value(node)}
131
136
 
132
137
 
133
- def _include(value: dict, keys: list): return {k: v for k, v in value.items() if k in keys}
138
+ def _include(value: dict, keys: list) -> dict: return {k: v for k, v in value.items() if k in keys}
134
139
 
135
140
 
136
141
  def _default_dates(cycle: dict, values: list):
137
142
  return [(_include(cycle, ["startDate", "endDate"]) | v) for v in values]
138
143
 
139
144
 
140
- def _overwrite_dates(cycle: dict, values: list) -> list:
145
+ def _dates_from_current_cycle(cycle: dict, values: list) -> list:
146
+ """Always uses the dates from the cycle."""
141
147
  return [v | _include(cycle, ["startDate", "endDate"]) for v in values]
142
148
 
143
149
 
@@ -149,22 +155,21 @@ def _copy_item_if_exists(source: dict, keys: list[str] = None, dest: dict = None
149
155
 
150
156
  def _get_landCover_term_id(product: dict) -> str:
151
157
  value = get_lookup_value(product.get('term', {}), LAND_COVER_KEY, model=MODEL, model_key=LAND_COVER_KEY)
152
- # TODO: what should happen when there are multiple values?
153
158
  return value.split(';')[0] if value else None
154
159
 
155
160
 
156
- def _get_items_with_relevant_term_type(
157
- cycles: list[dict], item_name: str, relevant_values: list, date_fill: callable = _default_dates
158
- ):
159
- """Get items from the list of cycles with any of the relevant values. Also adds dates if missing."""
160
- return flatten(
161
- [
162
- date_fill(
163
- cycle=cycle,
164
- values=filter_list_term_type(cycle.get(item_name, []), relevant_values)
165
- ) for cycle in cycles
166
- ]
167
- )
161
+ def _get_relevant_items(
162
+ cycles: list[dict], item_name: str, relevant_terms: list, date_fill: callable = _default_dates
163
+ ) -> list:
164
+ """
165
+ Get items from the list of cycles with any of the relevant terms.
166
+ Also adds dates if missing.
167
+ """
168
+ return [
169
+ item
170
+ for cycle in cycles
171
+ for item in date_fill(cycle=cycle, values=filter_list_term_type(cycle.get(item_name, []), relevant_terms))
172
+ ]
168
173
 
169
174
 
170
175
  def _get_lookup_with_debug(term: dict, column: str) -> any:
@@ -211,28 +216,25 @@ def _get_relevant_inputs(cycles: list[dict]) -> list:
211
216
  return relevant_inputs
212
217
 
213
218
 
214
- def _should_run(site: dict):
215
- # Only get related cycles once.
216
- cycles = related_cycles(site)
217
-
219
+ def _should_run_all_products(cycles: list, site_type: str):
218
220
  products_land_cover = [
219
221
  _extract_node_value(
220
222
  _include(
221
223
  value=product,
222
224
  keys=["term", "value", "startDate", "endDate", "properties"]
223
225
  )
224
- ) for product in _get_items_with_relevant_term_type(
226
+ ) for product in _get_relevant_items(
225
227
  cycles=cycles,
226
228
  item_name="products",
227
- relevant_values=[TermTermType.LANDCOVER]
229
+ relevant_terms=[TermTermType.LANDCOVER]
228
230
  )
229
- ]
231
+ ] if site_type else []
230
232
 
231
- products_crop_forage = _get_items_with_relevant_term_type(
233
+ products_crop_forage = _get_relevant_items(
232
234
  cycles=cycles,
233
235
  item_name="products",
234
- relevant_values=[TermTermType.CROP, TermTermType.FORAGE],
235
- date_fill=_overwrite_dates
236
+ relevant_terms=[TermTermType.CROP, TermTermType.FORAGE],
237
+ date_fill=_dates_from_current_cycle
236
238
  )
237
239
  products_crop_forage = [
238
240
  _copy_item_if_exists(
@@ -243,9 +245,33 @@ def _should_run(site: dict):
243
245
  "value": 100
244
246
  }
245
247
  )
246
- for product in list(filter(_get_landCover_term_id, products_crop_forage))
247
- ]
248
- all_products = products_land_cover + products_crop_forage
248
+ for product in list(filter(_get_landCover_term_id, [i for i in products_crop_forage]))
249
+ ] if site_type else []
250
+ dates = sorted(list(set(
251
+ non_empty_list(flatten([[cycle.get('startDate'), cycle.get('endDate')] for cycle in cycles]))
252
+ ))) if site_type not in _SKIP_LAND_COVER_SITE_TYPES else []
253
+ site_type_term = download_hestia(get_landCover_term_id_from_site_type(site_type)) if all([
254
+ len(dates) >= 2,
255
+ site_type
256
+ ]) else None
257
+ products_site_type = [{
258
+ "term": linked_node(site_type_term),
259
+ "value": 100,
260
+ "startDate": dates[0],
261
+ "endDate": dates[-1]
262
+ }] if site_type_term else []
263
+
264
+ return products_site_type, products_crop_forage, products_land_cover
265
+
266
+
267
+ def _should_run(site: dict):
268
+ cycles = related_cycles(site)
269
+
270
+ products_animal, products_crop_forage, products_land_cover = _should_run_all_products(
271
+ cycles=cycles,
272
+ site_type=site.get("siteType", "")
273
+ )
274
+ all_products = products_land_cover + products_crop_forage + products_animal
249
275
  all_products = condense_nodes(all_products)
250
276
 
251
277
  practices = [
@@ -254,14 +280,15 @@ def _should_run(site: dict):
254
280
  value=practice,
255
281
  keys=["term", "value", "startDate", "endDate"]
256
282
  )
257
- ) for practice in _get_items_with_relevant_term_type(
283
+ ) for practice in _get_relevant_items(
258
284
  cycles=cycles,
259
285
  item_name="practices",
260
- relevant_values=[
286
+ relevant_terms=[
261
287
  TermTermType.WATERREGIME,
262
288
  TermTermType.TILLAGE,
263
289
  TermTermType.CROPRESIDUEMANAGEMENT,
264
- TermTermType.LANDUSEMANAGEMENT
290
+ TermTermType.LANDUSEMANAGEMENT,
291
+ TermTermType.SYSTEM
265
292
  ]
266
293
  )
267
294
  ]
@@ -275,6 +302,7 @@ def _should_run(site: dict):
275
302
  model_key=MODEL_KEY,
276
303
  products_crop_forage_ids=log_blank_nodes_id(products_crop_forage),
277
304
  products_land_cover_ids=log_blank_nodes_id(products_land_cover),
305
+ products_animal=log_blank_nodes_id(products_animal),
278
306
  practice_ids=log_blank_nodes_id(practices),
279
307
  inputs=log_blank_nodes_id(relevant_inputs)
280
308
  )
@@ -1,4 +1,4 @@
1
- from hestia_earth.schema import CycleFunctionalUnit, SiteSiteType, TermTermType
1
+ from hestia_earth.schema import CycleFunctionalUnit, SiteSiteType, TermTermType, AnimalReferencePeriod
2
2
  from hestia_earth.utils.model import filter_list_term_type, find_term_match, find_primary_product
3
3
  from hestia_earth.utils.tools import list_sum, safe_parse_float, safe_parse_date
4
4
 
@@ -455,3 +455,12 @@ def check_cycle_site_ids_identical(cycles: list[dict]) -> bool:
455
455
  Whether or not all of the cycles associated site ids are identical.
456
456
  """
457
457
  return len(set(cycle.get('site', {}).get('@id', None) for cycle in cycles)) <= 1
458
+
459
+
460
+ def get_animals_by_period(cycle: dict, period: AnimalReferencePeriod = AnimalReferencePeriod.AVERAGE):
461
+ return [
462
+ a for a in cycle.get('animals', []) if all([
463
+ a.get('value'),
464
+ a.get('referencePeriod') == period.value
465
+ ])
466
+ ]
@@ -5,6 +5,7 @@ from hestia_earth.utils.tools import non_empty_list, flatten, safe_parse_date
5
5
 
6
6
  from hestia_earth.models.log import debugMissingLookup
7
7
  from . import cached_value, _load_calculated_node
8
+ from .term import get_land_cover_siteTypes
8
9
 
9
10
  CACHE_YEARS_KEY = 'years'
10
11
  WATER_TYPES = [
@@ -120,3 +121,9 @@ def region_factor(model: str, region_id: str, term_id: str, termType: TermTermTy
120
121
  value = get_table_value(download_lookup(lookup_name), 'termid', region_id, column_name(term_id))
121
122
  debugMissingLookup(lookup_name, 'termid', region_id, term_id, value, model=model, term=term_id)
122
123
  return value
124
+
125
+
126
+ def get_land_cover_term_id(site_type: str):
127
+ land_cover_terms = get_land_cover_siteTypes()
128
+ term = next((term for term in land_cover_terms if term["name"].lower() == site_type.lower()), {})
129
+ return term.get("@id", "")
@@ -1,4 +1,4 @@
1
- from hestia_earth.schema import SchemaType, TermTermType
1
+ from hestia_earth.schema import SchemaType, TermTermType, SiteSiteType
2
2
  from hestia_earth.utils.lookup import download_lookup, get_table_value, column_name
3
3
  from hestia_earth.utils.api import find_node, search
4
4
 
@@ -626,3 +626,23 @@ def get_electricity_grid_mix_terms():
626
626
  }
627
627
  }, limit=LIMIT, fields=['@type', '@id', 'name', 'termType', 'units'])
628
628
  return list(map(lambda n: n["@id"], terms))
629
+
630
+
631
+ def get_land_cover_siteTypes():
632
+ """
633
+ Find all `Land Cover` terms with siteTypes
634
+
635
+ Returns
636
+ -------
637
+ List of landCover terms with associated siteTypes.
638
+ """
639
+ return search({
640
+ "bool": {
641
+ "must": [
642
+ {"match": {"@type": "Term"}},
643
+ {"match": {"termType": "landCover"}}
644
+ ],
645
+ "should": [{"match": {"name": siteType.value}} for siteType in SiteSiteType],
646
+ "minimum_should_match": 1
647
+ },
648
+ })
@@ -1 +1 @@
1
- VERSION = '0.62.3'
1
+ VERSION = '0.62.5'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hestia-earth-models
3
- Version: 0.62.3
3
+ Version: 0.62.5
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
@@ -1,10 +1,10 @@
1
1
  hestia_earth/__init__.py,sha256=G-d438vPx7m_ks5e9XTtM3u7LDRO5dSSukibukWmyPM,56
2
2
  hestia_earth/models/__init__.py,sha256=qEFeq3yuf3lQKVseALmL8aPM8fpCS54B_5pry00M3hk,76
3
3
  hestia_earth/models/cache_sites.py,sha256=KQp9cUKE-aIcYJoMWEtKFYS8gBFfsx5LKQhqoWpUSoM,6065
4
- hestia_earth/models/log.py,sha256=b63I3qyTtQs17xxbq8RI0Fv2lvZ1oDZ9k0njhxqiFFk,3459
4
+ hestia_earth/models/log.py,sha256=DbfNcGzaC5hzkuMDxQqW6XYoNBI4Uxw4SIoOYoZA6og,3474
5
5
  hestia_earth/models/preload_requests.py,sha256=y_okcYzSbqODvmzkw-wOK2cOZEzkJq3pmRfxRsPsUw0,1012
6
6
  hestia_earth/models/requirements.py,sha256=eU4yT443fx7BnaokhrLB_PCizJI7Y6m4auyo8vQauNg,17363
7
- hestia_earth/models/version.py,sha256=7aQk_ZZAw1avQvecDCGEiWz0z9mUZWdHHPPAzm2Hgf0,19
7
+ hestia_earth/models/version.py,sha256=nhEXCAlUUnEUnxeP_S43AOWaQmufkzv4hRSHjCAeqR0,19
8
8
  hestia_earth/models/agribalyse2016/__init__.py,sha256=WvK0qCQbnYtg9oZxrACd1wGormZyXibPtpCnIQeDqbw,415
9
9
  hestia_earth/models/agribalyse2016/fuelElectricity.py,sha256=tnGxBmJdPfPFfehLUQcefEqy1lHvzsSpx_s7O8nf3Zs,4412
10
10
  hestia_earth/models/agribalyse2016/machineryInfrastructureDepreciatedAmountPerCycle.py,sha256=_Rbngu0DzHKa62JwBl58ZC_ui1zLF2que_nB7ukhOQc,3392
@@ -114,13 +114,16 @@ hestia_earth/models/ecoinventV3/utils.py,sha256=HqtD8MzK9C_RCJ-ME-5G4J1KoCn5FqmA
114
114
  hestia_earth/models/ecoinventV3AndEmberClimate/__init__.py,sha256=XYFDUNpQpzbjPgLus0YlM3UdiXX7LLwn-XJqjrH9ywM,5801
115
115
  hestia_earth/models/ecoinventV3AndEmberClimate/utils.py,sha256=INWB7gyhzk49GQ0KAcBS-Kzwdoyd5MQJcsCtuT6XxZA,1352
116
116
  hestia_earth/models/emepEea2019/__init__.py,sha256=l90-pWrqIzt1ap1WNk0gF4iZeF5_TSG62hE83bIi4rQ,412
117
- hestia_earth/models/emepEea2019/co2ToAirFuelCombustion.py,sha256=DfoGlB5HjA1gafO0OutJjfsA6yPP_PsAd-p16evwCiQ,1609
118
- hestia_earth/models/emepEea2019/n2OToAirFuelCombustionDirect.py,sha256=R3lRF5-Md4Jd7irvTe8WJZJPc9-wa1pD6UWVk7lnGtQ,1616
119
- hestia_earth/models/emepEea2019/nh3ToAirExcreta.py,sha256=lWo1AaorIk4HtTCQAND3RFbCHO-em1DbA5ZOxv0Ldn8,3750
120
- hestia_earth/models/emepEea2019/nh3ToAirInorganicFertiliser.py,sha256=AMZlOpeajrhbjGWIq_mLJJHfOF9RH9GswkbvVyrqop0,6201
121
- hestia_earth/models/emepEea2019/noxToAirFuelCombustion.py,sha256=y49RvO5OkrZ4iK7o2Kmx5xW52y8SS9xEKAmlXlTQtWc,1609
122
- hestia_earth/models/emepEea2019/so2ToAirFuelCombustion.py,sha256=bo_0mFcwicpOkPsvZRAnL2tDBDRBAQqsPD_Wc5e20K4,1609
123
- hestia_earth/models/emepEea2019/utils.py,sha256=JcynSOdMU_jGuTptO0LLoK_JLkYtvn2gLPtYQBnM9Yo,1486
117
+ hestia_earth/models/emepEea2019/co2ToAirFuelCombustion.py,sha256=ib_xzEbIg-iQwvW2L4BosD9lV6EYOXAiIs8gYhSD9GE,1431
118
+ hestia_earth/models/emepEea2019/n2OToAirFuelCombustionDirect.py,sha256=H4dgGqDuvYN4S7TRxYsX3hms1xMWr8clR2gkyyO8T18,1438
119
+ hestia_earth/models/emepEea2019/nh3ToAirExcreta.py,sha256=HNz3w35V0X1Av7if4ZPlDxozrSMurjiy7Hl4iAVEoNg,3590
120
+ hestia_earth/models/emepEea2019/nh3ToAirInorganicFertiliser.py,sha256=n_lpGX6pnJdOy1GJoVSLgA9LnnnWOb_ZHBueZAEDCbk,6041
121
+ hestia_earth/models/emepEea2019/noxToAirFuelCombustion.py,sha256=2--8lI6C6WaYtd9LQe-WZnhvW1eUsjBVAgzT8jclcsc,1431
122
+ hestia_earth/models/emepEea2019/pm10ToAirAnimalHousing.py,sha256=ZxiyoKpT0JbwgEnK9HlselO5-nIq_CTpcGK5a8X5UkM,1527
123
+ hestia_earth/models/emepEea2019/pm25ToAirAnimalHousing.py,sha256=MYMRoFrmu3lhqS9aYE-GCWHfE-NFIgk9Q3Uj1osTlKA,1527
124
+ hestia_earth/models/emepEea2019/so2ToAirFuelCombustion.py,sha256=8B1GVsn5gEXVW3iZYBct-s_OTRaH-asXo6JvGW_jls0,1431
125
+ hestia_earth/models/emepEea2019/tspToAirAnimalHousing.py,sha256=hHHhu_EZWhxAKhGJgrHY3vNI7Kuy6h8-JyOuas7KRXk,1524
126
+ hestia_earth/models/emepEea2019/utils.py,sha256=oTHjbRRwJZv_tpO9MOlfpyQRmN0a1kvEZsVHUPliZpQ,4014
124
127
  hestia_earth/models/emissionNotRelevant/__init__.py,sha256=nIuPIkQR1ghv_T_Ab4Ckq5wmGdWVmgbaOjhtKfIJ-WE,2183
125
128
  hestia_earth/models/environmentalFootprintV3/__init__.py,sha256=lzg9qccwd9tbspw0lQ58YPprnvvSLTn3QV5T2-tPcC4,425
126
129
  hestia_earth/models/environmentalFootprintV3/freshwaterEcotoxicityPotentialCtue.py,sha256=X62-4v0NJdM_Z5kLK3NuU4GNEeSrXlKlMZQB_o4JZ6c,1018
@@ -131,7 +134,7 @@ hestia_earth/models/faostat2018/coldCarcassWeightPerHead.py,sha256=y1ouj5FBrnGWx
131
134
  hestia_earth/models/faostat2018/coldDressedCarcassWeightPerHead.py,sha256=Aphq7r06Q5-RDer4i1CneOLifVQCKTiVPTIWE3AxLfE,3230
132
135
  hestia_earth/models/faostat2018/landTransformationFromCropland100YearAverage.py,sha256=2qVeSGMoJ15pD6-p0Fsq1yN-3mpL8SyOKkVuIiYoJMg,2655
133
136
  hestia_earth/models/faostat2018/landTransformationFromCropland20YearAverage.py,sha256=0vJHRIb4F2G_8MG9Qgz2n-7dYerG5q6r7pG-j84LKjk,2648
134
- hestia_earth/models/faostat2018/liveweightPerHead.py,sha256=3h8zveCVQ21ms2qtsQyAYeet-98TMkipL6QLEnyUcTU,5111
137
+ hestia_earth/models/faostat2018/liveweightPerHead.py,sha256=flI3_TyG-7xoWp6cU6pZAFiXyHyFkfRz7Lmb7cQAffI,5140
135
138
  hestia_earth/models/faostat2018/readyToCookWeightPerHead.py,sha256=b1_GZQ3oFl88w6TY5DqLSqXNaYX6TcRBK4R9M2cWSjM,3165
136
139
  hestia_earth/models/faostat2018/seed.py,sha256=ts9PKs9UnZnJ9nPFlL7etL1Qb9uIWIES8Mz8W7FWbOw,2917
137
140
  hestia_earth/models/faostat2018/utils.py,sha256=r69UWDdMOLTYkI8_oQeEnUCOAZCnmwj_NwyrypAOb_A,3734
@@ -249,11 +252,11 @@ hestia_earth/models/ipcc2019/organicCarbonPerHa.py,sha256=iRUSVxMpBGgsVDkuBABPKI
249
252
  hestia_earth/models/ipcc2019/organicCarbonPerHa_tier_1_utils.py,sha256=JxVJ9mRml63VhwNSNq7H3O7YQJoXLgP4j9fIRs3ms5o,82431
250
253
  hestia_earth/models/ipcc2019/organicCarbonPerHa_tier_2_utils.py,sha256=A84r6u45HFk5jEb2nTWGTFTwX1qjq8F6qwkNUuiyH48,63542
251
254
  hestia_earth/models/ipcc2019/organicCarbonPerHa_utils.py,sha256=jIhRks8ewCtQNIIN89N_4A4Tp529YMQnk4YmZV6FOCY,10668
252
- hestia_earth/models/ipcc2019/pastureGrass.py,sha256=Dg94o-tMVR-SWW6dIK5kwbV4pcMBHEWtcSS2JhAtpXY,9491
253
- hestia_earth/models/ipcc2019/pastureGrass_utils.py,sha256=TqGHj4yZmEO6cVV3VeqSTl11TGRpipnliMMUIOqTy1k,13744
255
+ hestia_earth/models/ipcc2019/pastureGrass.py,sha256=4ZPbLlaIVf4-_ItoLU8fFhRhkWIUFIOcX2isSUOtLco,9550
256
+ hestia_earth/models/ipcc2019/pastureGrass_utils.py,sha256=KA5MAnaPXBgrNncBhcQtOF-cdLwEKI6O2F_DPEz5oTM,13502
254
257
  hestia_earth/models/ipcc2019/utils.py,sha256=MSDMu15D9DnilFUgi4_6jYXC0FaKso3OODauGTMB6hs,6229
255
258
  hestia_earth/models/ipcc2019/animal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
256
- hestia_earth/models/ipcc2019/animal/pastureGrass.py,sha256=QyT0qRO0lAJJU0Tp3PlDtXzbs7J6BXSX9kWo57T9GMw,11417
259
+ hestia_earth/models/ipcc2019/animal/pastureGrass.py,sha256=fSsWwf6lBlro4DIwbcAHSv0L-UMFe-liljfNr-kXWYw,11476
257
260
  hestia_earth/models/ipcc2019/animal/weightAtMaturity.py,sha256=5smSAmKVCIlELCD6S_3I16YuSWNFhcClGDOdvrIuYsE,3657
258
261
  hestia_earth/models/ipcc2021/__init__.py,sha256=VTgGFKhwMmk_nuI1RRq0in27fHYVPBonlXlPK00K8no,409
259
262
  hestia_earth/models/ipcc2021/gwp100.py,sha256=v-DYU-11XnWI1Ns1GEiKrJqL3JafxvhTsLmuBuFcxJU,1021
@@ -367,7 +370,7 @@ hestia_earth/models/linkedImpactAssessment/landTransformationFromPermanentPastur
367
370
  hestia_earth/models/linkedImpactAssessment/utils.py,sha256=dGwGc2d-8_WQElTpfyPmz5vQtL-LHQRmiZnCTuPXMDs,1876
368
371
  hestia_earth/models/mocking/__init__.py,sha256=n3Fkkrvh8zHNWiJZmnfQ7WZ91JRzAO9P6pSG1JpwtXo,687
369
372
  hestia_earth/models/mocking/mock_search.py,sha256=dBCDRfbZmbMLKP21u_VYkxyimomqs-zztjX-_ZNKuuM,2036
370
- hestia_earth/models/mocking/search-results.json,sha256=E-YgXbJEDOtPpC7VCv0bf1ckfQbZwkoLT-SzG_TcIh4,43349
373
+ hestia_earth/models/mocking/search-results.json,sha256=1hltFd6NwJIu9ThIGHJHatLsd3EflzRDnpShgM9vm60,46412
371
374
  hestia_earth/models/pooreNemecek2018/__init__.py,sha256=nPboL7ULJzL5nJD5q7q9VOZt_fxbKVm8fmn1Az5YkVY,417
372
375
  hestia_earth/models/pooreNemecek2018/aboveGroundCropResidueTotal.py,sha256=Qt-mel4dkhK6N5uUOutNOinCTFjbjtGzITaaI0LvYc4,2396
373
376
  hestia_earth/models/pooreNemecek2018/belowGroundCropResidue.py,sha256=JT0RybbvWVlo01FO8K0Yj41HrEaJT3Kj1xfayr2X-xw,2315
@@ -466,7 +469,7 @@ hestia_earth/models/site/brackishWater.py,sha256=vLEhIZv5PUKwzwvIuYrWi7K---fq7ZX
466
469
  hestia_earth/models/site/cationExchangeCapacityPerKgSoil.py,sha256=0eH4A-tXJ0hvIkiYXWxlx8TfrdbIKUGYUDk97-yQJgg,3653
467
470
  hestia_earth/models/site/flowingWater.py,sha256=v3g5722GIA4zQAUQI9yGFiZvFvI1QAVZqlQrY-6_B3A,1731
468
471
  hestia_earth/models/site/freshWater.py,sha256=FXs3Vt8V4e-wn325_dwSTOKlZtn5ksNUpvYGDeLJShY,1255
469
- hestia_earth/models/site/management.py,sha256=iljb0YjZqQcilXNlYIffjfEqszvMaLRKJlgv0TKIe-M,9627
472
+ hestia_earth/models/site/management.py,sha256=LlvXibkqJyHCQQarn1uGUp8HJRmA8PW208pp1wCuSWk,10772
470
473
  hestia_earth/models/site/netPrimaryProduction.py,sha256=UIIQkYd911qVzrWjxBLrC37e-RARIVgDwLdARY9BuLw,1849
471
474
  hestia_earth/models/site/organicCarbonPerHa.py,sha256=F2ShinHf0m9qKa1nCYBspsDkRY6jzOl0wM8mSDre22I,14916
472
475
  hestia_earth/models/site/organicCarbonPerKgSoil.py,sha256=t--wAshiAKS-JvEKhLFRadGvgSBv5NFZ68jdyms_wh4,1945
@@ -536,7 +539,7 @@ hestia_earth/models/utils/crop.py,sha256=kG054fryqPSBpmzvJFBy_CLiOdjrt7RMk5uTItO
536
539
  hestia_earth/models/utils/cropResidue.py,sha256=_0Q35CrliJeo31xGHsPWe8A2oHxijdIsOrf3gBEqhlA,612
537
540
  hestia_earth/models/utils/cropResidueManagement.py,sha256=nIDFjf39rDD10UHSVudfDyu-EiL261g8jyrgS-2aDKw,347
538
541
  hestia_earth/models/utils/currency.py,sha256=f_ArJANb--pZq4LL49SXQ1AMX_oKroqwBXKRRQqZwsM,578
539
- hestia_earth/models/utils/cycle.py,sha256=78J3pS0nW-S296OPl9RrPlHxDQdXY-3W66tKo_mANXU,15927
542
+ hestia_earth/models/utils/cycle.py,sha256=Q6NE5LWvoHng0l980r1i8lpmHWOL0HyMW6uXWhAf_Pw,16219
540
543
  hestia_earth/models/utils/descriptive_stats.py,sha256=qOyG8_TpWYmaxZ0h99n9L71gDLLiVMrMf0ChtxnZLjw,8559
541
544
  hestia_earth/models/utils/ecoClimateZone.py,sha256=NHFt-A9EiWXC6tUNIxkgOWUZOjj4I4uwJIP9ddDZegw,1112
542
545
  hestia_earth/models/utils/emission.py,sha256=5Dz8Z4P6QXbYSvOzVcqJy3R_oZMrp77_Iwj5xZsxsKc,3769
@@ -557,10 +560,10 @@ hestia_earth/models/utils/practice.py,sha256=tNadOzsrNlCEt801B815XaruJXzZ5yPASam
557
560
  hestia_earth/models/utils/product.py,sha256=H9UqJNzTqtMWXDQnbRkZlTpv_hg4s-Tya469fBk8InA,10143
558
561
  hestia_earth/models/utils/productivity.py,sha256=bUBVCZInGqHuHZvHDSYPQkjWXQxOtTjEk-1-f_BsFOo,594
559
562
  hestia_earth/models/utils/property.py,sha256=_9Wy0oZIBLsa-jOiGLokKehYLNdz-_7LfLaE4fb6SWM,5085
560
- hestia_earth/models/utils/site.py,sha256=yei3qk7edxb_boag9h8j713r06KGstjTBWdb1KjqMus,3602
563
+ hestia_earth/models/utils/site.py,sha256=zEj2PtIghk-L_vVJidlXM6_ed7HTc2-ogP0sQSh49vw,3874
561
564
  hestia_earth/models/utils/source.py,sha256=Y-CcO5Y3q5Hz4A4RdX35C1EUjL9w1NKnOrzVfOWQ7nU,1748
562
565
  hestia_earth/models/utils/temperature.py,sha256=ljlG4-yCgFFb6LRZweb18cZKLrr7K2mqd4E4Hz_D1f8,476
563
- hestia_earth/models/utils/term.py,sha256=pGg59IUaiTWlqKiT2jgIGvfZriVXaPwsLUbxWvBPXtQ,17812
566
+ hestia_earth/models/utils/term.py,sha256=lStzguJ0x13bPWzzNYD3cjZZVNDZ9xhl2jlAsMJHrxw,18327
564
567
  hestia_earth/models/utils/transformation.py,sha256=nyT5Mz4_VgFwhkL8JoNX9kxxow0zuxzsYl3W8xOu2p0,370
565
568
  hestia_earth/models/webbEtAl2012AndSintermannEtAl2012/__init__.py,sha256=Niv7ZFMBCwThlbCKGOwA17QdkpOUDFrqrFItGNqnZAA,434
566
569
  hestia_earth/models/webbEtAl2012AndSintermannEtAl2012/nh3ToAirOrganicFertiliser.py,sha256=TGXyusrRd9shT842iqbrI6MkQhICgw7uYdrl4jsDrg8,4193
@@ -667,13 +670,16 @@ tests/models/dammgen2009/test_noxToAirExcreta.py,sha256=RWd9QvzmJtN9M6UC6KDHkXwt
667
670
  tests/models/deRuijterEtAl2010/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
668
671
  tests/models/deRuijterEtAl2010/test_nh3ToAirCropResidueDecomposition.py,sha256=kS1nUBVohOSCb386g6Wq7iVclmx0haekUDYo7VQ4NCA,2030
669
672
  tests/models/emepEea2019/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
670
- tests/models/emepEea2019/test_co2ToAirFuelCombustion.py,sha256=HXQTSIkJzCKsb-9fGStkxtkcK65KS3sJlvShW2F6EaU,1450
671
- tests/models/emepEea2019/test_n2OToAirFuelCombustionDirect.py,sha256=vmZAAUkxfJyaRoioEEFmz8EtR3X_MCeaA-0VjjNNmQE,1456
672
- tests/models/emepEea2019/test_nh3ToAirExcreta.py,sha256=VtZFVWaHjqlxdge1Qir-OghNZtfsIJvLpg_8UNp0akU,1363
673
- tests/models/emepEea2019/test_nh3ToAirInorganicFertiliser.py,sha256=ZRU-mQiQLGX3xxOIP7r7iv08vCuRa6ElnKJs2AZ7a1E,2060
674
- tests/models/emepEea2019/test_noxToAirFuelCombustion.py,sha256=drCeoaGo6Ag3fdEDDSC3D880OXxzillzHk7rPYcVwmE,1450
675
- tests/models/emepEea2019/test_so2ToAirFuelCombustion.py,sha256=CNaT_z02DHDpBJ2IIkG0K7ra87WBg_iDkhx9QGAjk00,1450
676
- tests/models/emepEea2019/test_utils.py,sha256=jNb4T4yXWowUvY_1d_nxDTOBX-2K8jIG2TZ6SokxYP0,1843
673
+ tests/models/emepEea2019/test_co2ToAirFuelCombustion.py,sha256=z1H17R_Erox2dMg8xylGB0qt9BMZSwfLAoEMVv9z878,1518
674
+ tests/models/emepEea2019/test_n2OToAirFuelCombustionDirect.py,sha256=4uemriZAyJBSn-xMttRpxqVHOFNBXlboVODHQYl65zQ,1524
675
+ tests/models/emepEea2019/test_nh3ToAirExcreta.py,sha256=LsRynnkVjtkgxFjDS6CQBMUgN4O8qedQDuoNVClgdKQ,1425
676
+ tests/models/emepEea2019/test_nh3ToAirInorganicFertiliser.py,sha256=f623Pp6XTt9YPDr2QymAJEQ_yfx0_TZGndmawD8ZX98,2134
677
+ tests/models/emepEea2019/test_noxToAirFuelCombustion.py,sha256=HpuzWyFmfatFXwTZd8TVpHb6Kfj2Ru3IO1gHnSiuKtQ,1518
678
+ tests/models/emepEea2019/test_pm10ToAirAnimalHousing.py,sha256=xGlQeJkdP638zbHivxAqvliZCRpcogMFZYVCMWw6j3c,715
679
+ tests/models/emepEea2019/test_pm25ToAirAnimalHousing.py,sha256=cs3UaJ7ucCryOaQy0sbL9AiuC8l_N7uywmPZHcr3pC0,715
680
+ tests/models/emepEea2019/test_so2ToAirFuelCombustion.py,sha256=zRTyeeQM1fRdRVFWbtCNndaddDbKHU1xLzmp_psDceE,1518
681
+ tests/models/emepEea2019/test_tspToAirAnimalHousing.py,sha256=4MNDsxIeUk5_3IvZwEZslxgoPNyQN9OQFDNY3uGNX6E,714
682
+ tests/models/emepEea2019/test_utils.py,sha256=G6z8tEfWM0OPnUBaFCQgQyEi5-kRF_DqsqdYaPnzR_I,8761
677
683
  tests/models/environmentalFootprintV3/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
678
684
  tests/models/environmentalFootprintV3/test_freshwaterEcotoxicityPotentialCtue.py,sha256=lIgsdGh_0eDi-rPcCOrSSjVYNiET2GCSRkAHdugAkDk,851
679
685
  tests/models/epa2014/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -683,7 +689,7 @@ tests/models/faostat2018/test_coldCarcassWeightPerHead.py,sha256=RImhLygwrJ2RoEH
683
689
  tests/models/faostat2018/test_coldDressedCarcassWeightPerHead.py,sha256=hZVKMtf-F5Iz7igZVahDJoqzfm2VtcIlwWBPCry7kqw,1594
684
690
  tests/models/faostat2018/test_landTransformationFromCropland100YearAverage.py,sha256=AkDXj4qNKgbu5xRbw9u_cUibnVSnAK1CN8pc4IjK9fk,1263
685
691
  tests/models/faostat2018/test_landTransformationFromCropland20YearAverage.py,sha256=L03Xh1QbbXc9yGdMoHGNmyCpu9WKANNiEE73NoBSqxk,1260
686
- tests/models/faostat2018/test_liveweightPerHead.py,sha256=1gnezEdoWvb8Hu-W6YCD3ffI0hAYM8giz9Sl1YxgQDM,4500
692
+ tests/models/faostat2018/test_liveweightPerHead.py,sha256=5Z0Fw7iT3-REg8QjK8tUpWs5bUIG4fjWDM7SEOSYBcw,4799
687
693
  tests/models/faostat2018/test_readyToCookWeightPerHead.py,sha256=pMDcONs0WUvANcJ6_OPF7TBwMF45JGMxFRPNPtHLqVI,1570
688
694
  tests/models/faostat2018/test_seed.py,sha256=tUXoNVveX0m0ed9UXB4zXxIZsPxktXyUXlbWuUKG0sQ,1705
689
695
  tests/models/faostat2018/product/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -1009,7 +1015,7 @@ tests/models/site/test_brackishWater.py,sha256=YGCp4glaWudKklYBSp-50KbfvIRtp3F4Q
1009
1015
  tests/models/site/test_cationExchangeCapacityPerKgSoil.py,sha256=tNMhN998vcjQ15I-5mNnFh2d7mHzEBIBO6o1VSfQNUE,1075
1010
1016
  tests/models/site/test_flowingWater.py,sha256=t_rxvdlmUVDsFBoDF20_zDM-0iiLKkNCV7knO9l1T7o,1370
1011
1017
  tests/models/site/test_freshWater.py,sha256=GOeAxHhPW_2E1wQdQRX4W-r7mnb_LgmiAVLImitoApw,982
1012
- tests/models/site/test_management.py,sha256=1ecEbbHNmzA-qSw9-d_sGi-j64FXOCxUm1WLSEmPJHU,12659
1018
+ tests/models/site/test_management.py,sha256=eIZN1PKB3rlUVrHK_Bkwc3hald3-y68rIl8cRVGEDgk,14160
1013
1019
  tests/models/site/test_netPrimaryProduction.py,sha256=JCxG0MODbKVvl3hOqmKzh4FjHYn3Xs9KsVod6LvKQII,1108
1014
1020
  tests/models/site/test_organicCarbonPerHa.py,sha256=XtGrE7ZqthTF0x8lDxJ1slNd_GvYHEyEydcRgA46jEc,3207
1015
1021
  tests/models/site/test_organicCarbonPerKgSoil.py,sha256=0M-NMg_T3UXzGT_VlKOKhSxg4cZ0_zhd3FRgY5Hpj6o,1087
@@ -1088,8 +1094,8 @@ tests/models/utils/test_source.py,sha256=mv3vHZV5cjpoLA2I1109-YUkuzAiuhbRSnv_76_
1088
1094
  tests/models/utils/test_term.py,sha256=M5Sa26v2gzQYbZ4H_fo7DspnaCx__-WtL-MULGapCWk,3509
1089
1095
  tests/models/webbEtAl2012AndSintermannEtAl2012/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1090
1096
  tests/models/webbEtAl2012AndSintermannEtAl2012/test_nh3ToAirOrganicFertiliser.py,sha256=qi2FNXS5Af2WDtm7nq_FsprH3BfCF0XxnE0XHmC4aIY,2244
1091
- hestia_earth_models-0.62.3.dist-info/LICENSE,sha256=AC7h7GAgCZGJK_Tzh6LUCrML9gQEfowWwecEw2w54QM,1154
1092
- hestia_earth_models-0.62.3.dist-info/METADATA,sha256=W88V_K9ahWR2FHo76_7FbHPa6QINUx_0glKvYrO5G1c,3343
1093
- hestia_earth_models-0.62.3.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
1094
- hestia_earth_models-0.62.3.dist-info/top_level.txt,sha256=1dqA9TqpOLTEgpqa-YBsmbCmmNU1y56AtfFGEceZ2A0,19
1095
- hestia_earth_models-0.62.3.dist-info/RECORD,,
1097
+ hestia_earth_models-0.62.5.dist-info/LICENSE,sha256=AC7h7GAgCZGJK_Tzh6LUCrML9gQEfowWwecEw2w54QM,1154
1098
+ hestia_earth_models-0.62.5.dist-info/METADATA,sha256=OAujkDOEp9WGRnmAyJHbKMy1QeXRDfjmsedbSU3dwBo,3343
1099
+ hestia_earth_models-0.62.5.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
1100
+ hestia_earth_models-0.62.5.dist-info/top_level.txt,sha256=1dqA9TqpOLTEgpqa-YBsmbCmmNU1y56AtfFGEceZ2A0,19
1101
+ hestia_earth_models-0.62.5.dist-info/RECORD,,
@@ -5,6 +5,7 @@ from tests.utils import fixtures_path, fake_new_emission
5
5
  from hestia_earth.models.emepEea2019.co2ToAirFuelCombustion import MODEL, TERM_ID, run, _should_run
6
6
 
7
7
  class_path = f"hestia_earth.models.{MODEL}.{TERM_ID}"
8
+ model_utils_path = f"hestia_earth.models.{MODEL}.utils"
8
9
  fixtures_folder = f"{fixtures_path}/{MODEL}/{TERM_ID}"
9
10
 
10
11
 
@@ -21,7 +22,7 @@ def test_should_run(mock_get_fuel_values):
21
22
  assert should_run is True
22
23
 
23
24
 
24
- @patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
25
+ @patch(f"{model_utils_path}._new_emission", side_effect=fake_new_emission)
25
26
  def test_run(*args):
26
27
  with open(f"{fixtures_folder}/cycle.jsonld", encoding='utf-8') as f:
27
28
  cycle = json.load(f)
@@ -33,7 +34,7 @@ def test_run(*args):
33
34
  assert value == expected
34
35
 
35
36
 
36
- @patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
37
+ @patch(f"{model_utils_path}._new_emission", side_effect=fake_new_emission)
37
38
  def test_run_data_complete(*args):
38
39
  with open(f"{fixtures_folder}/no-input-data-complete/cycle.jsonld", encoding='utf-8') as f:
39
40
  cycle = json.load(f)
@@ -5,6 +5,7 @@ from tests.utils import fixtures_path, fake_new_emission
5
5
  from hestia_earth.models.emepEea2019.n2OToAirFuelCombustionDirect import MODEL, TERM_ID, run, _should_run
6
6
 
7
7
  class_path = f"hestia_earth.models.{MODEL}.{TERM_ID}"
8
+ model_utils_path = f"hestia_earth.models.{MODEL}.utils"
8
9
  fixtures_folder = f"{fixtures_path}/{MODEL}/{TERM_ID}"
9
10
 
10
11
 
@@ -21,7 +22,7 @@ def test_should_run(mock_get_fuel_values):
21
22
  assert should_run is True
22
23
 
23
24
 
24
- @patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
25
+ @patch(f"{model_utils_path}._new_emission", side_effect=fake_new_emission)
25
26
  def test_run(*args):
26
27
  with open(f"{fixtures_folder}/cycle.jsonld", encoding='utf-8') as f:
27
28
  cycle = json.load(f)
@@ -33,7 +34,7 @@ def test_run(*args):
33
34
  assert value == expected
34
35
 
35
36
 
36
- @patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
37
+ @patch(f"{model_utils_path}._new_emission", side_effect=fake_new_emission)
37
38
  def test_run_data_complete(*args):
38
39
  with open(f"{fixtures_folder}/no-input-data-complete/cycle.jsonld", encoding='utf-8') as f:
39
40
  cycle = json.load(f)
@@ -5,6 +5,7 @@ from tests.utils import fixtures_path, fake_new_emission
5
5
  from hestia_earth.models.emepEea2019.nh3ToAirExcreta import MODEL, TERM_ID, run, _should_run
6
6
 
7
7
  class_path = f"hestia_earth.models.{MODEL}.{TERM_ID}"
8
+ model_utils_path = f"hestia_earth.models.{MODEL}.utils"
8
9
  fixtures_folder = f"{fixtures_path}/{MODEL}/{TERM_ID}"
9
10
 
10
11
 
@@ -34,7 +35,7 @@ def test_should_run(mock_get_lookup_factor, mock_excreta, *args):
34
35
  assert should_run is True
35
36
 
36
37
 
37
- @patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
38
+ @patch(f"{model_utils_path}._new_emission", side_effect=fake_new_emission)
38
39
  def test_run(*args):
39
40
  with open(f"{fixtures_folder}/cycle.jsonld", encoding='utf-8') as f:
40
41
  cycle = json.load(f)
@@ -5,6 +5,7 @@ from tests.utils import fixtures_path, fake_new_emission
5
5
  from hestia_earth.models.emepEea2019.nh3ToAirInorganicFertiliser import MODEL, TERM_ID, run, _should_run
6
6
 
7
7
  class_path = f"hestia_earth.models.{MODEL}.{TERM_ID}"
8
+ model_utils_path = f"hestia_earth.models.{MODEL}.utils"
8
9
  fixtures_folder = f"{fixtures_path}/{MODEL}/{TERM_ID}"
9
10
 
10
11
 
@@ -27,7 +28,7 @@ def test_should_run(mock_measurement, *args):
27
28
  assert should_run is True
28
29
 
29
30
 
30
- @patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
31
+ @patch(f"{model_utils_path}._new_emission", side_effect=fake_new_emission)
31
32
  def test_run(*args):
32
33
  with open(f"{fixtures_folder}/cycle.jsonld", encoding='utf-8') as f:
33
34
  cycle = json.load(f)
@@ -39,7 +40,7 @@ def test_run(*args):
39
40
  assert value == expected
40
41
 
41
42
 
42
- @patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
43
+ @patch(f"{model_utils_path}._new_emission", side_effect=fake_new_emission)
43
44
  def test_run_with_unspecified(*args):
44
45
  with open(f"{fixtures_folder}/with-unspecified/cycle.jsonld", encoding='utf-8') as f:
45
46
  cycle = json.load(f)
@@ -51,7 +52,7 @@ def test_run_with_unspecified(*args):
51
52
  assert value == expected
52
53
 
53
54
 
54
- @patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
55
+ @patch(f"{model_utils_path}._new_emission", side_effect=fake_new_emission)
55
56
  def test_run_complete(*args):
56
57
  with open(f"{fixtures_folder}/is-complete/cycle.jsonld", encoding='utf-8') as f:
57
58
  cycle = json.load(f)
@@ -5,6 +5,7 @@ from tests.utils import fixtures_path, fake_new_emission
5
5
  from hestia_earth.models.emepEea2019.noxToAirFuelCombustion import MODEL, TERM_ID, run, _should_run
6
6
 
7
7
  class_path = f"hestia_earth.models.{MODEL}.{TERM_ID}"
8
+ model_utils_path = f"hestia_earth.models.{MODEL}.utils"
8
9
  fixtures_folder = f"{fixtures_path}/{MODEL}/{TERM_ID}"
9
10
 
10
11
 
@@ -21,7 +22,7 @@ def test_should_run(mock_get_fuel_values):
21
22
  assert should_run is True
22
23
 
23
24
 
24
- @patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
25
+ @patch(f"{model_utils_path}._new_emission", side_effect=fake_new_emission)
25
26
  def test_run(*args):
26
27
  with open(f"{fixtures_folder}/cycle.jsonld", encoding='utf-8') as f:
27
28
  cycle = json.load(f)
@@ -33,7 +34,7 @@ def test_run(*args):
33
34
  assert value == expected
34
35
 
35
36
 
36
- @patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
37
+ @patch(f"{model_utils_path}._new_emission", side_effect=fake_new_emission)
37
38
  def test_run_data_complete(*args):
38
39
  with open(f"{fixtures_folder}/no-input-data-complete/cycle.jsonld", encoding='utf-8') as f:
39
40
  cycle = json.load(f)
@@ -0,0 +1,21 @@
1
+ from unittest.mock import patch
2
+ import json
3
+
4
+ from tests.utils import fixtures_path, fake_new_emission
5
+ from hestia_earth.models.emepEea2019.pm10ToAirAnimalHousing import MODEL, TERM_ID, run
6
+
7
+ class_path = f"hestia_earth.models.{MODEL}.{TERM_ID}"
8
+ model_utils_path = f"hestia_earth.models.{MODEL}.utils"
9
+ fixtures_folder = f"{fixtures_path}/{MODEL}/{TERM_ID}"
10
+
11
+
12
+ @patch(f"{model_utils_path}._new_emission", side_effect=fake_new_emission)
13
+ def test_run(*args):
14
+ with open(f"{fixtures_folder}/cycle.jsonld", encoding='utf-8') as f:
15
+ cycle = json.load(f)
16
+
17
+ with open(f"{fixtures_folder}/result.jsonld", encoding='utf-8') as f:
18
+ expected = json.load(f)
19
+
20
+ value = run(cycle)
21
+ assert value == expected
@@ -0,0 +1,21 @@
1
+ from unittest.mock import patch
2
+ import json
3
+
4
+ from tests.utils import fixtures_path, fake_new_emission
5
+ from hestia_earth.models.emepEea2019.pm25ToAirAnimalHousing import MODEL, TERM_ID, run
6
+
7
+ class_path = f"hestia_earth.models.{MODEL}.{TERM_ID}"
8
+ model_utils_path = f"hestia_earth.models.{MODEL}.utils"
9
+ fixtures_folder = f"{fixtures_path}/{MODEL}/{TERM_ID}"
10
+
11
+
12
+ @patch(f"{model_utils_path}._new_emission", side_effect=fake_new_emission)
13
+ def test_run(*args):
14
+ with open(f"{fixtures_folder}/cycle.jsonld", encoding='utf-8') as f:
15
+ cycle = json.load(f)
16
+
17
+ with open(f"{fixtures_folder}/result.jsonld", encoding='utf-8') as f:
18
+ expected = json.load(f)
19
+
20
+ value = run(cycle)
21
+ assert value == expected