hestia-earth-models 0.74.0__py3-none-any.whl → 0.74.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.

@@ -103,9 +103,9 @@ def _run(transformation: dict):
103
103
 
104
104
  inputs = filter_list_term_type(transformation.get('inputs', []), TermTermType.EXCRETA)
105
105
  products = filter_list_term_type(transformation.get('products', []), TermTermType.EXCRETA)
106
- missing_product_units = [
106
+ missing_product_units = set([
107
107
  i.get('term', {}).get('units') for i in inputs if not _find_by_units(products, i.get('term', {}).get('units'))
108
- ]
108
+ ])
109
109
 
110
110
  debugValues(transformation, model=MODEL_LOG,
111
111
  missing_product_units=';'.join(missing_product_units))
@@ -1 +1 @@
1
- VERSION = '0.74.0'
1
+ VERSION = '0.74.2'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hestia-earth-models
3
- Version: 0.74.0
3
+ Version: 0.74.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
@@ -5,7 +5,7 @@ hestia_earth/models/cache_sites.py,sha256=XpXnkYt823PQzrswgP__L4CT8xZG_n7a41CIHK
5
5
  hestia_earth/models/log.py,sha256=LQ6nRMc5q8-xs8DsAx9h8drWhWLkqDG9dFlG9OzFbeA,3780
6
6
  hestia_earth/models/preload_requests.py,sha256=vK_G1UzhNMhYy7ymnCtHUz_vv3cfApCSKqv29VREEBQ,1943
7
7
  hestia_earth/models/requirements.py,sha256=eU4yT443fx7BnaokhrLB_PCizJI7Y6m4auyo8vQauNg,17363
8
- hestia_earth/models/version.py,sha256=dr8LfdHIp0dVXgtrKmeyU5v4tY5NawYAi2uFcqYX_K0,19
8
+ hestia_earth/models/version.py,sha256=TJLHftkfaFBxlcBKsi-schtBBNtrImlbSk4KZk-ApYk,19
9
9
  hestia_earth/models/agribalyse2016/__init__.py,sha256=WvK0qCQbnYtg9oZxrACd1wGormZyXibPtpCnIQeDqbw,415
10
10
  hestia_earth/models/agribalyse2016/fuelElectricity.py,sha256=1ngl8pdxeNhlVV8keAeWRwGorr_1uFXM9EoPUWx-uSc,4382
11
11
  hestia_earth/models/agribalyse2016/machineryInfrastructureDepreciatedAmountPerCycle.py,sha256=queToXuzq0tQ9_XuUJ2pJgSywXmbt9uX3ZoIKgqkROM,2660
@@ -208,12 +208,12 @@ hestia_earth/models/hestia/freshWater.py,sha256=Q-dmFJLZfyYEyFyYkJUOjgmQR3G5YXCX
208
208
  hestia_earth/models/hestia/histosol.py,sha256=IexiWTSlSJYGjrdpYmRooW6v8LjhYATPQ8smMz1UZBA,1612
209
209
  hestia_earth/models/hestia/inorganicFertiliser.py,sha256=We4PBaTXyGwEQTfhX0-J8Xt03p-FB9i9j3tEK5JQ8uE,9026
210
210
  hestia_earth/models/hestia/irrigatedTypeUnspecified.py,sha256=VdYzfYxcRzWv21qxRkDn9HBid7-Bt_CgIv4iyXJH03g,1929
211
- hestia_earth/models/hestia/landCover.py,sha256=9TLHpxjF0ceZYWiOSs96TCoOmIO4Bq0ELepNS9ApquE,39474
211
+ hestia_earth/models/hestia/landCover.py,sha256=1pm_F79ANQHi8oeKkV24koiaSGCNRtzYBk3f38k-Bpk,39463
212
212
  hestia_earth/models/hestia/landTransformation100YearAverageDuringCycle.py,sha256=hF7_DDvrs7swH6ott_ihgYx13UzEKHH6pccYCtzrN8o,1069
213
213
  hestia_earth/models/hestia/landTransformation20YearAverageDuringCycle.py,sha256=05SCH6ZjEV3mIleRusBg677zu0xgu5YK0f9FCddgNPg,1067
214
214
  hestia_earth/models/hestia/liveAnimal.py,sha256=d7HuUi40c-7TN1kecdRuqbht8PAe7x4ps0NhSuWG34Q,3868
215
215
  hestia_earth/models/hestia/longFallowRatio.py,sha256=LkJaER1VNDI5351-oC8tru-LgiPK3sNMg0NhB5ic9RE,1690
216
- hestia_earth/models/hestia/management.py,sha256=zLCdYekoyxzAsEcBIr04paDjatD3_WhK2QxqfIAQQh8,11292
216
+ hestia_earth/models/hestia/management.py,sha256=p-FNJe99QVD398gmrIVVrAbFK4mfYN4FKNHCssd2Nq0,11175
217
217
  hestia_earth/models/hestia/materialAndSubstrate.py,sha256=abmM_7FOY5yaNb2yZEm-ncI4wFFcbzaebtnG9XWEA6M,5130
218
218
  hestia_earth/models/hestia/milkYield.py,sha256=__3AdxRTUTWwS_GsqxFpPGklmTnnpADiN0khlRCMAss,5541
219
219
  hestia_earth/models/hestia/netPrimaryProduction.py,sha256=TXBw7qkTYlvViMrM027FejVpwyqnzJ8VazsbWakwd70,1870
@@ -245,7 +245,7 @@ hestia_earth/models/hestia/temperatureAnnual.py,sha256=IhMoO-SkSp1JBxgu9bSr1OCtr
245
245
  hestia_earth/models/hestia/temperatureMonthly.py,sha256=sY4MrjCTm7X3BoDTUC0ZkxD7CWxvl51JW2UxDykCKzg,1842
246
246
  hestia_earth/models/hestia/totalNitrogenPerKgSoil.py,sha256=hpyYqMwO9TvZjrpQuSBA3uRFrOk_PPZEo9ev4QeECI4,1956
247
247
  hestia_earth/models/hestia/unknownPreSeasonWaterRegime.py,sha256=Ix7Eg4NVW1iKvPKIOqOdSkahn7BlJNtPM8nlrogrfcM,1460
248
- hestia_earth/models/hestia/utils.py,sha256=CMBo5wR47fyPkIH6k3ihWhFB-XyQfkv7O4CJOm_rJOc,4888
248
+ hestia_earth/models/hestia/utils.py,sha256=oTdk7VKuaxDTKj9Cz4t3qp3RZ5wSt3bZXpPiImgIIto,4768
249
249
  hestia_earth/models/hestia/waterDepth.py,sha256=gnvd1kwbTCt9HjgxlKzuCGkPi8Sq7nQiHFbk8xBAZV0,1251
250
250
  hestia_earth/models/hestia/waterSalinity.py,sha256=YkiLEljMd4xHT0bKv-nXbgOXcaEQmLDlSwpFrfg49ow,2962
251
251
  hestia_earth/models/hestia/feedConversionRatio/__init__.py,sha256=G4T1jfN1OqERsywiWyrBiFneUZs5QXpChz7dgGfg9Ko,2512
@@ -339,7 +339,7 @@ hestia_earth/models/ipcc2019/organicCarbonPerHa_tier_1.py,sha256=kuLVIW5rJ7UuPep
339
339
  hestia_earth/models/ipcc2019/organicCarbonPerHa_tier_2.py,sha256=vvrwSI9oZIVlLLGMyPoSKW3lOgc2VmF8G-HJJHbgYRc,69220
340
340
  hestia_earth/models/ipcc2019/organicCarbonPerHa_utils.py,sha256=DumXAbH8P97tDyP1nAbtgVrDEceFy0b_xRNZG2h0kbQ,9843
341
341
  hestia_earth/models/ipcc2019/organicSoilCultivation_utils.py,sha256=mJCKYZxqk5vFknckjIjGw478BjZbvKC_xQ-zYpvJ8xM,5628
342
- hestia_earth/models/ipcc2019/pastureGrass.py,sha256=_EwlAooSfrkcSy4rl_rk4PpeX1pcIiQcb7HE2lQkyn8,9847
342
+ hestia_earth/models/ipcc2019/pastureGrass.py,sha256=JijV-UnA_ofB53yPqGPkhf7lMKi_GumfMXVPYGLjBXI,10206
343
343
  hestia_earth/models/ipcc2019/pastureGrass_utils.py,sha256=so5AFrr_0eKXkUoyBpYhHgSXhTQ5z2XADahm2At4RR0,14285
344
344
  hestia_earth/models/ipcc2019/utils.py,sha256=s3khA5nJ0rpFsrwWoIGW0y3OYrYA5Iw2GTxN86gO_K8,5890
345
345
  hestia_earth/models/ipcc2019/animal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -348,10 +348,10 @@ hestia_earth/models/ipcc2019/animal/hoursWorkedPerDay.py,sha256=BBByUzgM7OymWnuU
348
348
  hestia_earth/models/ipcc2019/animal/liveweightGain.py,sha256=TXEKI0PZFDj7zlg_pmgfwhRT0LS1x1hEswulQYD7Dkg,956
349
349
  hestia_earth/models/ipcc2019/animal/liveweightPerHead.py,sha256=86HRowJnTbwHKDKU0rGaco2-8B1wIQ4nIe_KNqzdXsk,965
350
350
  hestia_earth/models/ipcc2019/animal/milkYieldPerAnimal.py,sha256=p7o3qvQbgq3QWqp4rW8NoyINkSFMQ9QOn9auf7e6gww,2602
351
- hestia_earth/models/ipcc2019/animal/pastureGrass.py,sha256=lT74m-NljewFYdQJIe4he2uYJ9rWWSZSm1MCUrxj0gQ,11742
351
+ hestia_earth/models/ipcc2019/animal/pastureGrass.py,sha256=jaQC4zz893oR2FSKmnKl9Lh7WrSyD9oJvezKqXUuUbE,12239
352
352
  hestia_earth/models/ipcc2019/animal/pregnancyRateTotal.py,sha256=zib2AW3WJTL4NRYN4a0rRiqSJ5PZLRtwDYia7gigQFY,968
353
353
  hestia_earth/models/ipcc2019/animal/trueProteinContent.py,sha256=fgV0u4sEtLmCk-vUHF6mM03uy1w9nVPDzmxSkLXgPBo,1010
354
- hestia_earth/models/ipcc2019/animal/utils.py,sha256=kRYmqAlUomspQ9wBXikgukjseLljaIo6EdQeOr4OR0s,4369
354
+ hestia_earth/models/ipcc2019/animal/utils.py,sha256=49wX3K5fLDLc33MQJLsGefJ9vlGRwfkNXabc8CGgPQ4,4435
355
355
  hestia_earth/models/ipcc2019/animal/weightAtMaturity.py,sha256=bdNunYwW3D6i81AkWQ-vtv6PObv6V_oZdVvqzk4Caug,2869
356
356
  hestia_earth/models/ipcc2021/__init__.py,sha256=VTgGFKhwMmk_nuI1RRq0in27fHYVPBonlXlPK00K8no,409
357
357
  hestia_earth/models/ipcc2021/gwp100.py,sha256=EQ-OBQrahSgMBFtGregiNlbm3DHVwr67o4e29Z5Gns8,1039
@@ -459,7 +459,7 @@ hestia_earth/models/linkedImpactAssessment/utils.py,sha256=DM6ZUnw23KH0oMKS3jA5q
459
459
  hestia_earth/models/mocking/__init__.py,sha256=9VX50c-grz-snfd-7MBS0KfF7AadtbKuj7kK6PqtsgE,687
460
460
  hestia_earth/models/mocking/build_mock_search.py,sha256=p15ccEUmkmLp1RiGNznxMz3OFHbI8P1-29ExuohiQN8,1355
461
461
  hestia_earth/models/mocking/mock_search.py,sha256=ccFe_WrI73JElFmxp4hPNLCX7eeU--lBC1JFR901KJY,1069
462
- hestia_earth/models/mocking/search-results.json,sha256=pRDsDH9bmR8SC3v5C9AaXutnxXdrmx5LqPW4GAEpp1E,162763
462
+ hestia_earth/models/mocking/search-results.json,sha256=48q0iTf14osDO5yt7xICLl6vynLU2o3kslRueq7kJpI,162835
463
463
  hestia_earth/models/pooreNemecek2018/__init__.py,sha256=nPboL7ULJzL5nJD5q7q9VOZt_fxbKVm8fmn1Az5YkVY,417
464
464
  hestia_earth/models/pooreNemecek2018/aboveGroundCropResidueTotal.py,sha256=oXillpppAas1q9GKmODxe1YXyno3EzV-j12xhzkqtTc,2404
465
465
  hestia_earth/models/pooreNemecek2018/belowGroundCropResidue.py,sha256=_pQMPSvI--Xm00H6vXDA4ct_pQXKRGrLE2f-2tQE6y4,2323
@@ -598,7 +598,7 @@ hestia_earth/models/transformation/input/sd.py,sha256=ZvnlhjKgYn18i6-ZJyWiOOFdXM
598
598
  hestia_earth/models/transformation/input/utils.py,sha256=ViF3thUJ7-upGUTmpFWFJZc9AO0H_-57cQChck89OLo,1302
599
599
  hestia_earth/models/transformation/input/value.py,sha256=aI6MXPPvtmu5sacjY-iynIBRgVUa5N5p0_vyaAWhhn8,1252
600
600
  hestia_earth/models/transformation/product/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
601
- hestia_earth/models/transformation/product/excreta.py,sha256=tggXIoUujzu8O949_3KFog219k_bQ0IcytpCsJ8oMcc,5384
601
+ hestia_earth/models/transformation/product/excreta.py,sha256=zYts6AKQizoy9NQf5PwMttuPePe8-U0d8QthC_sSM1E,5389
602
602
  hestia_earth/models/usetoxV2/__init__.py,sha256=pK37V3H-KvYcvRKw4Mv8CWrB2N0LFLzmv0jKLdhGGqs,409
603
603
  hestia_earth/models/usetoxV2/freshwaterEcotoxicityPotentialCtue.py,sha256=pPX8u-Aq6Pg5Y9xw0CS0S2WkAHQpOMl0lL2tLQwwOuU,918
604
604
  hestia_earth/models/utils/__init__.py,sha256=W6LxMNLCfcviL6X8XMAExj_Z-E2x84HQw27_uQD5M18,7232
@@ -863,7 +863,7 @@ tests/models/hestia/test_landTransformation100YearAverageDuringCycle.py,sha256=3
863
863
  tests/models/hestia/test_landTransformation20YearAverageDuringCycle.py,sha256=bUByojQuVeuCfko1_2YtNJi1PT9yktHlcbPi_p-MPvk,1001
864
864
  tests/models/hestia/test_liveAnimal.py,sha256=3K9cL1fwr6LlBl1_D8zIaeCOuiExqkDEU7BXx1JK_dk,2139
865
865
  tests/models/hestia/test_longFallowRatio.py,sha256=OVd6NByAXeCAOx9ux_m8IJwnEF-fqIaBOoKFSGWhyO0,1513
866
- tests/models/hestia/test_management.py,sha256=p7j5ooACr0XBf2-hZWwwYE0-sfsoakIa2qKZhE32ZUQ,1800
866
+ tests/models/hestia/test_management.py,sha256=ROWfDX-2aeeQXaflLPzOpiC6Qi5lsbMldBbFAlWKAUQ,2755
867
867
  tests/models/hestia/test_materialsAndSubstrate.py,sha256=szM6aBBc1_9MDQFM1-OiW4SOKvEIO6mYYEpjHB-wI9g,1430
868
868
  tests/models/hestia/test_milkYield.py,sha256=m7SRiKb_u8SDF7Q5gX39AKr4bsrNqibXgMgzSmJJEPA,1778
869
869
  tests/models/hestia/test_netPrimaryProduction.py,sha256=--q6NB90gmpeJNBR16l3AgBsXGXwww_d1vOcWiMa-k8,1110
@@ -1272,8 +1272,8 @@ tests/orchestrator/strategies/run/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeR
1272
1272
  tests/orchestrator/strategies/run/test_add_blank_node_if_missing.py,sha256=K4xg4UAXfNhSaLyknKVPO7MGBF44Z_gD7CuZ_pe28gU,3512
1273
1273
  tests/orchestrator/strategies/run/test_add_key_if_missing.py,sha256=hKwvk1ohcBVnQUCTiDhRW99J0xEa29BpwFi1KC0yWLE,329
1274
1274
  tests/orchestrator/strategies/run/test_always.py,sha256=w5-Dhp6yLzgZGAeMRz3OrqZbbAed9gZ1O266a3z9k7w,134
1275
- hestia_earth_models-0.74.0.dist-info/LICENSE,sha256=TD25LoiRJsA5CPUNrcyt1PXlGcbUGFMAeZoBcfCrCNE,1154
1276
- hestia_earth_models-0.74.0.dist-info/METADATA,sha256=xYHvi1dvF2aIr7WVyYCoZSJTjjzlAGt36kx_-PAUQ0U,4075
1277
- hestia_earth_models-0.74.0.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
1278
- hestia_earth_models-0.74.0.dist-info/top_level.txt,sha256=1dqA9TqpOLTEgpqa-YBsmbCmmNU1y56AtfFGEceZ2A0,19
1279
- hestia_earth_models-0.74.0.dist-info/RECORD,,
1275
+ hestia_earth_models-0.74.2.dist-info/LICENSE,sha256=TD25LoiRJsA5CPUNrcyt1PXlGcbUGFMAeZoBcfCrCNE,1154
1276
+ hestia_earth_models-0.74.2.dist-info/METADATA,sha256=HFxqpoBHCAy0-p3g7SRQO9QwBFyPVtyd8Kmg-E-nJZg,4075
1277
+ hestia_earth_models-0.74.2.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
1278
+ hestia_earth_models-0.74.2.dist-info/top_level.txt,sha256=1dqA9TqpOLTEgpqa-YBsmbCmmNU1y56AtfFGEceZ2A0,19
1279
+ hestia_earth_models-0.74.2.dist-info/RECORD,,
@@ -5,7 +5,8 @@ from unittest.mock import Mock, patch
5
5
  from hestia_earth.schema import SiteSiteType
6
6
 
7
7
  from tests.utils import fixtures_path, fake_new_management
8
- from hestia_earth.models.hestia.management import MODEL, MODEL_KEY, run
8
+ from hestia_earth.models.hestia.management import MODEL, MODEL_KEY, run, _is_cover_crop, \
9
+ _cycle_has_existing_non_cover_land_cover_nodes
9
10
 
10
11
  class_path = f"hestia_earth.models.{MODEL}.{MODEL_KEY}"
11
12
  fixtures_folder = os.path.join(fixtures_path, MODEL, MODEL_KEY)
@@ -19,6 +20,33 @@ _LAND_COVER_TERM_BY_SITE_TYPE = {
19
20
  _folders = [d for d in os.listdir(fixtures_folder) if os.path.isdir(os.path.join(fixtures_folder, d))]
20
21
 
21
22
 
23
+ @pytest.mark.parametrize(
24
+ 'term_id,expected_result',
25
+ [
26
+ ("coverCrop", True),
27
+ ("catchCrop", True),
28
+ ("groundCover", True),
29
+ ("salinity", False),
30
+ ("nonexistentthing", False),
31
+ ]
32
+ )
33
+ def test_is_cover_crop(term_id, expected_result):
34
+ assert _is_cover_crop(term_id) == expected_result
35
+
36
+
37
+ def test_cycle_has_existing_non_cover_land_cover_nodes():
38
+ fixture_path = os.path.join(fixtures_folder, "example7")
39
+ with open(f"{fixture_path}/cycles.jsonld", encoding='utf-8') as f:
40
+ cycles = json.load(f)
41
+
42
+ assert _cycle_has_existing_non_cover_land_cover_nodes(cycles[0]) is False
43
+
44
+ fixture_path = os.path.join(fixtures_folder, "siteType_no_cropland")
45
+ with open(f"{fixture_path}/cycles.jsonld", encoding='utf-8') as f:
46
+ cycles = json.load(f)
47
+ assert _cycle_has_existing_non_cover_land_cover_nodes(cycles[0]) is True
48
+
49
+
22
50
  @pytest.mark.parametrize('folder', _folders)
23
51
  @patch(
24
52
  f"{class_path}.get_landCover_term_id_from_site_type",