hestia-earth-models 0.73.3__py3-none-any.whl → 0.73.4__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.
- hestia_earth/models/akagiEtAl2011/utils.py +12 -13
- hestia_earth/models/ipcc2019/n2OToAirCropResidueBurningDirect.py +4 -10
- hestia_earth/models/mocking/search-results.json +669 -669
- hestia_earth/models/utils/cropResidue.py +2 -2
- hestia_earth/models/version.py +1 -1
- {hestia_earth_models-0.73.3.dist-info → hestia_earth_models-0.73.4.dist-info}/METADATA +1 -1
- {hestia_earth_models-0.73.3.dist-info → hestia_earth_models-0.73.4.dist-info}/RECORD +13 -13
- tests/models/akagiEtAl2011/test_utils.py +3 -2
- tests/models/ipcc2019/test_n2OToAirCropResidueBurningDirect.py +3 -2
- tests/models/utils/test_cropResidue.py +4 -4
- {hestia_earth_models-0.73.3.dist-info → hestia_earth_models-0.73.4.dist-info}/LICENSE +0 -0
- {hestia_earth_models-0.73.3.dist-info → hestia_earth_models-0.73.4.dist-info}/WHEEL +0 -0
- {hestia_earth_models-0.73.3.dist-info → hestia_earth_models-0.73.4.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from hestia_earth.schema import TermTermType
|
|
2
2
|
from hestia_earth.utils.model import find_term_match
|
|
3
|
-
from hestia_earth.utils.tools import flatten
|
|
3
|
+
from hestia_earth.utils.tools import flatten, list_sum
|
|
4
4
|
|
|
5
5
|
from .completeness import _is_term_type_complete
|
|
6
6
|
|
|
@@ -26,4 +26,4 @@ def get_crop_residue_burnt_value(cycle: dict):
|
|
|
26
26
|
find_term_match(products, 'discardedCropBurnt').get('value', [])
|
|
27
27
|
])
|
|
28
28
|
data_complete = _is_term_type_complete(cycle, TermTermType.CROPRESIDUE)
|
|
29
|
-
return
|
|
29
|
+
return 0 if len(value) == 0 and data_complete else list_sum(value, default=None)
|
hestia_earth/models/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
VERSION = '0.73.
|
|
1
|
+
VERSION = '0.73.4'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: hestia-earth-models
|
|
3
|
-
Version: 0.73.
|
|
3
|
+
Version: 0.73.4
|
|
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=eRuH86v7Thuw-QXdKqaqVmA_MkwnOCo0UBEwtuDq4Oc,3554
|
|
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=
|
|
8
|
+
hestia_earth/models/version.py,sha256=jKpV57P7KcWNOm5DrfT5hkuNicj89ENgA5Alu2opwy4,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
|
|
@@ -15,7 +15,7 @@ hestia_earth/models/akagiEtAl2011/nh3ToAirCropResidueBurning.py,sha256=MUVyLifn5
|
|
|
15
15
|
hestia_earth/models/akagiEtAl2011/noxToAirCropResidueBurning.py,sha256=aFot00A68gFM6Sp1cGkzruB4nIyc-BNGX7T75sb_CCw,791
|
|
16
16
|
hestia_earth/models/akagiEtAl2011/pm25ToAirCropResidueBurning.py,sha256=88LaJnezcbfOO_GCKz41zt39yhCFOFFmC9TTo1TAOMU,792
|
|
17
17
|
hestia_earth/models/akagiEtAl2011/so2ToAirCropResidueBurning.py,sha256=hoymFUx3TxzwhlOV65RzOx43IK-CGM8jYfWLH6ibHNo,791
|
|
18
|
-
hestia_earth/models/akagiEtAl2011/utils.py,sha256=
|
|
18
|
+
hestia_earth/models/akagiEtAl2011/utils.py,sha256=Fh9BydxPV42xSMg17R-Hf9ehkZR1o9PbCi5UedcCoBQ,1932
|
|
19
19
|
hestia_earth/models/aware/__init__.py,sha256=F8XRo9nRiX-fHAqyeMARYtFmJWRPs-hnIaCiHcZhyMw,406
|
|
20
20
|
hestia_earth/models/aware/scarcityWeightedWaterUse.py,sha256=HO3ic8xFXs_ez13N7kG1JuYit2S8YTi5WgeP9cOyOqc,3936
|
|
21
21
|
hestia_earth/models/chaudharyBrooks2018/__init__.py,sha256=LKxQu7-6gyWPpdXaYHDTawzsBNm7CpDrk98I5_TTLhA,420
|
|
@@ -303,7 +303,7 @@ hestia_earth/models/ipcc2019/co2ToAirSoilOrganicCarbonStockChange.py,sha256=4aRB
|
|
|
303
303
|
hestia_earth/models/ipcc2019/co2ToAirUreaHydrolysis.py,sha256=P6OxdUbvONaTVGchvogEnGeNxox-X1FaZ08yOdqqm6k,3879
|
|
304
304
|
hestia_earth/models/ipcc2019/croppingDuration.py,sha256=X2fuBCr-mspLwJUGOlVis9lnyzdZ92vYqgDA6dgL5eo,3088
|
|
305
305
|
hestia_earth/models/ipcc2019/ligninContent.py,sha256=nAhwrl0b3pbGQnAycEESAzakdpXajONTnbhNwgPR7nw,7293
|
|
306
|
-
hestia_earth/models/ipcc2019/n2OToAirCropResidueBurningDirect.py,sha256=
|
|
306
|
+
hestia_earth/models/ipcc2019/n2OToAirCropResidueBurningDirect.py,sha256=6oMiix-1_dV5L99NEIKnxHcPrp8k-D1MzO5QDmvtC_o,1754
|
|
307
307
|
hestia_earth/models/ipcc2019/n2OToAirCropResidueDecompositionDirect.py,sha256=Fand7NbT27unwgFTxi_9NxT024s63vQ7U6-tk9yp3d8,3990
|
|
308
308
|
hestia_earth/models/ipcc2019/n2OToAirCropResidueDecompositionIndirect.py,sha256=_Oj6Jw8F4rce7FmhWkzeqyB7W3ZQWpOiA10p6xrfSwc,3777
|
|
309
309
|
hestia_earth/models/ipcc2019/n2OToAirExcretaDirect.py,sha256=RW_aFY409kplCYWo3oHHVk9FD3DkoEnGkprU9SaTdcw,2196
|
|
@@ -448,7 +448,7 @@ hestia_earth/models/linkedImpactAssessment/utils.py,sha256=7M-E7u35fIF0uMoA1hwcr
|
|
|
448
448
|
hestia_earth/models/mocking/__init__.py,sha256=9VX50c-grz-snfd-7MBS0KfF7AadtbKuj7kK6PqtsgE,687
|
|
449
449
|
hestia_earth/models/mocking/build_mock_search.py,sha256=p15ccEUmkmLp1RiGNznxMz3OFHbI8P1-29ExuohiQN8,1355
|
|
450
450
|
hestia_earth/models/mocking/mock_search.py,sha256=ccFe_WrI73JElFmxp4hPNLCX7eeU--lBC1JFR901KJY,1069
|
|
451
|
-
hestia_earth/models/mocking/search-results.json,sha256=
|
|
451
|
+
hestia_earth/models/mocking/search-results.json,sha256=q9-8NCcbbCa7h9SQk-gFtp3ZWLBHs2OW5OyN5RAybzY,162622
|
|
452
452
|
hestia_earth/models/pooreNemecek2018/__init__.py,sha256=nPboL7ULJzL5nJD5q7q9VOZt_fxbKVm8fmn1Az5YkVY,417
|
|
453
453
|
hestia_earth/models/pooreNemecek2018/aboveGroundCropResidueTotal.py,sha256=oXillpppAas1q9GKmODxe1YXyno3EzV-j12xhzkqtTc,2404
|
|
454
454
|
hestia_earth/models/pooreNemecek2018/belowGroundCropResidue.py,sha256=_pQMPSvI--Xm00H6vXDA4ct_pQXKRGrLE2f-2tQE6y4,2323
|
|
@@ -600,7 +600,7 @@ hestia_earth/models/utils/cache_sources.py,sha256=MBkrPpjwNiC4ApDjeYVHZjWBbpvAer
|
|
|
600
600
|
hestia_earth/models/utils/completeness.py,sha256=iRG4uviOAQQ4T2Nr4LlelPVTS_F1felGZNJYxek_JG8,1239
|
|
601
601
|
hestia_earth/models/utils/constant.py,sha256=DmB3VVuoh7Pz2QDBJqiUG6yAML2i0fOy1BPuPHmhT1w,3442
|
|
602
602
|
hestia_earth/models/utils/crop.py,sha256=GbYwrz3Zd4JU-cwUBijc8GeAK0XgurV3ubwcFIgxhcU,2721
|
|
603
|
-
hestia_earth/models/utils/cropResidue.py,sha256=
|
|
603
|
+
hestia_earth/models/utils/cropResidue.py,sha256=1orh-dhBo2p7HZVjMTTFo8XeFv-razhv5SdtuHPQ1bY,1252
|
|
604
604
|
hestia_earth/models/utils/cropResidueManagement.py,sha256=nIDFjf39rDD10UHSVudfDyu-EiL261g8jyrgS-2aDKw,347
|
|
605
605
|
hestia_earth/models/utils/currency.py,sha256=f_ArJANb--pZq4LL49SXQ1AMX_oKroqwBXKRRQqZwsM,578
|
|
606
606
|
hestia_earth/models/utils/cycle.py,sha256=J8ATBSDkhkEPRMRC0ufO8eC_JeGCpkpdvSz2xSTAg-8,16220
|
|
@@ -668,7 +668,7 @@ tests/models/akagiEtAl2011/test_nh3ToAirCropResidueBurning.py,sha256=NAFGO7aSJ6p
|
|
|
668
668
|
tests/models/akagiEtAl2011/test_noxToAirCropResidueBurning.py,sha256=3GIergySTs_aiqT8wMMSTu7zDWJ244EwRNOPkU_TLiI,1142
|
|
669
669
|
tests/models/akagiEtAl2011/test_pm25ToAirCropResidueBurning.py,sha256=hGnX5WymuO41ddDecjbMiKjdFi20rQNdOr-ErVo1f34,1143
|
|
670
670
|
tests/models/akagiEtAl2011/test_so2ToAirCropResidueBurning.py,sha256=kWoTSIMoGIpBR8OgH1LzIqkgvwsTU7mOov5O9ZmlIbE,1142
|
|
671
|
-
tests/models/akagiEtAl2011/test_utils.py,sha256=
|
|
671
|
+
tests/models/akagiEtAl2011/test_utils.py,sha256=bB-YcpJNcsGX1W6vaPao4_PeLS3Hx78ZCrHCJdqbajk,600
|
|
672
672
|
tests/models/aware/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
673
673
|
tests/models/aware/test_scarcityWeightedWaterUse.py,sha256=Tl888UE-v5xQCInOXxn291Tkx3Qyz_bKkd5inVwlDNc,2003
|
|
674
674
|
tests/models/chaudharyBrooks2018/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -935,7 +935,7 @@ tests/models/ipcc2019/test_co2ToAirSoilOrganicCarbonStockChange.py,sha256=gPT_yy
|
|
|
935
935
|
tests/models/ipcc2019/test_co2ToAirUreaHydrolysis.py,sha256=2u4_jtekmVzLTwKpNr1fVcAzgegm17Fh9h59JRXFpOM,1030
|
|
936
936
|
tests/models/ipcc2019/test_croppingDuration.py,sha256=1oRW1QaEwQvBadyVhaDi-jlkjuNqodyAinl88TdPmiY,1879
|
|
937
937
|
tests/models/ipcc2019/test_ligninContent.py,sha256=eIKEN__ab-0R52EhlhPSBiHnmTl6xOf1XbI33O-W9A4,4146
|
|
938
|
-
tests/models/ipcc2019/test_n2OToAirCropResidueBurningDirect.py,sha256=
|
|
938
|
+
tests/models/ipcc2019/test_n2OToAirCropResidueBurningDirect.py,sha256=Zg21yPx5lsf1lwbEzBNvyG2-06Qq5MUVDhteLcukp94,1528
|
|
939
939
|
tests/models/ipcc2019/test_n2OToAirCropResidueDecompositionDirect.py,sha256=vKbWQNZAGPtsqonM-Cc3n3hNitft0hcjn2TNrTFC1iY,2729
|
|
940
940
|
tests/models/ipcc2019/test_n2OToAirCropResidueDecompositionIndirect.py,sha256=it2PVNYBNAvQWmWLDJ9Evjqtx7SJl-X0ZyQz3Fuvb3k,2119
|
|
941
941
|
tests/models/ipcc2019/test_n2OToAirExcretaDirect.py,sha256=-ddwSZia_QQXSrCbIrv_uQMUO3X9_WNk2WtKF8gSYTM,1627
|
|
@@ -1210,7 +1210,7 @@ tests/models/utils/test_array_builders.py,sha256=_ZxbKVReS9U2s6PhnXRqSKCsa9j-2Bx
|
|
|
1210
1210
|
tests/models/utils/test_blank_node.py,sha256=F5pCV-5bKxqsrubjN1W-PACltBljF7z84_7lFBcDFJs,32871
|
|
1211
1211
|
tests/models/utils/test_cache_sources.py,sha256=xcGMVbYoV23YC4HLBTL_4qZP1ME2cp3DFebgJMxI2TE,721
|
|
1212
1212
|
tests/models/utils/test_crop.py,sha256=d508vQdtB_Q_6hEahNueXed5PaEiLeN7ScbwZIKCiDI,862
|
|
1213
|
-
tests/models/utils/test_cropResidue.py,sha256=
|
|
1213
|
+
tests/models/utils/test_cropResidue.py,sha256=RmOgKEdnhvw9uJbSSLmGyeztFXqiqf7UwDfwrC64ArI,904
|
|
1214
1214
|
tests/models/utils/test_cropResidueManagement.py,sha256=RQt8lexeJzCyxZceIutgDpw7BpcqmjsUB0C0yZC2QpY,930
|
|
1215
1215
|
tests/models/utils/test_currency.py,sha256=BPsojPsY9QW2aj8vgbjkPQXU8GU6wDwwtPZ3HdC4KTU,277
|
|
1216
1216
|
tests/models/utils/test_dataCompleteness.py,sha256=Dx3qRUfEW6xqXPdaitJBny8bkfE6rdZvRO9EynuaPMc,1727
|
|
@@ -1249,8 +1249,8 @@ tests/orchestrator/strategies/run/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeR
|
|
|
1249
1249
|
tests/orchestrator/strategies/run/test_add_blank_node_if_missing.py,sha256=K4xg4UAXfNhSaLyknKVPO7MGBF44Z_gD7CuZ_pe28gU,3512
|
|
1250
1250
|
tests/orchestrator/strategies/run/test_add_key_if_missing.py,sha256=hKwvk1ohcBVnQUCTiDhRW99J0xEa29BpwFi1KC0yWLE,329
|
|
1251
1251
|
tests/orchestrator/strategies/run/test_always.py,sha256=w5-Dhp6yLzgZGAeMRz3OrqZbbAed9gZ1O266a3z9k7w,134
|
|
1252
|
-
hestia_earth_models-0.73.
|
|
1253
|
-
hestia_earth_models-0.73.
|
|
1254
|
-
hestia_earth_models-0.73.
|
|
1255
|
-
hestia_earth_models-0.73.
|
|
1256
|
-
hestia_earth_models-0.73.
|
|
1252
|
+
hestia_earth_models-0.73.4.dist-info/LICENSE,sha256=TD25LoiRJsA5CPUNrcyt1PXlGcbUGFMAeZoBcfCrCNE,1154
|
|
1253
|
+
hestia_earth_models-0.73.4.dist-info/METADATA,sha256=Acqy7een93J-4E9V-DI_J5-n-_Lb9lzOnoHcCbKGO5U,4065
|
|
1254
|
+
hestia_earth_models-0.73.4.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
1255
|
+
hestia_earth_models-0.73.4.dist-info/top_level.txt,sha256=1dqA9TqpOLTEgpqa-YBsmbCmmNU1y56AtfFGEceZ2A0,19
|
|
1256
|
+
hestia_earth_models-0.73.4.dist-info/RECORD,,
|
|
@@ -5,14 +5,15 @@ from hestia_earth.models.akagiEtAl2011.utils import MODEL, _should_run
|
|
|
5
5
|
class_path = f"hestia_earth.models.{MODEL}.utils"
|
|
6
6
|
|
|
7
7
|
|
|
8
|
+
@patch(f"{class_path}.get_lookup_value", return_value=10)
|
|
8
9
|
@patch(f"{class_path}.get_crop_residue_burnt_value")
|
|
9
10
|
def test_should_run(mock_product_value, *args):
|
|
10
11
|
# no products => no run
|
|
11
|
-
mock_product_value.return_value =
|
|
12
|
+
mock_product_value.return_value = None
|
|
12
13
|
should_run, *args = _should_run('', {})
|
|
13
14
|
assert not should_run
|
|
14
15
|
|
|
15
16
|
# with products => run
|
|
16
|
-
mock_product_value.return_value =
|
|
17
|
+
mock_product_value.return_value = 10
|
|
17
18
|
should_run, *args = _should_run('', {})
|
|
18
19
|
assert should_run is True
|
|
@@ -8,15 +8,16 @@ class_path = f"hestia_earth.models.{MODEL}.{TERM_ID}"
|
|
|
8
8
|
fixtures_folder = f"{fixtures_path}/{MODEL}/{TERM_ID}"
|
|
9
9
|
|
|
10
10
|
|
|
11
|
+
@patch(f"{class_path}.get_lookup_value", return_value=10)
|
|
11
12
|
@patch(f"{class_path}.get_crop_residue_burnt_value")
|
|
12
13
|
def test_should_run(mock_product_value, *args):
|
|
13
14
|
# no products => no run
|
|
14
|
-
mock_product_value.return_value =
|
|
15
|
+
mock_product_value.return_value = None
|
|
15
16
|
should_run, *args = _should_run({})
|
|
16
17
|
assert not should_run
|
|
17
18
|
|
|
18
19
|
# with products => run
|
|
19
|
-
mock_product_value.return_value =
|
|
20
|
+
mock_product_value.return_value = 10
|
|
20
21
|
should_run, *args = _should_run({})
|
|
21
22
|
assert should_run is True
|
|
22
23
|
|
|
@@ -7,20 +7,20 @@ class_path = 'hestia_earth.models.utils.cropResidue'
|
|
|
7
7
|
|
|
8
8
|
@patch(f"{class_path}.find_term_match", return_value=None)
|
|
9
9
|
@patch(f"{class_path}._is_term_type_complete", return_value=False)
|
|
10
|
-
def
|
|
10
|
+
def test_get_crop_residue_burnt_value(mock_data_complete, mock_find_product):
|
|
11
11
|
# product not found no data complete
|
|
12
12
|
mock_data_complete.return_value = False
|
|
13
13
|
mock_find_product.return_value = {}
|
|
14
14
|
value = get_crop_residue_burnt_value({})
|
|
15
|
-
assert value
|
|
15
|
+
assert value is None
|
|
16
16
|
|
|
17
17
|
# product not found and data complete
|
|
18
18
|
mock_data_complete.return_value = True
|
|
19
19
|
mock_find_product.return_value = {}
|
|
20
20
|
value = get_crop_residue_burnt_value({})
|
|
21
|
-
assert value ==
|
|
21
|
+
assert value == 0
|
|
22
22
|
|
|
23
23
|
# product found
|
|
24
24
|
mock_find_product.return_value = {'value': [100]}
|
|
25
25
|
value = get_crop_residue_burnt_value({})
|
|
26
|
-
assert value ==
|
|
26
|
+
assert value == 200
|
|
File without changes
|
|
File without changes
|
|
File without changes
|