hestia-earth-models 0.65.9__py3-none-any.whl → 0.65.10__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 (31) hide show
  1. hestia_earth/models/cml2001Baseline/abioticResourceDepletionFossilFuels.py +3 -5
  2. hestia_earth/models/cml2001Baseline/abioticResourceDepletionMineralsAndMetals.py +1 -1
  3. hestia_earth/models/config/Cycle.json +9 -9
  4. hestia_earth/models/config/Site.json +18 -0
  5. hestia_earth/models/config/__init__.py +6 -0
  6. hestia_earth/models/cycle/materialAndSubstrate.py +1 -1
  7. hestia_earth/models/cycle/milkYield.py +9 -6
  8. hestia_earth/models/cycle/product/economicValueShare.py +8 -4
  9. hestia_earth/models/cycle/product/revenue.py +11 -7
  10. hestia_earth/models/faostat2018/product/price.py +1 -1
  11. hestia_earth/models/geospatialDatabase/utils.py +22 -17
  12. hestia_earth/models/mocking/search-results.json +914 -914
  13. hestia_earth/models/site/defaultMethodClassification.py +35 -0
  14. hestia_earth/models/site/defaultMethodClassificationDescription.py +39 -0
  15. hestia_earth/models/site/management.py +29 -18
  16. hestia_earth/models/utils/impact_assessment.py +5 -3
  17. hestia_earth/models/version.py +1 -1
  18. {hestia_earth_models-0.65.9.dist-info → hestia_earth_models-0.65.10.dist-info}/METADATA +2 -2
  19. {hestia_earth_models-0.65.9.dist-info → hestia_earth_models-0.65.10.dist-info}/RECORD +31 -27
  20. tests/models/cml2001Baseline/test_abioticResourceDepletionFossilFuels.py +2 -16
  21. tests/models/cml2001Baseline/test_abioticResourceDepletionMineralsAndMetals.py +2 -16
  22. tests/models/edip2003/test_ozoneDepletionPotential.py +0 -13
  23. tests/models/ipcc2021/test_gwp100.py +0 -9
  24. tests/models/poschEtAl2008/test_terrestrialAcidificationPotentialAccumulatedExceedance.py +0 -14
  25. tests/models/poschEtAl2008/test_terrestrialEutrophicationPotentialAccumulatedExceedance.py +0 -14
  26. tests/models/site/test_defaultMethodClassification.py +18 -0
  27. tests/models/site/test_defaultMethodClassificationDescription.py +18 -0
  28. tests/models/test_config.py +11 -2
  29. {hestia_earth_models-0.65.9.dist-info → hestia_earth_models-0.65.10.dist-info}/LICENSE +0 -0
  30. {hestia_earth_models-0.65.9.dist-info → hestia_earth_models-0.65.10.dist-info}/WHEEL +0 -0
  31. {hestia_earth_models-0.65.9.dist-info → hestia_earth_models-0.65.10.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,35 @@
1
+ """
2
+ Default Method Classification.
3
+
4
+ When gap-filling `management` node on Site, the
5
+ `defaultMethodClassification` and `defaultMethodClassificationDescription` fields become required.
6
+ This model will use the first value in the `management` node.
7
+ """
8
+ from hestia_earth.models.log import logRequirements, logShouldRun
9
+ from . import MODEL
10
+
11
+ REQUIREMENTS = {
12
+ "Site": {
13
+ "management": [{"@type": "Management", "methodClassification": ""}]
14
+ }
15
+ }
16
+ RETURNS = {
17
+ "The methodClassification as a `string`": ""
18
+ }
19
+ MODEL_KEY = 'defaultMethodClassification'
20
+
21
+
22
+ def _should_run(site: dict):
23
+ methodClassification = next((n.get('methodClassification') for n in site.get('management', [])), None)
24
+
25
+ logRequirements(site, model=MODEL, model_key=MODEL_KEY,
26
+ methodClassification=methodClassification)
27
+
28
+ should_run = all([methodClassification])
29
+ logShouldRun(site, MODEL, None, should_run, model_key=MODEL_KEY)
30
+ return should_run, methodClassification
31
+
32
+
33
+ def run(site: dict):
34
+ should_run, value = _should_run(site)
35
+ return value
@@ -0,0 +1,39 @@
1
+ """
2
+ Default Method Classification Description.
3
+
4
+ When gap-filling `management` node on Site, the
5
+ `defaultMethodClassification` and `defaultMethodClassificationDescription` fields become required.
6
+ This model will use the first value in the `management` node.
7
+ """
8
+ from hestia_earth.models.log import logRequirements, logShouldRun
9
+ from . import MODEL
10
+
11
+ REQUIREMENTS = {
12
+ "Site": {
13
+ "management": [{"@type": "Management", "methodClassification": "", "methodClassificationDescription": ""}]
14
+ }
15
+ }
16
+ RETURNS = {
17
+ "The methodClassification as a `string`": ""
18
+ }
19
+ MODEL_KEY = 'defaultMethodClassificationDescription'
20
+
21
+
22
+ def _should_run(site: dict):
23
+ methodClassificationDescription = next((
24
+ n.get('methodClassificationDescription')
25
+ for n in site.get('management', [])
26
+ if n.get('methodClassification')
27
+ ), None)
28
+
29
+ logRequirements(site, model=MODEL, model_key=MODEL_KEY,
30
+ methodClassificationDescription=methodClassificationDescription)
31
+
32
+ should_run = all([methodClassificationDescription])
33
+ logShouldRun(site, MODEL, None, should_run, model_key=MODEL_KEY)
34
+ return should_run, methodClassificationDescription
35
+
36
+
37
+ def run(site: dict):
38
+ should_run, value = _should_run(site)
39
+ return value
@@ -165,15 +165,28 @@ def _gap_filled_date_obj(date_str: str, mode: str = DatestrGapfillMode.END) -> d
165
165
  )
166
166
 
167
167
 
168
- def _gap_filled_start_date(land_cover_id: str, end_date: str, cycle: dict) -> datetime:
168
+ def _gap_filled_start_date(land_cover_id: str, end_date: str, cycle: dict) -> dict:
169
169
  """If possible, gap-fill the startDate based on the endDate - maximumCycleDuration"""
170
170
  maximum_cycle_duration = _get_maximum_cycle_duration(land_cover_id)
171
- return max(
172
- _gap_filled_date_obj(end_date) - timedelta(days=maximum_cycle_duration)
173
- if maximum_cycle_duration else datetime.fromtimestamp(0),
174
- _gap_filled_date_obj(cycle.get("startDate"), mode=DatestrGapfillMode.START)
175
- if cycle.get("startDate") else datetime.fromtimestamp(0)
176
- ) if any([maximum_cycle_duration, cycle.get("startDate")]) else None
171
+ return {
172
+ "startDate": max(
173
+ _gap_filled_date_obj(end_date) - timedelta(days=maximum_cycle_duration)
174
+ if maximum_cycle_duration else datetime.fromtimestamp(0),
175
+ _gap_filled_date_obj(cycle.get("startDate"), mode=DatestrGapfillMode.START)
176
+ if cycle.get("startDate") else datetime.fromtimestamp(0)
177
+ )
178
+ } if any([maximum_cycle_duration, cycle.get("startDate")]) else {}
179
+
180
+
181
+ def _include_with_date_gap_fill(value: dict, keys: list) -> dict:
182
+ return {
183
+ k: (
184
+ _gap_filled_date_only_str(v) if k == "endDate" else
185
+ _gap_filled_date_only_str(v, mode=DatestrGapfillMode.START) if k == "startDate" else
186
+ v
187
+ )
188
+ for k, v in value.items() if k in keys
189
+ }
177
190
 
178
191
 
179
192
  def _should_gap_fill(term: dict):
@@ -210,15 +223,13 @@ def _get_relevant_items(cycle: dict, item_name: str, relevant_terms: list):
210
223
  Also adds dates from Cycle.
211
224
  """
212
225
  items = [
213
- _include(cycle, ["startDate", "endDate"]) |
226
+ _include_with_date_gap_fill(cycle, ["startDate", "endDate"]) |
214
227
  _include(
215
- {
216
- "startDate": _gap_filled_start_date(
217
- land_cover_id=get_landCover_term_id(item.get('term', {})),
218
- end_date=item.get("endDate") if "endDate" in item else cycle.get("endDate", ""),
219
- cycle=cycle
220
- )
221
- } if "startDate" not in item else {},
228
+ _gap_filled_start_date(
229
+ land_cover_id=get_landCover_term_id(item.get('term', {})),
230
+ end_date=item.get("endDate") if "endDate" in item else cycle.get("endDate", ""),
231
+ cycle=cycle
232
+ ) if "startDate" not in item else {},
222
233
  "startDate"
223
234
  ) |
224
235
  item
@@ -266,7 +277,7 @@ def _run_from_siteType(site: dict, cycle: dict):
266
277
 
267
278
 
268
279
  def _run_products(cycle: dict, products: list, total_products: int = None, use_cycle_dates: bool = False):
269
- default_dates = _include(cycle, ["startDate", "endDate"])
280
+ default_dates = _include_with_date_gap_fill(cycle, ["startDate", "endDate"])
270
281
  return [
271
282
  _map_to_value(default_dates | _copy_item_if_exists(
272
283
  source=product,
@@ -289,7 +300,7 @@ def _run_from_landCover(cycle: dict, crop_forage_products: list):
289
300
  """
290
301
  land_cover_products = [
291
302
  _map_to_value(_extract_node_value(
292
- _include(
303
+ _include_with_date_gap_fill(
293
304
  value=product,
294
305
  keys=["term", "value", "startDate", "endDate", "properties"]
295
306
  )
@@ -354,7 +365,7 @@ def _should_run_practice(practice: dict):
354
365
  def _run_from_practices(cycle: dict):
355
366
  practices = [
356
367
  _extract_node_value(
357
- _include(
368
+ _include_with_date_gap_fill(
358
369
  value=practice,
359
370
  keys=["term", "value", "startDate", "endDate"]
360
371
  )
@@ -119,7 +119,8 @@ def impact_emission_lookup_value(
119
119
  lookup_name='emission.csv',
120
120
  lookup_col=lookup_col,
121
121
  blank_nodes=filter_list_term_type(impact.get('emissionsResourceUse', []), TermTermType.EMISSION),
122
- grouped_key=grouped_key
122
+ grouped_key=grouped_key,
123
+ default_no_values=None
123
124
  )
124
125
 
125
126
 
@@ -170,7 +171,7 @@ def impact_country_value(
170
171
 
171
172
  # fail if some factors are missing
172
173
  return None if not all_with_factors else (
173
- list_sum(values) if len(values) > 0 else 0
174
+ list_sum(values) if len(values) > 0 else None
174
175
  )
175
176
 
176
177
 
@@ -236,7 +237,8 @@ def impact_endpoint_value(model: str, term_id: str, impact: dict, lookup_col: st
236
237
  node=impact,
237
238
  lookup_name='characterisedIndicator.csv',
238
239
  lookup_col=lookup_col,
239
- blank_nodes=nodes
240
+ blank_nodes=nodes,
241
+ default_no_values=None
240
242
  )
241
243
 
242
244
 
@@ -1 +1 @@
1
- VERSION = '0.65.9'
1
+ VERSION = '0.65.10'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hestia-earth-models
3
- Version: 0.65.9
3
+ Version: 0.65.10
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
@@ -12,7 +12,7 @@ Classifier: Programming Language :: Python :: 3.6
12
12
  Description-Content-Type: text/markdown
13
13
  License-File: LICENSE
14
14
  Requires-Dist: hestia-earth-schema==30.*
15
- Requires-Dist: hestia-earth-utils>=0.13.16
15
+ Requires-Dist: hestia-earth-utils>=0.13.19
16
16
  Requires-Dist: python-dateutil>=2.8.1
17
17
  Requires-Dist: CurrencyConverter==0.16.8
18
18
  Requires-Dist: haversine>=2.7.0
@@ -4,7 +4,7 @@ hestia_earth/models/cache_sites.py,sha256=Llo2SH1Lp-R8x1JRxJ2Ta-vw5RbdUj2FHXUP-c
4
4
  hestia_earth/models/log.py,sha256=_zAfyOkL_VknEnMFvcpvenSMghadlDfZhiSx28545Gk,3558
5
5
  hestia_earth/models/preload_requests.py,sha256=vK_G1UzhNMhYy7ymnCtHUz_vv3cfApCSKqv29VREEBQ,1943
6
6
  hestia_earth/models/requirements.py,sha256=eU4yT443fx7BnaokhrLB_PCizJI7Y6m4auyo8vQauNg,17363
7
- hestia_earth/models/version.py,sha256=kCzRyuygd47dgg8pZkkwCs6b_7Lb4-nPncYEsjaT4jc,19
7
+ hestia_earth/models/version.py,sha256=kGCwazFyJPTHO9Kny5rZmqHxPuatjOBEax2liicBscw,20
8
8
  hestia_earth/models/agribalyse2016/__init__.py,sha256=WvK0qCQbnYtg9oZxrACd1wGormZyXibPtpCnIQeDqbw,415
9
9
  hestia_earth/models/agribalyse2016/fuelElectricity.py,sha256=rm5ZaRAzJ08m2y4BxkGh-RjudkDWgozmg3XumoRm-fQ,4511
10
10
  hestia_earth/models/agribalyse2016/machineryInfrastructureDepreciatedAmountPerCycle.py,sha256=BPjnWmg73i_OxM2ouCdMTWZtPIqyoUAXrvutntyteE0,3390
@@ -27,17 +27,17 @@ hestia_earth/models/chaudharyBrooks2018/damageToTerrestrialEcosystemsLandTransfo
27
27
  hestia_earth/models/chaudharyBrooks2018/damageToTerrestrialEcosystemsTotalLandUseEffects.py,sha256=11H8j9i2h2zChea92CdzPodWZfdegkAnQx6qYC6Ym9A,2623
28
28
  hestia_earth/models/chaudharyBrooks2018/utils.py,sha256=Z0IrvVv-dKsRt09LmT7sc6e1bWnhjZ-WBrO-namIngo,1539
29
29
  hestia_earth/models/cml2001Baseline/__init__.py,sha256=0uGrCKDNUH-MUkpvts9MyPMnZKao-M03gU8uKquUozQ,416
30
- hestia_earth/models/cml2001Baseline/abioticResourceDepletionFossilFuels.py,sha256=nRAwh5UljL7Tg0BGlYsA6nrIGzIlizVPeangtjHOIQE,7869
31
- hestia_earth/models/cml2001Baseline/abioticResourceDepletionMineralsAndMetals.py,sha256=4p9Ui78F69yhZkXCwcM6lwbpaNLdpO9p_uJDnLqYhRM,5919
30
+ hestia_earth/models/cml2001Baseline/abioticResourceDepletionFossilFuels.py,sha256=K3IfNziLDGvfmHsWBUXCwAl1k2Z6p-02Vi7HG3jZRhI,7708
31
+ hestia_earth/models/cml2001Baseline/abioticResourceDepletionMineralsAndMetals.py,sha256=yXie6UW0_I4VQcADn7Uvk4n1RmrFAauJ7ZVh7OgBUyA,5952
32
32
  hestia_earth/models/cml2001Baseline/eutrophicationPotentialExcludingFate.py,sha256=nUWKsn3COqAOrYNmiBKnA2rUs88pj4o3k4fHKA0TVbU,1068
33
33
  hestia_earth/models/cml2001Baseline/terrestrialAcidificationPotentialIncludingFateAverageEurope.py,sha256=N8neIISqeTAS7VGTNWbbbozOtfCb816qwwHCnv7Nnpw,1113
34
34
  hestia_earth/models/cml2001NonBaseline/__init__.py,sha256=vI8wp8Og_e8DiJqYYvp33YoI3t4ffAC31LWlnV20JTg,419
35
35
  hestia_earth/models/cml2001NonBaseline/eutrophicationPotentialIncludingFateAverageEurope.py,sha256=lcgyRHY08KCBFPERJNqV4DYGEJCvyHBDnJXD0kEkVqM,1097
36
36
  hestia_earth/models/cml2001NonBaseline/terrestrialAcidificationPotentialExcludingFate.py,sha256=xcrxfs9UoV_EWvV-XzMt35oPWCUsTzqg2SGA3j2MFIw,1091
37
- hestia_earth/models/config/Cycle.json,sha256=HcwStlwnBEjuZwoK6gCFdCfvX5RphSPhDGDj0LQ32Fg,56086
37
+ hestia_earth/models/config/Cycle.json,sha256=b_TTZGQ5QbD6BZ2tYezFlsxBKVwZONRVfA0cXAt1PBQ,56069
38
38
  hestia_earth/models/config/ImpactAssessment.json,sha256=EB8O8_GZ182upCP-Rpko7I48Tdf30ScK-ZZ3rf4DQQI,57585
39
- hestia_earth/models/config/Site.json,sha256=FfuME8DLLyoHYJ2uBgnueTIK9E7m9aV7iPT8TBoqlzk,12565
40
- hestia_earth/models/config/__init__.py,sha256=UZZdwfnxTqnZLG4hNecu6sfKvMLvctjdWFraE_9H438,2130
39
+ hestia_earth/models/config/Site.json,sha256=SyajKMEg03v9_NdiQlfcyF7B60lrBlXZF6tlahnpfZA,13071
40
+ hestia_earth/models/config/__init__.py,sha256=l1WqL7ezlank86ABP4zUia_hIvM9ba-sOE3z6wNrea8,2333
41
41
  hestia_earth/models/config/run-calculations.json,sha256=e3nJ4M6CP1iFzfv8ou_ZUFbFxYkDxJgwuNDXTm4PBDc,615
42
42
  hestia_earth/models/config/trigger-calculations.json,sha256=3dmn2bRuj6QEtSTOLdIy31ho7thgUXyDsnqZzPV9rAQ,623
43
43
  hestia_earth/models/cycle/__init__.py,sha256=VowO3kOHb0LpURsljNaJsYO7s6vgjhul6bF_85UjUEI,406
@@ -57,8 +57,8 @@ hestia_earth/models/cycle/inorganicFertiliser.py,sha256=Yt5NcP9FQEzWwlritrPGbhh2
57
57
  hestia_earth/models/cycle/irrigatedTypeUnspecified.py,sha256=KlIa5eDvT47Twz6Q1kpw0rMlRjCK25CExaW58DEvc9w,2125
58
58
  hestia_earth/models/cycle/liveAnimal.py,sha256=5dlvuVAu24hLLOVXsozcVzWyDVzddzoungUBwrBDS-g,3986
59
59
  hestia_earth/models/cycle/longFallowRatio.py,sha256=_h0kub99sACO87IfjMeiu8IgdK2jaeBlgGA9A9-ViZA,1683
60
- hestia_earth/models/cycle/materialAndSubstrate.py,sha256=PaTnS3QVxGEMLMn4nuWHYp8npiZjDaDijRJHoUoRV40,5184
61
- hestia_earth/models/cycle/milkYield.py,sha256=JUwKK9gwXZiir7YK7_tOuV3B4Aml0LnJszfCA3Ygh3o,5816
60
+ hestia_earth/models/cycle/materialAndSubstrate.py,sha256=euvY_qKmLlwixCoUnagQRZ5oHtTB7VSPjgmEq8fN3Qg,5186
61
+ hestia_earth/models/cycle/milkYield.py,sha256=ghJXXxVQVYC3xtPgyp6FvbIuheJfeh2zwRBf9IkQi2E,5902
62
62
  hestia_earth/models/cycle/otherSitesArea.py,sha256=Xhi6C1K1v4VXv1Mhkg-b9JCAG-DfTQoEi9ICs71418w,1650
63
63
  hestia_earth/models/cycle/otherSitesUnusedDuration.py,sha256=ZqQaI9FvNVpONmsIiRo1BqSJJKC5Mgi-W6lt18sxTiA,2985
64
64
  hestia_earth/models/cycle/pastureGrass.py,sha256=7PrmDMJPtsbKGa8WIOh_4NXNtbH3Pxb23pmjawQuY9o,1226
@@ -114,11 +114,11 @@ hestia_earth/models/cycle/pre_checks/otherSites.py,sha256=MQpf_v4lTIR60zF7slp3LB
114
114
  hestia_earth/models/cycle/pre_checks/site.py,sha256=OkrEOxwbo5rzAWQaPt2p9uZ9g7Vc58QweGW5-Pt0jPY,882
115
115
  hestia_earth/models/cycle/product/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
116
116
  hestia_earth/models/cycle/product/currency.py,sha256=lB1pCD1747Ke3oFoqjAKEHbIdHPfrHKNaJSni69iMUQ,2150
117
- hestia_earth/models/cycle/product/economicValueShare.py,sha256=Ow0M1vN3TYvdB4NpTQo3IGqx8i3qZvRkjj7Z3Pg20ig,8576
117
+ hestia_earth/models/cycle/product/economicValueShare.py,sha256=HAIg9R-j9CdPdU6Wz1qYmVJDG08DPPVNQMq6pWpXSWg,8815
118
118
  hestia_earth/models/cycle/product/price.py,sha256=BUkY9V2Frg442HEGG7PLmXZFTrBPbBFDTk5LbS40Ajs,1588
119
119
  hestia_earth/models/cycle/product/primary.py,sha256=FYyl-Mv8AmEml1nhDJwU01N4LrszJm6E31eztQDHzdg,1853
120
120
  hestia_earth/models/cycle/product/properties.py,sha256=7iKIAYLi2_11HsizwAdNbEmx-C7CH_tTrgBFEePTcWs,1547
121
- hestia_earth/models/cycle/product/revenue.py,sha256=-PmQWbdOLyoemo2afzYPbI5Te7-BslGK7er1HxDL-t0,2438
121
+ hestia_earth/models/cycle/product/revenue.py,sha256=JirczlbiuEWMuR-baAU90FE7k3cxz5bb8GoX_wrXfvg,2433
122
122
  hestia_earth/models/cycle/product/utils.py,sha256=nCQIFgwfI4meSRftV9v4vuxKAy3uUtShpN1pr2mywCw,359
123
123
  hestia_earth/models/cycle/product/value.py,sha256=8f_6Ornn06lbNR2U70qmxn-iwh_TIEFGjB3_8TzCFxs,1596
124
124
  hestia_earth/models/dammgen2009/__init__.py,sha256=dZ8tIXl6e3ZEixYrWiW7rzoqRJVFOoxi4RPvM3N0L1E,412
@@ -165,7 +165,7 @@ hestia_earth/models/faostat2018/readyToCookWeightPerHead.py,sha256=b1_GZQ3oFl88w
165
165
  hestia_earth/models/faostat2018/seed.py,sha256=ts9PKs9UnZnJ9nPFlL7etL1Qb9uIWIES8Mz8W7FWbOw,2917
166
166
  hestia_earth/models/faostat2018/utils.py,sha256=vJxDILARNxE6DM_lTtoLIh5PvdDneSb9S41YAuD1HvY,7527
167
167
  hestia_earth/models/faostat2018/product/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
168
- hestia_earth/models/faostat2018/product/price.py,sha256=X7Zxa-rXthzYdgw2lzybbHc-oKGE5nyXpBn-BfZC_7w,7753
168
+ hestia_earth/models/faostat2018/product/price.py,sha256=xAfHfMt2YhBOo0eQSaEnWfqeINoKHhk9hRDEj7GT0g4,7755
169
169
  hestia_earth/models/frischknechtEtAl2000/__init__.py,sha256=Fixyy9UwoCGP5-MHyJu_ctS40SQ2imfvZo8a547029U,421
170
170
  hestia_earth/models/frischknechtEtAl2000/ionisingRadiationKbqU235Eq.py,sha256=czZx8DgnDuLOdK0CfiriPbj1BwoiWn4d1nkQOiwkcPA,4472
171
171
  hestia_earth/models/geospatialDatabase/__init__.py,sha256=TH-FW3aoL7r1GquRChr7rde7uQonKQRDR00udG8tDrQ,957
@@ -198,7 +198,7 @@ hestia_earth/models/geospatialDatabase/temperatureLongTermAnnualMean.py,sha256=y
198
198
  hestia_earth/models/geospatialDatabase/temperatureMonthly.py,sha256=BLzWaFw4PXkjAK3MC1kVMT1kai4Cv9tEak_CuANTo5k,3354
199
199
  hestia_earth/models/geospatialDatabase/totalNitrogenPerKgSoil.py,sha256=DrjiPyakM1SJ1XO-arhvjLDj2qb3M-i58gJ1kFFM6kI,2821
200
200
  hestia_earth/models/geospatialDatabase/totalPhosphorusPerKgSoil.py,sha256=5oasLMYgfnPwSse0D8EEe_pV57AMusac853BgVSUh5E,2070
201
- hestia_earth/models/geospatialDatabase/utils.py,sha256=RAmdiv2WTKzdiCF1c2KjNoE5v7EjOdO-ZEJdJfi8rB0,6419
201
+ hestia_earth/models/geospatialDatabase/utils.py,sha256=VJ6P37C0Aw51ksN64e_et6aI9zAlk_wCmzlbWcrcau4,6618
202
202
  hestia_earth/models/geospatialDatabase/waterDepth.py,sha256=Xy2UxwAJrgdOkcw59NetEHMt5vgRYE6qg4fgXb1ptlU,1643
203
203
  hestia_earth/models/globalCropWaterModel2008/__init__.py,sha256=vQxexzFCl2Uv2RiIJfcppkRi9RgzBsJ68yhVDK4GvAU,425
204
204
  hestia_earth/models/globalCropWaterModel2008/rootingDepth.py,sha256=pajS-6UWxqIqnzW0IjkgNm-2Vl3bMor2UZOQtQQERuc,4096
@@ -406,7 +406,7 @@ hestia_earth/models/linkedImpactAssessment/utils.py,sha256=S1zlux02gU2Lajrtoq-zQ
406
406
  hestia_earth/models/mocking/__init__.py,sha256=9VX50c-grz-snfd-7MBS0KfF7AadtbKuj7kK6PqtsgE,687
407
407
  hestia_earth/models/mocking/build_mock_search.py,sha256=p15ccEUmkmLp1RiGNznxMz3OFHbI8P1-29ExuohiQN8,1355
408
408
  hestia_earth/models/mocking/mock_search.py,sha256=ccFe_WrI73JElFmxp4hPNLCX7eeU--lBC1JFR901KJY,1069
409
- hestia_earth/models/mocking/search-results.json,sha256=K2swFvB_pADeINR3vBoKMdLcMf8aXTqfTvKaPy6tsFw,102055
409
+ hestia_earth/models/mocking/search-results.json,sha256=_8AfPAX_YcwIYlJpyaHp5sxw4jpNX2Mub58HqO3Szuo,102054
410
410
  hestia_earth/models/pooreNemecek2018/__init__.py,sha256=nPboL7ULJzL5nJD5q7q9VOZt_fxbKVm8fmn1Az5YkVY,417
411
411
  hestia_earth/models/pooreNemecek2018/aboveGroundCropResidueTotal.py,sha256=Qt-mel4dkhK6N5uUOutNOinCTFjbjtGzITaaI0LvYc4,2396
412
412
  hestia_earth/models/pooreNemecek2018/belowGroundCropResidue.py,sha256=JT0RybbvWVlo01FO8K0Yj41HrEaJT3Kj1xfayr2X-xw,2315
@@ -506,9 +506,11 @@ hestia_earth/models/schmidt2007/utils.py,sha256=tbTFg5TXAyS12JCa-OXQg37M1YymHxKW
506
506
  hestia_earth/models/site/__init__.py,sha256=aVuLLhq0OQVm-_MZoq4JAKMidqexUWJBg_7mmojmDzc,405
507
507
  hestia_earth/models/site/brackishWater.py,sha256=vLEhIZv5PUKwzwvIuYrWi7K---fq7ZXn0oJvfDZdMs4,1278
508
508
  hestia_earth/models/site/cationExchangeCapacityPerKgSoil.py,sha256=0eH4A-tXJ0hvIkiYXWxlx8TfrdbIKUGYUDk97-yQJgg,3653
509
+ hestia_earth/models/site/defaultMethodClassification.py,sha256=mqy3P3DLf7cr4-TU_kH7nXr8bz_kCrG_i33AuzwYMyo,1059
510
+ hestia_earth/models/site/defaultMethodClassificationDescription.py,sha256=5rm9LUINmHF579HaqWfHZpFTjwZSgglE6TgAwBPs1uc,1250
509
511
  hestia_earth/models/site/flowingWater.py,sha256=v3g5722GIA4zQAUQI9yGFiZvFvI1QAVZqlQrY-6_B3A,1731
510
512
  hestia_earth/models/site/freshWater.py,sha256=FXs3Vt8V4e-wn325_dwSTOKlZtn5ksNUpvYGDeLJShY,1255
511
- hestia_earth/models/site/management.py,sha256=51gpDKNGghiKnt7cbDJGyW62e1Bh7IoXUmgCThaU7Ms,14626
513
+ hestia_earth/models/site/management.py,sha256=38_os7XxhwBrNQKO-1lKhzAg-HR89Fy0jAV5LdC_Ueg,15016
512
514
  hestia_earth/models/site/netPrimaryProduction.py,sha256=UIIQkYd911qVzrWjxBLrC37e-RARIVgDwLdARY9BuLw,1849
513
515
  hestia_earth/models/site/organicCarbonPerHa.py,sha256=F2ShinHf0m9qKa1nCYBspsDkRY6jzOl0wM8mSDre22I,14916
514
516
  hestia_earth/models/site/organicCarbonPerKgSoil.py,sha256=t--wAshiAKS-JvEKhLFRadGvgSBv5NFZ68jdyms_wh4,1945
@@ -587,7 +589,7 @@ hestia_earth/models/utils/excretaManagement.py,sha256=NuWPQjFZxMVt9sYgBjcqhGWCFk
587
589
  hestia_earth/models/utils/feedipedia.py,sha256=wzzrMbYlda1XCpWiObLz4bFLXbAZejHcxsXJFr4U_AM,3953
588
590
  hestia_earth/models/utils/fertiliser.py,sha256=DBO4OBNgnQJ0fCQMDkIk_ZGZX-uKGaTFZCEXfAnJciY,690
589
591
  hestia_earth/models/utils/fuel.py,sha256=XzOELV3dn506PkMKjFQ_ZKVZInd2lL2x6PKdsa6Po4M,1429
590
- hestia_earth/models/utils/impact_assessment.py,sha256=WRG_VaEWrI3cLkbjupdFb_mOJ-77qdNRKRpJ9Lt-tbk,8070
592
+ hestia_earth/models/utils/impact_assessment.py,sha256=VoJVgSVJkXFvlIukCBm054KGMCBeot17k3DRwo_3_QI,8137
591
593
  hestia_earth/models/utils/indicator.py,sha256=UuuraMUdKLqjcm_zEoF8BaMb76qW23djIA_2DeaoiEw,700
592
594
  hestia_earth/models/utils/inorganicFertiliser.py,sha256=_dLBY-otGkLr8PobR5dQ89bF2uwc2PB4JPrHFSksMEQ,1900
593
595
  hestia_earth/models/utils/input.py,sha256=gsVFKTC9WF8dO6YAg_-H_GAOQTnvAr49Ox5-eTH8zf8,5145
@@ -630,7 +632,7 @@ hestia_earth/orchestrator/strategies/run/add_key_if_missing.py,sha256=t3U-v87Xpb
630
632
  hestia_earth/orchestrator/strategies/run/always.py,sha256=D0In6_kr28s-fgqspawgvj5cgFClxGvepZYqtYsjWVE,217
631
633
  tests/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
632
634
  tests/models/test_cache_sites.py,sha256=vuEVZh_mkuI2cPotX2GB88lURJm2giOQ3yu2Cn4iLoI,2997
633
- tests/models/test_config.py,sha256=WFz1OGhJE6kpcYe3kTPBpv4Jn59yeOCAvz1hqnbI_7o,3113
635
+ tests/models/test_config.py,sha256=JhO7T3bNh2Dl61pKAyM4iEPKybfue02qdneHcJTO2Ck,3368
634
636
  tests/models/test_ecoinventV3.py,sha256=_BqfWiYFaw-Y7A-EeabHEnja3d7yb4Ed7gGGvu3Srpw,1936
635
637
  tests/models/test_ecoinventV3AndEmberClimate.py,sha256=_EOxdrdavXP6L5_LtvaVbXb_-56UJXSaiPhpGntmwVc,801
636
638
  tests/models/test_emissionNotRelevant.py,sha256=YXTdRfcdR_JepHuj2P3Y3r0aFMKNOmsXQHY48tmLTQo,1316
@@ -655,8 +657,8 @@ tests/models/chaudharyBrooks2018/test_damageToTerrestrialEcosystemsLandOccupatio
655
657
  tests/models/chaudharyBrooks2018/test_damageToTerrestrialEcosystemsLandTransformation.py,sha256=lcyMTaNMbIjzZrbPxejujfYyAEj2XOH5Ei9pmAQAi7k,1912
656
658
  tests/models/chaudharyBrooks2018/test_damageToTerrestrialEcosystemsTotalLandUseEffects.py,sha256=NTc3PZZRc9ZqGpaARdbuzLWR5bB0HCPw5AMdGmwVsRg,704
657
659
  tests/models/cml2001Baseline/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
658
- tests/models/cml2001Baseline/test_abioticResourceDepletionFossilFuels.py,sha256=-913Bo7_IC8vz3Fi1tYqN0mSx6HzwWmHcQs-jpuRm80,8801
659
- tests/models/cml2001Baseline/test_abioticResourceDepletionMineralsAndMetals.py,sha256=xBoSGZaNCSpfDdNFIbyJhJslDJD5A_eTywz01GDqFNM,4513
660
+ tests/models/cml2001Baseline/test_abioticResourceDepletionFossilFuels.py,sha256=lR2PX0mmppnSMWj9-vAD1XUBXQab5w-xS5CbWbNl1Uk,8369
661
+ tests/models/cml2001Baseline/test_abioticResourceDepletionMineralsAndMetals.py,sha256=y-E5t5x2VcgPsy3cPFBWyULd6vieaGjDY_J2GVJMtUo,4081
660
662
  tests/models/cml2001Baseline/test_eutrophicationPotentialExcludingFate.py,sha256=ZIIx_EiYbUxUoAS7NuQrxqwTFS3rXQm9_1AsqF_bhB8,894
661
663
  tests/models/cml2001Baseline/test_terrestrialAcidificationPotentialIncludingFateAverageEurope.py,sha256=t3WBdg_aTYSLfaqeXUDyvQJ8ZqbvKwv9RKaZyRzj61k,925
662
664
  tests/models/cml2001NonBaseline/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -743,7 +745,7 @@ tests/models/dammgen2009/test_noxToAirExcreta.py,sha256=RWd9QvzmJtN9M6UC6KDHkXwt
743
745
  tests/models/deRuijterEtAl2010/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
744
746
  tests/models/deRuijterEtAl2010/test_nh3ToAirCropResidueDecomposition.py,sha256=kS1nUBVohOSCb386g6Wq7iVclmx0haekUDYo7VQ4NCA,2030
745
747
  tests/models/edip2003/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
746
- tests/models/edip2003/test_ozoneDepletionPotential.py,sha256=4g6fvYNASaW662i9Y3FeDTDIPb6ZGcpSKBob0MzVbBU,1119
748
+ tests/models/edip2003/test_ozoneDepletionPotential.py,sha256=z0kimdTxzSr8_K5eScbkxq2SB9nbBp41IHqVNR4Nh4Y,688
747
749
  tests/models/emepEea2019/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
748
750
  tests/models/emepEea2019/test_co2ToAirFuelCombustion.py,sha256=z1H17R_Erox2dMg8xylGB0qt9BMZSwfLAoEMVv9z878,1518
749
751
  tests/models/emepEea2019/test_n2OToAirFuelCombustionDirect.py,sha256=4uemriZAyJBSn-xMttRpxqVHOFNBXlboVODHQYl65zQ,1524
@@ -906,7 +908,7 @@ tests/models/ipcc2019/animal/test_pregnancyRateTotal.py,sha256=3M4cpH0rM0fLR86bw
906
908
  tests/models/ipcc2019/animal/test_trueProteinContent.py,sha256=3O2w_PsVEki_piIHO-Wa6m28f5SAHWHsSk27nYDQDuM,783
907
909
  tests/models/ipcc2019/animal/test_weightAtMaturity.py,sha256=-lP4Sx1s11Wyo4Vm1it3SdIpNP43TZWmwOWttrAd_N8,705
908
910
  tests/models/ipcc2021/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
909
- tests/models/ipcc2021/test_gwp100.py,sha256=wFc2QxF3ZIofwYAYl_RmdwhvRBGTn9bN9umjLrLPsg8,1137
911
+ tests/models/ipcc2021/test_gwp100.py,sha256=r3pDw_TUcOrNlNRWtFAN3CBWfG5FCkHExypVqg0sZVk,857
910
912
  tests/models/jarvisAndPain1994/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
911
913
  tests/models/jarvisAndPain1994/test_n2ToAirExcreta.py,sha256=aMCuR9fmGDmum7VqLb1oBOsTCjBz5O9XQn2DWtP8HVM,1057
912
914
  tests/models/koble2014/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -1034,8 +1036,8 @@ tests/models/pooreNemecek2018/test_rotationDuration.py,sha256=tD2E91beAXdyT-xf5Q
1034
1036
  tests/models/pooreNemecek2018/test_saplingsDepreciatedAmountPerCycle.py,sha256=seT7-ip5lSjglaM2Wbaf4qsNrc2W_RYnafef4mQlc8U,1668
1035
1037
  tests/models/pooreNemecek2018/test_utils.py,sha256=oqKCNVw6LOAa4jJFadQCL8ysUbUiVCnm0XBOdqa2BVA,742
1036
1038
  tests/models/poschEtAl2008/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1037
- tests/models/poschEtAl2008/test_terrestrialAcidificationPotentialAccumulatedExceedance.py,sha256=AlDvYqNq8TFPDNtgdSr1dNP-_Rqzbvoxq8ribh8AeEc,1876
1038
- tests/models/poschEtAl2008/test_terrestrialEutrophicationPotentialAccumulatedExceedance.py,sha256=0-hn3Ssu5cfJor_Mq5DYzLlgXiw9ulARlBa_ovJGMbg,1875
1039
+ tests/models/poschEtAl2008/test_terrestrialAcidificationPotentialAccumulatedExceedance.py,sha256=aCfUMusw9TH0DZ781RlltoNZeoKs1C8HbffehCYf5Dc,1441
1040
+ tests/models/poschEtAl2008/test_terrestrialEutrophicationPotentialAccumulatedExceedance.py,sha256=8B63VI4rR6Ad9Z3TMO9jtAX79JpTTY6Na7PSZsr13jk,1440
1039
1041
  tests/models/recipe2016Egalitarian/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1040
1042
  tests/models/recipe2016Egalitarian/test_damageToFreshwaterEcosystemsSpeciesYear.py,sha256=OC8WjzPuyz5fd_E-LxFbOg3sasVc6LMJ9UK-jAKO7LU,697
1041
1043
  tests/models/recipe2016Egalitarian/test_damageToHumanHealth.py,sha256=fWjzC9r6itihyW6AdmDkotbhML_0KavXernOpnK1SmY,677
@@ -1105,6 +1107,8 @@ tests/models/schmidt2007/test_utils.py,sha256=rmtOV3xiFynjgx8lQNGsJqquG8HDxz3LDm
1105
1107
  tests/models/site/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1106
1108
  tests/models/site/test_brackishWater.py,sha256=YGCp4glaWudKklYBSp-50KbfvIRtp3F4Qrj5T81ECTk,986
1107
1109
  tests/models/site/test_cationExchangeCapacityPerKgSoil.py,sha256=tNMhN998vcjQ15I-5mNnFh2d7mHzEBIBO6o1VSfQNUE,1075
1110
+ tests/models/site/test_defaultMethodClassification.py,sha256=2Ek2TkSsWh_kNGBwzzarPt2LR710frziXxTdWq7pX30,532
1111
+ tests/models/site/test_defaultMethodClassificationDescription.py,sha256=ZqI5dmXxzz-op_czHFwTjHUPhBL1Q_gEU2UZTCkS50I,543
1108
1112
  tests/models/site/test_flowingWater.py,sha256=t_rxvdlmUVDsFBoDF20_zDM-0iiLKkNCV7knO9l1T7o,1370
1109
1113
  tests/models/site/test_freshWater.py,sha256=GOeAxHhPW_2E1wQdQRX4W-r7mnb_LgmiAVLImitoApw,982
1110
1114
  tests/models/site/test_management.py,sha256=-QgZc4jBkhHrvvssn3Xtd3kYGIuV2dDoMJxoejkEhmM,1762
@@ -1204,8 +1208,8 @@ tests/orchestrator/strategies/run/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeR
1204
1208
  tests/orchestrator/strategies/run/test_add_blank_node_if_missing.py,sha256=lGqeebvgAwGathB8NLZ14Js5JV_-KyHueaD6I8IH8mU,3615
1205
1209
  tests/orchestrator/strategies/run/test_add_key_if_missing.py,sha256=hKwvk1ohcBVnQUCTiDhRW99J0xEa29BpwFi1KC0yWLE,329
1206
1210
  tests/orchestrator/strategies/run/test_always.py,sha256=w5-Dhp6yLzgZGAeMRz3OrqZbbAed9gZ1O266a3z9k7w,134
1207
- hestia_earth_models-0.65.9.dist-info/LICENSE,sha256=TD25LoiRJsA5CPUNrcyt1PXlGcbUGFMAeZoBcfCrCNE,1154
1208
- hestia_earth_models-0.65.9.dist-info/METADATA,sha256=yf4UsyfGEEeJHUC7KgsGyf6YODOANQkvdOPgErfvMeI,4046
1209
- hestia_earth_models-0.65.9.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
1210
- hestia_earth_models-0.65.9.dist-info/top_level.txt,sha256=1dqA9TqpOLTEgpqa-YBsmbCmmNU1y56AtfFGEceZ2A0,19
1211
- hestia_earth_models-0.65.9.dist-info/RECORD,,
1211
+ hestia_earth_models-0.65.10.dist-info/LICENSE,sha256=TD25LoiRJsA5CPUNrcyt1PXlGcbUGFMAeZoBcfCrCNE,1154
1212
+ hestia_earth_models-0.65.10.dist-info/METADATA,sha256=1B8T70nCeba3dfHkL6iNd8l0VARIGLSxUYTfw5LFcXA,4047
1213
+ hestia_earth_models-0.65.10.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
1214
+ hestia_earth_models-0.65.10.dist-info/top_level.txt,sha256=1dqA9TqpOLTEgpqa-YBsmbCmmNU1y56AtfFGEceZ2A0,19
1215
+ hestia_earth_models-0.65.10.dist-info/RECORD,,
@@ -120,8 +120,8 @@ bad_fuel_indicator_no_property_lookup = {
120
120
  @mark.parametrize(
121
121
  "resources, expected, num_inputs",
122
122
  [
123
- ([], True, 0),
124
- ([wrong_indicator], True, 0),
123
+ ([], False, 0),
124
+ ([wrong_indicator], False, 0),
125
125
  ([indicator_no_inputs], False, 0),
126
126
  ([indicator_2_inputs], False, 2),
127
127
  ([indicator_no_unit], False, 0),
@@ -167,20 +167,6 @@ def test_run(*args):
167
167
  assert value == expected
168
168
 
169
169
 
170
- @patch(f"{class_path}._new_indicator", side_effect=fake_new_indicator)
171
- def test_run_no_emissions(*args):
172
- """
173
- Impact assessment with no emissions should return a indicator of 0
174
- """
175
- with open(f"{fixtures_folder}/impactassessment.jsonld", encoding='utf-8') as f:
176
- impactassessment = json.load(f)
177
-
178
- del impactassessment['emissionsResourceUse']
179
-
180
- value = run(impactassessment)
181
- assert value['value'] == 0
182
-
183
-
184
170
  def test_download_all_non_renewable_terms(*args):
185
171
  """
186
172
  make sure download_all_non_renewable_terms() only returns terms we want
@@ -71,8 +71,8 @@ indicator_tellurium = {
71
71
  @mark.parametrize(
72
72
  "resources, expected, num_inputs",
73
73
  [
74
- ([], True, 0),
75
- ([wrong_indicator], True, 0),
74
+ ([], False, 0),
75
+ ([wrong_indicator], False, 0),
76
76
  ([indicator_no_inputs], False, 0),
77
77
  ([indicator_2_inputs], False, 0),
78
78
  ([indicator_no_unit], False, 0),
@@ -108,17 +108,3 @@ def test_run(*args):
108
108
 
109
109
  value = run(impactassessment)
110
110
  assert value == expected
111
-
112
-
113
- @patch(f"{class_path}._new_indicator", side_effect=fake_new_indicator)
114
- def test_run_no_emissions(*args):
115
- """
116
- Impact assessment with no emissions should return a indicator of 0
117
- """
118
- with open(f"{fixtures_folder}/impactassessment.jsonld", encoding='utf-8') as f:
119
- impactassessment = json.load(f)
120
-
121
- del impactassessment['emissionsResourceUse']
122
-
123
- value = run(impactassessment)
124
- assert value['value'] == 0
@@ -19,16 +19,3 @@ def test_run(*args):
19
19
 
20
20
  value = run(impactassessment)
21
21
  assert value == expected
22
-
23
-
24
- @patch(f"{class_path}._new_indicator", side_effect=fake_new_indicator)
25
- def test_run_empty_input(*args):
26
- """
27
- Test with impact-assessment.jsonld that does NOT contain any "emissionsResourceUse".
28
- """
29
-
30
- with open(f"{fixtures_path}/impact_assessment/emissions/impact-assessment.jsonld", encoding='utf-8') as f:
31
- impactassessment = json.load(f)
32
-
33
- result = run(impactassessment)
34
- assert result['value'] == 0
@@ -8,15 +8,6 @@ class_path = f"hestia_earth.models.{MODEL}.{TERM_ID}"
8
8
  fixtures_folder = f"{fixtures_path}/{MODEL}/{TERM_ID}"
9
9
 
10
10
 
11
- def test_run_no_emissions():
12
- with open(f"{fixtures_path}/impact_assessment/emissions/impact-assessment.jsonld", encoding='utf-8') as f:
13
- impact = json.load(f)
14
-
15
- impact['emissionsResourceUse'] = []
16
- indicator = run(impact)
17
- assert indicator.get('value') == 0
18
-
19
-
20
11
  @patch(f"{class_path}._new_indicator", side_effect=fake_new_indicator)
21
12
  def test_run(*args):
22
13
  with open(f"{fixtures_path}/impact_assessment/emissions/impact-assessment.jsonld", encoding='utf-8') as f:
@@ -42,17 +42,3 @@ def test_lookup_to_bad_country(*args):
42
42
 
43
43
  value = run(impactassessment)
44
44
  assert value == expected
45
-
46
-
47
- @patch(f"{class_path}._new_indicator", side_effect=fake_new_indicator)
48
- def test_run_no_emissions(*args):
49
- """
50
- Impact assessment with no emissions should return a indicator of 0
51
- """
52
- with open(f"{fixtures_folder}/impact-assessment.jsonld", encoding='utf-8') as f:
53
- impactassessment = json.load(f)
54
-
55
- del impactassessment['emissionsResourceUse']
56
-
57
- value = run(impactassessment)
58
- assert value['value'] == 0
@@ -42,17 +42,3 @@ def test_lookup_to_bad_country(*args):
42
42
 
43
43
  value = run(impactassessment)
44
44
  assert value == expected
45
-
46
-
47
- @patch(f"{class_path}._new_indicator", side_effect=fake_new_indicator)
48
- def test_run_no_emissions(*args):
49
- """
50
- Impact assessment with no emissions should return a indicator of 0
51
- """
52
- with open(f"{fixtures_folder}/impact-assessment.jsonld", encoding='utf-8') as f:
53
- impactassessment = json.load(f)
54
-
55
- del impactassessment['emissionsResourceUse']
56
-
57
- value = run(impactassessment)
58
- assert value['value'] == 0
@@ -0,0 +1,18 @@
1
+ import json
2
+ from tests.utils import fixtures_path
3
+
4
+ from hestia_earth.models.site.defaultMethodClassification import MODEL, MODEL_KEY, run
5
+
6
+ class_path = f"hestia_earth.models.{MODEL}.{MODEL_KEY}"
7
+ fixtures_folder = f"{fixtures_path}/{MODEL}/{MODEL_KEY}"
8
+
9
+
10
+ def test_run():
11
+ with open(f"{fixtures_folder}/site.jsonld", encoding='utf-8') as f:
12
+ site = json.load(f)
13
+
14
+ with open(f"{fixtures_folder}/result.txt", encoding='utf-8') as f:
15
+ expected = f.read().strip()
16
+
17
+ result = run(site)
18
+ assert result == expected
@@ -0,0 +1,18 @@
1
+ import json
2
+ from tests.utils import fixtures_path
3
+
4
+ from hestia_earth.models.site.defaultMethodClassificationDescription import MODEL, MODEL_KEY, run
5
+
6
+ class_path = f"hestia_earth.models.{MODEL}.{MODEL_KEY}"
7
+ fixtures_folder = f"{fixtures_path}/{MODEL}/{MODEL_KEY}"
8
+
9
+
10
+ def test_run():
11
+ with open(f"{fixtures_folder}/site.jsonld", encoding='utf-8') as f:
12
+ site = json.load(f)
13
+
14
+ with open(f"{fixtures_folder}/result.txt", encoding='utf-8') as f:
15
+ expected = f.read().strip()
16
+
17
+ result = run(site)
18
+ assert result == expected
@@ -3,7 +3,8 @@ import importlib
3
3
  from hestia_earth.utils.tools import flatten
4
4
 
5
5
  from hestia_earth.models.config import (
6
- load_config, config_max_stage, _is_aggregated_model, _remove_aggregated, load_run_config, load_trigger_config
6
+ load_config, config_max_stage, _is_aggregated_model, _remove_aggregated, load_run_config, load_trigger_config,
7
+ get_max_stage
7
8
  )
8
9
 
9
10
 
@@ -107,9 +108,17 @@ def _get_models_paths(node_type: str):
107
108
  'node_type',
108
109
  ['Cycle', 'Site', 'ImpactAssessment']
109
110
  )
110
- def test_load_config_cycle(node_type):
111
+ def test_load_config_cycle(node_type: str):
111
112
  paths = _get_models_paths(node_type)
112
113
 
113
114
  for path in paths:
114
115
  run = importlib.import_module(path).run
115
116
  assert run is not None, path
117
+
118
+
119
+ @pytest.mark.parametrize(
120
+ 'node_type, max_stage',
121
+ [('Cycle', 2), ('Site', 2), ('ImpactAssessment', 1)]
122
+ )
123
+ def test_get_max_stage(node_type: str, max_stage: int):
124
+ assert get_max_stage(node_type) == max_stage, node_type