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

@@ -1 +1 @@
1
- VERSION = '0.64.1'
1
+ VERSION = '0.64.2'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hestia-earth-models
3
- Version: 0.64.1
3
+ Version: 0.64.2
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
@@ -4,7 +4,7 @@ hestia_earth/models/cache_sites.py,sha256=KQp9cUKE-aIcYJoMWEtKFYS8gBFfsx5LKQhqoW
4
4
  hestia_earth/models/log.py,sha256=DbfNcGzaC5hzkuMDxQqW6XYoNBI4Uxw4SIoOYoZA6og,3474
5
5
  hestia_earth/models/preload_requests.py,sha256=Ibx-YOhR_1yuyFBxsLUbvJHVK7PLyMLoPu5l9jDN_Qk,1342
6
6
  hestia_earth/models/requirements.py,sha256=eU4yT443fx7BnaokhrLB_PCizJI7Y6m4auyo8vQauNg,17363
7
- hestia_earth/models/version.py,sha256=ynV6q1Uuf9gDmUxe-eyYGdhh8GzowZGw5X9OY5kt03Y,19
7
+ hestia_earth/models/version.py,sha256=zhuRvhTOGAr79_4TdettlTNm_GVkWPyvMGpCa_UD5hQ,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
@@ -37,7 +37,7 @@ hestia_earth/models/cycle/__init__.py,sha256=VowO3kOHb0LpURsljNaJsYO7s6vgjhul6bF
37
37
  hestia_earth/models/cycle/aboveGroundCropResidueTotal.py,sha256=9swq4YEeJQ2YjVOmghgBYWkMZWdNU4MKCUBY5FsmBSU,3088
38
38
  hestia_earth/models/cycle/coldCarcassWeightPerHead.py,sha256=fQ7huuxyS5PQkRmR_tRCOz9rV3LJwLfLQJjH_TcTz6k,2955
39
39
  hestia_earth/models/cycle/coldDressedCarcassWeightPerHead.py,sha256=k0xg5SIfJGwEKteFr2Fh-lh8yDC_sqQw_lBnnfwl9zU,3069
40
- hestia_earth/models/cycle/concentrateFeed.py,sha256=wiq9KLRuipHz_2_CVfXDuUek0JN1ZPSyKSimtJntG9E,5636
40
+ hestia_earth/models/cycle/concentrateFeed.py,sha256=vE6cKhwDflU2IMn3Dpy8tvmZxqCLEp5r8vLC65eQDGI,5863
41
41
  hestia_earth/models/cycle/cropResidueManagement.py,sha256=QTRCCFu9VvD_a3_8aAj216vsuhAJEhlAwTJH7ifMkDo,2237
42
42
  hestia_earth/models/cycle/croppingIntensity.py,sha256=44CgDqXg9CBRfTPYTyOleQT-M4_tsQgPba-0vjjk_C4,1770
43
43
  hestia_earth/models/cycle/cycleDuration.py,sha256=SuTFqCP3Zr3nOV9HuvvvIVcaHtOlTAdSaaswvRLSEwc,3242
@@ -232,6 +232,7 @@ hestia_earth/models/ipcc2019/__init__.py,sha256=LdRpu8KbEc-MroIwXfKDjfj-xbgmfUYg
232
232
  hestia_earth/models/ipcc2019/aboveGroundCropResidueTotal.py,sha256=lT2QVV5c2LvQqZRfPEvFT_bMTayMXgIsFLnx8I6iYzw,3089
233
233
  hestia_earth/models/ipcc2019/belowGroundCropResidue.py,sha256=7AFU2Q0qPAvv6uEKWByS38jl77FvjTPbGm2GQ53waGg,3499
234
234
  hestia_earth/models/ipcc2019/carbonContent.py,sha256=tlQvu4Auhpjmaz7XrZz86xwxVrJhsYYf8DFA_aQeev4,7255
235
+ hestia_earth/models/ipcc2019/ch4ToAirAquacultureSystems.py,sha256=q6yyEiYQhHJ2VyQy2Fa84cuTl1D8bjBXOK3UpaRuo20,3196
235
236
  hestia_earth/models/ipcc2019/ch4ToAirEntericFermentation.py,sha256=khX90NjkmlvosyRZ77QxgwTKwg42Z_ftOWTTAanHViw,11420
236
237
  hestia_earth/models/ipcc2019/ch4ToAirExcreta.py,sha256=jEGgEUhMr0JHq_-lPJioKHOQGQXrQvblU51AppXKvB0,6719
237
238
  hestia_earth/models/ipcc2019/ch4ToAirFloodedRice.py,sha256=TJ4J7VA5n4RPrJYZQeR3lc3ZoCw7T1E5Cb1XJewr834,7331
@@ -379,7 +380,7 @@ hestia_earth/models/linkedImpactAssessment/landTransformationFromPermanentPastur
379
380
  hestia_earth/models/linkedImpactAssessment/utils.py,sha256=dGwGc2d-8_WQElTpfyPmz5vQtL-LHQRmiZnCTuPXMDs,1876
380
381
  hestia_earth/models/mocking/__init__.py,sha256=n3Fkkrvh8zHNWiJZmnfQ7WZ91JRzAO9P6pSG1JpwtXo,687
381
382
  hestia_earth/models/mocking/mock_search.py,sha256=qgABw-sZK37XtsALKt8AHF2VJPUrZSnHv5Qj1Dn93oA,2405
382
- hestia_earth/models/mocking/search-results.json,sha256=Hq-CDpm39QU5BB1x3ncyXYj5_4aIUzywOmYsjTHpDLA,47243
383
+ hestia_earth/models/mocking/search-results.json,sha256=mbdSj0kpcZiabKvMZipfGvwSokugpHBU4Z5fvVHnuTw,53137
383
384
  hestia_earth/models/pooreNemecek2018/__init__.py,sha256=nPboL7ULJzL5nJD5q7q9VOZt_fxbKVm8fmn1Az5YkVY,417
384
385
  hestia_earth/models/pooreNemecek2018/aboveGroundCropResidueTotal.py,sha256=Qt-mel4dkhK6N5uUOutNOinCTFjbjtGzITaaI0LvYc4,2396
385
386
  hestia_earth/models/pooreNemecek2018/belowGroundCropResidue.py,sha256=JT0RybbvWVlo01FO8K0Yj41HrEaJT3Kj1xfayr2X-xw,2315
@@ -797,6 +798,7 @@ tests/models/ipcc2019/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
797
798
  tests/models/ipcc2019/test_aboveGroundCropResidueTotal.py,sha256=AADYB1g9vftH7YSvNyihHu8GQOiA7VhXxVQ-oJQNT88,2581
798
799
  tests/models/ipcc2019/test_belowGroundCropResidue.py,sha256=HUxHZLBdLX_E_oc3wqTwNtGY4M4yCWcxx-1iBYPF7_s,2576
799
800
  tests/models/ipcc2019/test_carbonContent.py,sha256=_GWF5nGy-PxiqBZ5V7W_sHMz75YRzmxr79R-sZZg7yk,4146
801
+ tests/models/ipcc2019/test_ch4ToAirAquacultureSystems.py,sha256=o7bHOS4JkwexRrDhLzpfr8nyYCctgRL32YZbam5RBrI,1891
800
802
  tests/models/ipcc2019/test_ch4ToAirEntericFermentation.py,sha256=3Hv86L4X_Va2mZL4KI-36AV00z-KBbKo0cb2ABg6Rv8,7928
801
803
  tests/models/ipcc2019/test_ch4ToAirExcreta.py,sha256=e58NXmBW2SNVLUqQO9A66Xq6jiGTyhdFZDZk51JApF8,2902
802
804
  tests/models/ipcc2019/test_ch4ToAirFloodedRice.py,sha256=FAp5b45WdX5Ih4yGUOZ4CmVD8smW1Lw1tnulx9AKVBI,1980
@@ -1116,8 +1118,8 @@ tests/models/utils/test_source.py,sha256=_Ol-OrJs2Tt9iZAZ_RY2qRuSbnE4yz5OuEGkDSb
1116
1118
  tests/models/utils/test_term.py,sha256=M5Sa26v2gzQYbZ4H_fo7DspnaCx__-WtL-MULGapCWk,3509
1117
1119
  tests/models/webbEtAl2012AndSintermannEtAl2012/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1118
1120
  tests/models/webbEtAl2012AndSintermannEtAl2012/test_nh3ToAirOrganicFertiliser.py,sha256=qi2FNXS5Af2WDtm7nq_FsprH3BfCF0XxnE0XHmC4aIY,2244
1119
- hestia_earth_models-0.64.1.dist-info/LICENSE,sha256=AC7h7GAgCZGJK_Tzh6LUCrML9gQEfowWwecEw2w54QM,1154
1120
- hestia_earth_models-0.64.1.dist-info/METADATA,sha256=2I5vnl3mTZYWnqfJFd_A_KY0KomvUj2GMXm7GLaEPGo,3343
1121
- hestia_earth_models-0.64.1.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
1122
- hestia_earth_models-0.64.1.dist-info/top_level.txt,sha256=1dqA9TqpOLTEgpqa-YBsmbCmmNU1y56AtfFGEceZ2A0,19
1123
- hestia_earth_models-0.64.1.dist-info/RECORD,,
1121
+ hestia_earth_models-0.64.2.dist-info/LICENSE,sha256=AC7h7GAgCZGJK_Tzh6LUCrML9gQEfowWwecEw2w54QM,1154
1122
+ hestia_earth_models-0.64.2.dist-info/METADATA,sha256=62AGAT6inNKY_pNYwL2qKTpk8LFW3wbjLS7DAnLCcag,3343
1123
+ hestia_earth_models-0.64.2.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
1124
+ hestia_earth_models-0.64.2.dist-info/top_level.txt,sha256=1dqA9TqpOLTEgpqa-YBsmbCmmNU1y56AtfFGEceZ2A0,19
1125
+ hestia_earth_models-0.64.2.dist-info/RECORD,,
@@ -0,0 +1,60 @@
1
+ import json
2
+ import pytest
3
+ from unittest.mock import patch
4
+ from tests.utils import fixtures_path, fake_new_emission
5
+
6
+ from hestia_earth.models.ipcc2019.ch4ToAirAquacultureSystems import MODEL, TERM_ID, run, _should_run
7
+
8
+ class_path = f"hestia_earth.models.{MODEL}.{TERM_ID}"
9
+ fixtures_folder = f"{fixtures_path}/{MODEL}/{TERM_ID}"
10
+
11
+
12
+ @pytest.mark.parametrize(
13
+ 'test_name,cycle,expected_should_run',
14
+ [
15
+ (
16
+ 'no cycleDuration => no run',
17
+ {},
18
+ False
19
+ ),
20
+ (
21
+ 'with cycleDuration not relative unit => no run',
22
+ {'cycleDuration': 150, 'functionalUnit': '1 ha'},
23
+ False
24
+ ),
25
+ (
26
+ 'with cycleDuration, relative unit, no area => no run',
27
+ {'cycleDuration': 150, 'functionalUnit': 'relative'},
28
+ False
29
+ ),
30
+ (
31
+ 'with cycleDuration, relative unit, with area, no measurement => no run',
32
+ {'cycleDuration': 150, 'functionalUnit': 'relative', 'site': {'area': 1000}},
33
+ False
34
+ ),
35
+ (
36
+ 'with cycleDuration, relative unit, with area, and measurement => run',
37
+ {
38
+ 'cycleDuration': 150,
39
+ 'functionalUnit': 'relative',
40
+ 'site': {'area': 1000, 'measurements': [{'term': {'@id': 'salineWater'}}]}
41
+ },
42
+ True
43
+ )
44
+ ]
45
+ )
46
+ def test_should_run(test_name, cycle, expected_should_run):
47
+ should_run = _should_run(cycle)
48
+ assert should_run == expected_should_run, test_name
49
+
50
+
51
+ @patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
52
+ def test_run(*args):
53
+ with open(f"{fixtures_folder}/cycle.jsonld", encoding='utf-8') as f:
54
+ cycle = json.load(f)
55
+
56
+ with open(f"{fixtures_folder}/result.jsonld", encoding='utf-8') as f:
57
+ expected = json.load(f)
58
+
59
+ value = run(cycle)
60
+ assert value == expected