hestia-earth-models 0.59.4__py3-none-any.whl → 0.59.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.
- hestia_earth/models/cycle/liveAnimal.py +3 -0
- hestia_earth/models/cycle/milkYield.py +1 -1
- hestia_earth/models/cycle/utils.py +1 -1
- hestia_earth/models/geospatialDatabase/potentialEvapotranspirationLongTermAnnualMean.py +2 -2
- hestia_earth/models/geospatialDatabase/potentialEvapotranspirationMonthly.py +9 -8
- hestia_earth/models/geospatialDatabase/precipitationMonthly.py +10 -8
- hestia_earth/models/geospatialDatabase/temperatureAnnual.py +2 -5
- hestia_earth/models/geospatialDatabase/temperatureLongTermAnnualMean.py +2 -3
- hestia_earth/models/geospatialDatabase/temperatureMonthly.py +8 -8
- hestia_earth/models/geospatialDatabase/utils.py +6 -1
- hestia_earth/models/ipcc2019/organicCarbonPerHa.py +70 -110
- hestia_earth/models/linkedImpactAssessment/__init__.py +78 -43
- hestia_earth/models/mocking/search-results.json +0 -39
- hestia_earth/models/schmidt2007/n2OToAirWasteTreatmentDirect.py +58 -0
- hestia_earth/models/schmidt2007/nh3ToAirWasteTreatment.py +58 -0
- hestia_earth/models/site/management.py +104 -11
- hestia_earth/models/site/soilMeasurement.py +9 -9
- hestia_earth/models/utils/blank_node.py +3 -3
- hestia_earth/models/utils/term.py +0 -23
- hestia_earth/models/version.py +1 -1
- {hestia_earth_models-0.59.4.dist-info → hestia_earth_models-0.59.5.dist-info}/METADATA +1 -1
- {hestia_earth_models-0.59.4.dist-info → hestia_earth_models-0.59.5.dist-info}/RECORD +31 -27
- tests/models/ipcc2019/test_organicCarbonPerHa.py +4 -18
- tests/models/schmidt2007/test_n2OToAirWasteTreatmentDirect.py +45 -0
- tests/models/schmidt2007/test_nh3ToAirWasteTreatment.py +45 -0
- tests/models/site/test_management.py +24 -3
- tests/models/site/test_soilMeasurement.py +40 -21
- tests/models/utils/test_term.py +1 -8
- {hestia_earth_models-0.59.4.dist-info → hestia_earth_models-0.59.5.dist-info}/LICENSE +0 -0
- {hestia_earth_models-0.59.4.dist-info → hestia_earth_models-0.59.5.dist-info}/WHEEL +0 -0
- {hestia_earth_models-0.59.4.dist-info → hestia_earth_models-0.59.5.dist-info}/top_level.txt +0 -0
|
@@ -3,7 +3,7 @@ hestia_earth/models/__init__.py,sha256=qEFeq3yuf3lQKVseALmL8aPM8fpCS54B_5pry00M3
|
|
|
3
3
|
hestia_earth/models/cache_sites.py,sha256=kp_3D09P-JdAn9vt7eU-KKTwd6BAXWKQL_0UQCDsH2s,4798
|
|
4
4
|
hestia_earth/models/log.py,sha256=b63I3qyTtQs17xxbq8RI0Fv2lvZ1oDZ9k0njhxqiFFk,3459
|
|
5
5
|
hestia_earth/models/requirements.py,sha256=znNZJAhwX2iYiKcAQXPftY7z_1MsNa0QxCXkXyHm_U0,17363
|
|
6
|
-
hestia_earth/models/version.py,sha256=
|
|
6
|
+
hestia_earth/models/version.py,sha256=0NY7cXt4Am8fMi02-LZZcS2D6qeEySfNIWf5ny01kfY,19
|
|
7
7
|
hestia_earth/models/agribalyse2016/__init__.py,sha256=WvK0qCQbnYtg9oZxrACd1wGormZyXibPtpCnIQeDqbw,415
|
|
8
8
|
hestia_earth/models/agribalyse2016/fuelElectricity.py,sha256=mrh8seYSYdTgcMDCETLiknuPeJehg071YoG4UiyW0yU,4404
|
|
9
9
|
hestia_earth/models/agribalyse2016/machineryInfrastructureDepreciatedAmountPerCycle.py,sha256=_Rbngu0DzHKa62JwBl58ZC_ui1zLF2que_nB7ukhOQc,3392
|
|
@@ -45,8 +45,8 @@ hestia_earth/models/cycle/excretaKgN.py,sha256=mgJTneQIYJ9Su-rTK5ppb_k3YhICFNWsf
|
|
|
45
45
|
hestia_earth/models/cycle/excretaKgVs.py,sha256=ed-DcQoQXZgWF8UZDs2N-G6EBIOPmpXu3BD6jdmh0V0,2973
|
|
46
46
|
hestia_earth/models/cycle/inorganicFertiliser.py,sha256=3pJRcbZ0OQSNkFq_YC4McpiwLvWJpnL29AhhmCxr7RI,6938
|
|
47
47
|
hestia_earth/models/cycle/irrigatedTypeUnspecified.py,sha256=KlIa5eDvT47Twz6Q1kpw0rMlRjCK25CExaW58DEvc9w,2125
|
|
48
|
-
hestia_earth/models/cycle/liveAnimal.py,sha256=
|
|
49
|
-
hestia_earth/models/cycle/milkYield.py,sha256=
|
|
48
|
+
hestia_earth/models/cycle/liveAnimal.py,sha256=LWAMnNKRoLDdChrGApVIN-Ns7em0Lspz5UtLbf7PPLY,3988
|
|
49
|
+
hestia_earth/models/cycle/milkYield.py,sha256=UNNlSJE_jHLp28oDPCOxEtq2YycY_JADuaPfdz0be6Y,5724
|
|
50
50
|
hestia_earth/models/cycle/pastureGrass.py,sha256=7PrmDMJPtsbKGa8WIOh_4NXNtbH3Pxb23pmjawQuY9o,1226
|
|
51
51
|
hestia_earth/models/cycle/pastureSystem.py,sha256=uksVgl_3bp_t2niwZ5BvS3VT-Kndx26Se6GpzqG0bX8,2709
|
|
52
52
|
hestia_earth/models/cycle/readyToCookWeightPerHead.py,sha256=F4UtK1gSsIYqbQ1V2hSUszSrq2HFN5LdMB33Yc-bfTQ,2927
|
|
@@ -56,7 +56,7 @@ hestia_earth/models/cycle/residueLeftOnField.py,sha256=qYxKGAdUORN7Vjqj7AZC2VGV_
|
|
|
56
56
|
hestia_earth/models/cycle/residueRemoved.py,sha256=jxDu_Jfcyd-rm-qo8ZuRIf-GGxtFBMpmGy1zHOavwy0,2135
|
|
57
57
|
hestia_earth/models/cycle/siteDuration.py,sha256=Hox20n3Y-tJ4ydmkrOreWOXAENxOnd827B7qH7_66T0,1058
|
|
58
58
|
hestia_earth/models/cycle/transformation.py,sha256=06KTfVubh2I47dfnG9Iv6AbuUBbURM8BAVOkRu7XmHw,1255
|
|
59
|
-
hestia_earth/models/cycle/utils.py,sha256=
|
|
59
|
+
hestia_earth/models/cycle/utils.py,sha256=ZcVwvRwVNK48jZfnhrHl2ai4a96YzcmRgO-eQXwQNjo,1408
|
|
60
60
|
hestia_earth/models/cycle/animal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
61
61
|
hestia_earth/models/cycle/animal/properties.py,sha256=OGjRl79w-h439jTkjA8b4V61fMuo0McoUs3JrgK-0Zc,596
|
|
62
62
|
hestia_earth/models/cycle/animal/input/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -142,23 +142,23 @@ hestia_earth/models/geospatialDatabase/longFallowRatio.py,sha256=VnTW2Y7qpoxlEar
|
|
|
142
142
|
hestia_earth/models/geospatialDatabase/nutrientLossToAquaticEnvironment.py,sha256=uEsoYJ1mzgUo6fQhUrcJ-ATcFw1j9oEgqMXKbQuFRxQ,1973
|
|
143
143
|
hestia_earth/models/geospatialDatabase/organicCarbonPerKgSoil.py,sha256=gt3-crrUN0HPtIKY7Hf9dUteCXkegSICVjO-jufDqas,2196
|
|
144
144
|
hestia_earth/models/geospatialDatabase/potentialEvapotranspirationAnnual.py,sha256=UlCBvAD-6H-4sdryfPuX1YDlOsGPOI8T9y0q4O0Tau8,2544
|
|
145
|
-
hestia_earth/models/geospatialDatabase/potentialEvapotranspirationLongTermAnnualMean.py,sha256=
|
|
146
|
-
hestia_earth/models/geospatialDatabase/potentialEvapotranspirationMonthly.py,sha256=
|
|
145
|
+
hestia_earth/models/geospatialDatabase/potentialEvapotranspirationLongTermAnnualMean.py,sha256=YywD9wCkGFF1q60LocXNvLr-tQ2_9km2PrVnXRgN83E,2125
|
|
146
|
+
hestia_earth/models/geospatialDatabase/potentialEvapotranspirationMonthly.py,sha256=3VmoobXfTVP77vyBrxkplTToe3RnLeTrNStA2r6sdzY,3357
|
|
147
147
|
hestia_earth/models/geospatialDatabase/precipitationAnnual.py,sha256=8_lMKVUPClnp7tetHrsoUY2ZGG2J7c-cXqJD8rznp0Q,2803
|
|
148
148
|
hestia_earth/models/geospatialDatabase/precipitationLongTermAnnualMean.py,sha256=fS5knfil5f2QP8-gxFdXuoGTxXpzoJQZ9h4UjWIWjCA,2376
|
|
149
|
-
hestia_earth/models/geospatialDatabase/precipitationMonthly.py,sha256=
|
|
149
|
+
hestia_earth/models/geospatialDatabase/precipitationMonthly.py,sha256=D2HNR7cIP2Dd47uxmXp6p_wPhmxR6i-4trX83WpH3z4,3407
|
|
150
150
|
hestia_earth/models/geospatialDatabase/region.py,sha256=rdywdsI4OglcO05tih0UQx0qbnm8BAn7mP-x74iV03c,1462
|
|
151
151
|
hestia_earth/models/geospatialDatabase/sandContent.py,sha256=BZUn2z4BN1HgCGZ2Xsifca2CRTaZ4gdcaZ8A1_UoPQM,2704
|
|
152
152
|
hestia_earth/models/geospatialDatabase/siltContent.py,sha256=0GnBZHjqS_Py4730s4LqzQ_GikBSxFyUGYG4dEiXiGs,2162
|
|
153
153
|
hestia_earth/models/geospatialDatabase/slope.py,sha256=g1SpuYks60injv2w-CMjESNfu8KM1JsiYnRT9XZfSuY,1859
|
|
154
154
|
hestia_earth/models/geospatialDatabase/slopeLength.py,sha256=6pGr1qR0EiiUKkeflpYut7eI6UsnXAzHDoHhAzXKFJk,1864
|
|
155
155
|
hestia_earth/models/geospatialDatabase/soilPh.py,sha256=egvtnVPCL0El2J9oVLAFxl6HoZQsK-RrNobA0LMAtOY,2109
|
|
156
|
-
hestia_earth/models/geospatialDatabase/temperatureAnnual.py,sha256=
|
|
157
|
-
hestia_earth/models/geospatialDatabase/temperatureLongTermAnnualMean.py,sha256=
|
|
158
|
-
hestia_earth/models/geospatialDatabase/temperatureMonthly.py,sha256=
|
|
156
|
+
hestia_earth/models/geospatialDatabase/temperatureAnnual.py,sha256=UCTr8zvz9AH13nd-ynqjYZ1gABn8cw5PHXS29SzbhyE,2712
|
|
157
|
+
hestia_earth/models/geospatialDatabase/temperatureLongTermAnnualMean.py,sha256=j5vsDYZeEQYqgOzBGepD5oGFtRvjhk__uZ7ux37gapQ,2229
|
|
158
|
+
hestia_earth/models/geospatialDatabase/temperatureMonthly.py,sha256=hJjbnTgefBtRwL5IJHaaPFtRvzTDv7l5nDI8vdadMCg,3353
|
|
159
159
|
hestia_earth/models/geospatialDatabase/totalNitrogenPerKgSoil.py,sha256=kjP3ue-tlzMQNx2hBM56_CBBRa8Pcosmd2BPgyiNVW4,2081
|
|
160
160
|
hestia_earth/models/geospatialDatabase/totalPhosphorusPerKgSoil.py,sha256=5oasLMYgfnPwSse0D8EEe_pV57AMusac853BgVSUh5E,2070
|
|
161
|
-
hestia_earth/models/geospatialDatabase/utils.py,sha256=
|
|
161
|
+
hestia_earth/models/geospatialDatabase/utils.py,sha256=hKzR6wlVtkSyvCGcUKjI1YdvRk9mrNfvdmae4yHGLrM,6229
|
|
162
162
|
hestia_earth/models/geospatialDatabase/waterDepth.py,sha256=Xy2UxwAJrgdOkcw59NetEHMt5vgRYE6qg4fgXb1ptlU,1643
|
|
163
163
|
hestia_earth/models/globalCropWaterModel2008/__init__.py,sha256=vQxexzFCl2Uv2RiIJfcppkRi9RgzBsJ68yhVDK4GvAU,425
|
|
164
164
|
hestia_earth/models/globalCropWaterModel2008/rootingDepth.py,sha256=pajS-6UWxqIqnzW0IjkgNm-2Vl3bMor2UZOQtQQERuc,4096
|
|
@@ -248,7 +248,7 @@ hestia_earth/models/ipcc2019/no3ToGroundwaterInorganicFertiliser.py,sha256=wTvMB
|
|
|
248
248
|
hestia_earth/models/ipcc2019/no3ToGroundwaterOrganicFertiliser.py,sha256=zOhp6NhYUuUNU_LMMwhZBP78YC2XRWRlGnajBUX2AN8,3095
|
|
249
249
|
hestia_earth/models/ipcc2019/noxToAirInorganicFertiliser.py,sha256=D-UyzY55mOiIcXRzEtvPY-r1bDFgb9YqA08SmHsQeNA,4226
|
|
250
250
|
hestia_earth/models/ipcc2019/noxToAirOrganicFertiliser.py,sha256=SVgVNp76bIv9oUjrZZuI6xYLo4Gw2DRU5tbp14gydOE,3911
|
|
251
|
-
hestia_earth/models/ipcc2019/organicCarbonPerHa.py,sha256=
|
|
251
|
+
hestia_earth/models/ipcc2019/organicCarbonPerHa.py,sha256=_13qQlsaAljIKw4KbrGXEMnc0Do3N3TiKypBToGj52c,140870
|
|
252
252
|
hestia_earth/models/ipcc2019/pastureGrass.py,sha256=CpDEtdnbKd_8eaDLcflJ-dGik3t879HIoEIzuaHNmC0,23168
|
|
253
253
|
hestia_earth/models/ipcc2019/utils.py,sha256=MSDMu15D9DnilFUgi4_6jYXC0FaKso3OODauGTMB6hs,6229
|
|
254
254
|
hestia_earth/models/ipcc2021/__init__.py,sha256=VTgGFKhwMmk_nuI1RRq0in27fHYVPBonlXlPK00K8no,409
|
|
@@ -348,10 +348,10 @@ hestia_earth/models/lcImpactCertainEffectsInfinite/damageToTerrestrialEcosystems
|
|
|
348
348
|
hestia_earth/models/lcImpactCertainEffectsInfinite/damageToTerrestrialEcosystemsPhotochemicalOzoneFormation.py,sha256=t8DTybm_3DIlvtpSJP-KBWsgp0SKe4d_pw2Y0BKGxMg,1175
|
|
349
349
|
hestia_earth/models/lcImpactCertainEffectsInfinite/damageToTerrestrialEcosystemsTerrestrialAcidification.py,sha256=U74max756dWZLVbLNUAHcHeUiHADLxuvRbvpJc4eSLc,1182
|
|
350
350
|
hestia_earth/models/lcImpactCertainEffectsInfinite/damageToTerrestrialEcosystemsTerrestrialEcotoxicity.py,sha256=-8e8-lt0yByEcVbk7bTF4-z3t51w5iQKVdZ5bgYsyJg,1063
|
|
351
|
-
hestia_earth/models/linkedImpactAssessment/__init__.py,sha256=
|
|
351
|
+
hestia_earth/models/linkedImpactAssessment/__init__.py,sha256=fSO3M1dmQD6fuEZkzJycscjUf7HtjQyoV8u2W7ItvSk,6236
|
|
352
352
|
hestia_earth/models/mocking/__init__.py,sha256=kmSeOTSvurMUxw7Ajhf3G-SVPQ1NgmirMTk4TSOEicY,765
|
|
353
353
|
hestia_earth/models/mocking/mock_search.py,sha256=V-ycVBTkJu7PP37Ivy_16hpKBV4aEtJb5S9DfChPNSU,2038
|
|
354
|
-
hestia_earth/models/mocking/search-results.json,sha256=
|
|
354
|
+
hestia_earth/models/mocking/search-results.json,sha256=FIdOQLItwJDbNc79gILosT0PVCvFBueaL2XRMYVDHHw,39085
|
|
355
355
|
hestia_earth/models/pooreNemecek2018/__init__.py,sha256=nPboL7ULJzL5nJD5q7q9VOZt_fxbKVm8fmn1Az5YkVY,417
|
|
356
356
|
hestia_earth/models/pooreNemecek2018/aboveGroundCropResidueTotal.py,sha256=Qt-mel4dkhK6N5uUOutNOinCTFjbjtGzITaaI0LvYc4,2396
|
|
357
357
|
hestia_earth/models/pooreNemecek2018/belowGroundCropResidue.py,sha256=JT0RybbvWVlo01FO8K0Yj41HrEaJT3Kj1xfayr2X-xw,2315
|
|
@@ -440,11 +440,13 @@ hestia_earth/models/schererPfister2015/pToSurfaceWaterSoilFlux.py,sha256=CuqIsy3
|
|
|
440
440
|
hestia_earth/models/schererPfister2015/utils.py,sha256=LEvz9guqto0kuF5rXcQjgYsD3CvEmORvJQqRA1f7uMI,3130
|
|
441
441
|
hestia_earth/models/schmidt2007/__init__.py,sha256=xheSN6LOGXpWx7Hnv83onhe60Xk1_jk1PJg1nH_aZOQ,412
|
|
442
442
|
hestia_earth/models/schmidt2007/ch4ToAirWasteTreatment.py,sha256=-N5uLvVHlA2djOs_lwR_8RmbeCfkPw5p3vmbqG2kzkI,1474
|
|
443
|
+
hestia_earth/models/schmidt2007/n2OToAirWasteTreatmentDirect.py,sha256=3i7tgar2DODXzug36HBAbbx94ybst15Efode7AzvVEs,1480
|
|
444
|
+
hestia_earth/models/schmidt2007/nh3ToAirWasteTreatment.py,sha256=yGrw7LHTrgRU_LyUsdl96TO6omEZju7JaBbW_A8ufX4,1474
|
|
443
445
|
hestia_earth/models/schmidt2007/utils.py,sha256=pQ76IBWMwi10Wa5PjsehtdnOMw-GVgDtB4nLGYKT-Ic,812
|
|
444
446
|
hestia_earth/models/site/__init__.py,sha256=aVuLLhq0OQVm-_MZoq4JAKMidqexUWJBg_7mmojmDzc,405
|
|
445
447
|
hestia_earth/models/site/cationExchangeCapacityPerKgSoil.py,sha256=0eH4A-tXJ0hvIkiYXWxlx8TfrdbIKUGYUDk97-yQJgg,3653
|
|
446
448
|
hestia_earth/models/site/flowingWater.py,sha256=0ZuSXMr3EUTY3wsy8hdfuXeZcNX-n3D45MfX3dwyaeA,1728
|
|
447
|
-
hestia_earth/models/site/management.py,sha256=
|
|
449
|
+
hestia_earth/models/site/management.py,sha256=FSSOiisV87nmqQ32ww3ElwspyDS8JvkxOXhUEsUj-gw,8555
|
|
448
450
|
hestia_earth/models/site/netPrimaryProduction.py,sha256=UIIQkYd911qVzrWjxBLrC37e-RARIVgDwLdARY9BuLw,1849
|
|
449
451
|
hestia_earth/models/site/organicCarbonPerHa.py,sha256=gcmhZavc2EWvkroKkpFM5xXowPTgyXGh1XL6lgs3CX4,14303
|
|
450
452
|
hestia_earth/models/site/organicCarbonPerKgSoil.py,sha256=t--wAshiAKS-JvEKhLFRadGvgSBv5NFZ68jdyms_wh4,1945
|
|
@@ -457,7 +459,7 @@ hestia_earth/models/site/precipitationAnnual.py,sha256=to14BEFjUaYyCu5aIBQZtuaIr
|
|
|
457
459
|
hestia_earth/models/site/precipitationMonthly.py,sha256=yGUbiUCu1Prp3qVHuZodGrcfrbYu170WTUGyaj-KEjY,1896
|
|
458
460
|
hestia_earth/models/site/rainfallAnnual.py,sha256=Ix_B8Ny7IIRkJ_3lUvoHOjPgqCyR9I0U3_ADUUtMqsY,2003
|
|
459
461
|
hestia_earth/models/site/rainfallMonthly.py,sha256=2Uo8F-YxnTK0_txlHmiAyVp1bGfWD4bneRKyg4tdQkI,1881
|
|
460
|
-
hestia_earth/models/site/soilMeasurement.py,sha256=
|
|
462
|
+
hestia_earth/models/site/soilMeasurement.py,sha256=q5CJ4caCqH8pSbQxen0IqTjrFyMRLrrCU2M2BMUgzTE,7851
|
|
461
463
|
hestia_earth/models/site/temperatureAnnual.py,sha256=Q3b1RH2_hpA0JWwOYA5nKgMGcXHjV8-akXT9vB0cbwc,2012
|
|
462
464
|
hestia_earth/models/site/temperatureMonthly.py,sha256=yXwpFCGT2tUqvVBNedaPyBmN_KlzZqo5yv2TWem1pBk,1890
|
|
463
465
|
hestia_earth/models/site/totalNitrogenPerKgSoil.py,sha256=8ERrTZpN_yCRUyFg_EYaX4abE9jLcyX3lx3MO4Bi6CE,1938
|
|
@@ -505,7 +507,7 @@ hestia_earth/models/utils/__init__.py,sha256=-kuwCLmQOihU3n1RxqhojRa3Izd6PGOqA30
|
|
|
505
507
|
hestia_earth/models/utils/aggregated.py,sha256=sz6usleZmo_tC_hIvmGgYsX8-H0dulXmmhHK4EkA5Kg,4946
|
|
506
508
|
hestia_earth/models/utils/animalProduct.py,sha256=JA-xGQiwsz-VPR_8UfI5hKa918bpQOWIok3--b_iVuM,681
|
|
507
509
|
hestia_earth/models/utils/aquacultureManagement.py,sha256=3uSTSMDNNPa26NTJGZCYwByv3QZVyxj6bh2aFCoBzHk,126
|
|
508
|
-
hestia_earth/models/utils/blank_node.py,sha256=
|
|
510
|
+
hestia_earth/models/utils/blank_node.py,sha256=Yubi--CeQDSrkbZOh7PQ-IL3foe74yH9YGrPrO6nxfM,40822
|
|
509
511
|
hestia_earth/models/utils/completeness.py,sha256=gRl8LkAYmanEZf9ln8IrQPXtW1Ds75rvu1ST0g5-2zI,1246
|
|
510
512
|
hestia_earth/models/utils/constant.py,sha256=5H7odhRwU_LmUhYwf8c1LsdqXSYbLWkuknvtRDqUBTQ,3194
|
|
511
513
|
hestia_earth/models/utils/crop.py,sha256=S8UycHpkgx_TznW3Q7pchEMlCQ623T_SqU6V5fBLBLc,1520
|
|
@@ -533,7 +535,7 @@ hestia_earth/models/utils/property.py,sha256=7UV9pxSX49RnUsbEqOeohzxyXXShao1XAnE
|
|
|
533
535
|
hestia_earth/models/utils/site.py,sha256=OhSpyDqVwnIglBtoa3iUImzVr0Xj254oYR1wMiAiOHs,3176
|
|
534
536
|
hestia_earth/models/utils/source.py,sha256=HhZkvQoFdy6j6FC2cwP5EbHXHFM4pif9gpnuzeDwEh4,1746
|
|
535
537
|
hestia_earth/models/utils/temperature.py,sha256=ljlG4-yCgFFb6LRZweb18cZKLrr7K2mqd4E4Hz_D1f8,476
|
|
536
|
-
hestia_earth/models/utils/term.py,sha256=
|
|
538
|
+
hestia_earth/models/utils/term.py,sha256=XH3-xTkv8WNB0obOjo6Y5YLT8B3zcON6Z-JeskCsCXY,17112
|
|
537
539
|
hestia_earth/models/utils/transformation.py,sha256=nyT5Mz4_VgFwhkL8JoNX9kxxow0zuxzsYl3W8xOu2p0,370
|
|
538
540
|
hestia_earth/models/webbEtAl2012AndSintermannEtAl2012/__init__.py,sha256=Niv7ZFMBCwThlbCKGOwA17QdkpOUDFrqrFItGNqnZAA,434
|
|
539
541
|
hestia_earth/models/webbEtAl2012AndSintermannEtAl2012/nh3ToAirOrganicFertiliser.py,sha256=G2eq00XGdr1ZEZ5Ru1nBIR-sD7iM9hGYhvk8r5wL3dA,3910
|
|
@@ -775,7 +777,7 @@ tests/models/ipcc2019/test_no3ToGroundwaterInorganicFertiliser.py,sha256=e7REnQ9
|
|
|
775
777
|
tests/models/ipcc2019/test_no3ToGroundwaterOrganicFertiliser.py,sha256=e1ZViD12qB3bLdH3TJw3GbBP8iqMen-UJbcFkytb3VQ,1609
|
|
776
778
|
tests/models/ipcc2019/test_noxToAirInorganicFertiliser.py,sha256=NZBSBJLM_j2PEpHRON2ysgKNF8x5sHfQVoAKQdGsfzk,1537
|
|
777
779
|
tests/models/ipcc2019/test_noxToAirOrganicFertiliser.py,sha256=LR5pjV5vRbgSSQAw8kYRp_ij4CHInzgaDS6EggQuBiw,1104
|
|
778
|
-
tests/models/ipcc2019/test_organicCarbonPerHa.py,sha256=
|
|
780
|
+
tests/models/ipcc2019/test_organicCarbonPerHa.py,sha256=iUKKqTModA2ZC_EU6gQ4pzxJ1YN3rV1iUJQa932fiJ0,20529
|
|
779
781
|
tests/models/ipcc2019/test_pastureGrass.py,sha256=pE4PWdR541v4xWDYihP7Dou8V1iqg5GwD5_rjGRzrds,2292
|
|
780
782
|
tests/models/ipcc2021/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
781
783
|
tests/models/ipcc2021/test_gwp100.py,sha256=JRklKMSg-OXopb9ZufGgl94deuMuJSsfNXRZDBtOZrE,1119
|
|
@@ -960,11 +962,13 @@ tests/models/schererPfister2015/test_pToGroundwaterSoilFlux.py,sha256=lOTL-ue6hE
|
|
|
960
962
|
tests/models/schererPfister2015/test_pToSurfaceWaterSoilFlux.py,sha256=1VJo9q-Kb2OboK2RMp3-bkP6lXfkFbqMz1ACJC75FWw,1441
|
|
961
963
|
tests/models/schmidt2007/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
962
964
|
tests/models/schmidt2007/test_ch4ToAirWasteTreatment.py,sha256=5VSxT6sEbNp6c4Y07WzJGFDwVnjJbziG9HmbJNF6r6A,1454
|
|
965
|
+
tests/models/schmidt2007/test_n2OToAirWasteTreatmentDirect.py,sha256=xgikZTGcDqiYdT4b1lR-2g7SQEIenV2-RSzeB68dqRM,1460
|
|
966
|
+
tests/models/schmidt2007/test_nh3ToAirWasteTreatment.py,sha256=22x5Hc0keF41LYMKvARrJvmPtOjIKJ6vCrF2d8AOyAc,1454
|
|
963
967
|
tests/models/schmidt2007/test_utils.py,sha256=rmtOV3xiFynjgx8lQNGsJqquG8HDxz3LDmh1efN8AkI,1278
|
|
964
968
|
tests/models/site/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
965
969
|
tests/models/site/test_cationExchangeCapacityPerKgSoil.py,sha256=tNMhN998vcjQ15I-5mNnFh2d7mHzEBIBO6o1VSfQNUE,1075
|
|
966
970
|
tests/models/site/test_flowingWater.py,sha256=t_rxvdlmUVDsFBoDF20_zDM-0iiLKkNCV7knO9l1T7o,1370
|
|
967
|
-
tests/models/site/test_management.py,sha256=
|
|
971
|
+
tests/models/site/test_management.py,sha256=CO9wghyFmnG5ynU6iuKcJ3LkZCoV9pY35hQedrY6-kk,4470
|
|
968
972
|
tests/models/site/test_netPrimaryProduction.py,sha256=JCxG0MODbKVvl3hOqmKzh4FjHYn3Xs9KsVod6LvKQII,1108
|
|
969
973
|
tests/models/site/test_organicCarbonPerHa.py,sha256=6Qtc0Xmveir7MmNF4Ekv5YkV92TNp8GfDnURPVg05-4,3471
|
|
970
974
|
tests/models/site/test_organicCarbonPerKgSoil.py,sha256=0M-NMg_T3UXzGT_VlKOKhSxg4cZ0_zhd3FRgY5Hpj6o,1087
|
|
@@ -977,7 +981,7 @@ tests/models/site/test_precipitationAnnual.py,sha256=h0tXvykZw4Zaw225RHfvw-3DvAy
|
|
|
977
981
|
tests/models/site/test_precipitationMonthly.py,sha256=iccr-_ZrseM_OT3AKZbTNQhRFSIe-R6wXTDS-2wIVew,995
|
|
978
982
|
tests/models/site/test_rainfallAnnual.py,sha256=4YYna66qjJptPJ_URvdcQuRC3dri9SB0xmWP8DFwslM,986
|
|
979
983
|
tests/models/site/test_rainfallMonthly.py,sha256=A3gIe2Yxt9CLtLcAJNCQ0-8aRB49VdfKBLBy-7eDgJw,985
|
|
980
|
-
tests/models/site/test_soilMeasurement.py,sha256=
|
|
984
|
+
tests/models/site/test_soilMeasurement.py,sha256=IMSnjbyBYAqWicXGgpdNPpJ_OQw6QEJEmfHJxyF4iec,4887
|
|
981
985
|
tests/models/site/test_temperatureAnnual.py,sha256=nOJG9ZJ8NCMM8T47uxxBeloIYLFN6-xtvUBqJsqt8xk,992
|
|
982
986
|
tests/models/site/test_temperatureMonthly.py,sha256=C2lv-lpYqH7VUGOlxNLE6d7k_dFS6NYe8BvMlrJorCw,991
|
|
983
987
|
tests/models/site/test_totalNitrogenPerKgSoil.py,sha256=2ILrA0jQKGniiKwS5FF3ZLtudgUgjcMnzFtrHpJKPTc,1161
|
|
@@ -1036,11 +1040,11 @@ tests/models/utils/test_product.py,sha256=kwvgAeeEoRgkeStX0zQcFd-4DJhoUhX6Apaks0
|
|
|
1036
1040
|
tests/models/utils/test_property.py,sha256=t2npw86IK7C6G4ypiPtanFi0db4PB7G5VBR1GjRGl34,618
|
|
1037
1041
|
tests/models/utils/test_site.py,sha256=5nCW3onTk6GF_N-h4NYDrlSoxHhXY2GVMbjaDsicbSE,1187
|
|
1038
1042
|
tests/models/utils/test_source.py,sha256=mv3vHZV5cjpoLA2I1109-YUkuzAiuhbRSnv_76_f0CA,631
|
|
1039
|
-
tests/models/utils/test_term.py,sha256=
|
|
1043
|
+
tests/models/utils/test_term.py,sha256=M5Sa26v2gzQYbZ4H_fo7DspnaCx__-WtL-MULGapCWk,3509
|
|
1040
1044
|
tests/models/webbEtAl2012AndSintermannEtAl2012/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
1041
1045
|
tests/models/webbEtAl2012AndSintermannEtAl2012/test_nh3ToAirOrganicFertiliser.py,sha256=qi2FNXS5Af2WDtm7nq_FsprH3BfCF0XxnE0XHmC4aIY,2244
|
|
1042
|
-
hestia_earth_models-0.59.
|
|
1043
|
-
hestia_earth_models-0.59.
|
|
1044
|
-
hestia_earth_models-0.59.
|
|
1045
|
-
hestia_earth_models-0.59.
|
|
1046
|
-
hestia_earth_models-0.59.
|
|
1046
|
+
hestia_earth_models-0.59.5.dist-info/LICENSE,sha256=EFSZhfUdZCTsCIYdHzTGewMKfRfp7X9t1s2aaKxm8O0,1154
|
|
1047
|
+
hestia_earth_models-0.59.5.dist-info/METADATA,sha256=nswhxTNJU9lqQpd8DbRhIXzP2QgBYed7LLoAbLUmkSw,3134
|
|
1048
|
+
hestia_earth_models-0.59.5.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
1049
|
+
hestia_earth_models-0.59.5.dist-info/top_level.txt,sha256=1dqA9TqpOLTEgpqa-YBsmbCmmNU1y56AtfFGEceZ2A0,19
|
|
1050
|
+
hestia_earth_models-0.59.5.dist-info/RECORD,,
|
|
@@ -67,11 +67,6 @@ IRRIGATED_TERM_IDS = [
|
|
|
67
67
|
"irrigatedSurfaceIrrigationDrainageRegimeUnspecified"
|
|
68
68
|
]
|
|
69
69
|
|
|
70
|
-
LONG_FALLOW_LAND_COVER_TERM_IDS = [
|
|
71
|
-
"longFallow",
|
|
72
|
-
"longBareFallow"
|
|
73
|
-
]
|
|
74
|
-
|
|
75
70
|
RESIDUE_REMOVED_OR_BURNT_TERM_IDS = [
|
|
76
71
|
"residueBurnt",
|
|
77
72
|
"residueRemoved"
|
|
@@ -128,7 +123,9 @@ RUN_SUBFOLDERS = [
|
|
|
128
123
|
("tier-1/cropland-without-measured-soc", False),
|
|
129
124
|
("tier-1/permanent-pasture", False),
|
|
130
125
|
("tier-1/should-not-run", False),
|
|
131
|
-
("tier-1/without-management-with-measured-soc", False)
|
|
126
|
+
("tier-1/without-management-with-measured-soc", False),
|
|
127
|
+
("tier-1/land-use-change", False), # Closes issue 755
|
|
128
|
+
("tier-1/run-with-site-type", False) # Closes issue 755
|
|
132
129
|
]
|
|
133
130
|
|
|
134
131
|
|
|
@@ -141,7 +138,6 @@ RUN_SUBFOLDERS = [
|
|
|
141
138
|
@patch(f"{class_path}.get_cover_crop_property_terms", return_value=COVER_CROP_PROPERTY_TERM_IDS)
|
|
142
139
|
@patch(f"{class_path}.get_crop_residue_incorporated_or_left_on_field_terms", return_value=CROP_RESIDUE_INCORP_TERM_IDS)
|
|
143
140
|
@patch(f"{class_path}.get_irrigated_terms", return_value=IRRIGATED_TERM_IDS)
|
|
144
|
-
@patch(f"{class_path}.get_long_fallow_land_cover_terms", return_value=LONG_FALLOW_LAND_COVER_TERM_IDS)
|
|
145
141
|
@patch(f"{class_path}.get_residue_removed_or_burnt_terms", return_value=RESIDUE_REMOVED_OR_BURNT_TERM_IDS)
|
|
146
142
|
@patch(f"{class_path}.get_upland_rice_land_cover_terms", return_value=UPLAND_RICE_LAND_COVER_TERM_IDS)
|
|
147
143
|
@patch(f"{class_path}.get_upland_rice_crop_terms", return_value=UPLAND_RICE_CROP_TERM_IDS)
|
|
@@ -153,7 +149,6 @@ def test_run(
|
|
|
153
149
|
_mock_get_upland_rice_crop_terms,
|
|
154
150
|
_mock_get_upland_rice_land_cover_terms,
|
|
155
151
|
_mock_get_residue_removed_or_burnt_terms,
|
|
156
|
-
_mock_get_long_fallow_land_cover_terms,
|
|
157
152
|
_mock_get_irrigated_terms,
|
|
158
153
|
_mock_get_crop_residue_incorporated_or_left_on_field_terms,
|
|
159
154
|
_mock_get_cover_crop_property_terms,
|
|
@@ -184,7 +179,6 @@ def test_run(
|
|
|
184
179
|
@patch(f"{class_path}.get_cover_crop_property_terms", return_value=COVER_CROP_PROPERTY_TERM_IDS)
|
|
185
180
|
@patch(f"{class_path}.get_crop_residue_incorporated_or_left_on_field_terms", return_value=CROP_RESIDUE_INCORP_TERM_IDS)
|
|
186
181
|
@patch(f"{class_path}.get_irrigated_terms", return_value=IRRIGATED_TERM_IDS)
|
|
187
|
-
@patch(f"{class_path}.get_long_fallow_land_cover_terms", return_value=LONG_FALLOW_LAND_COVER_TERM_IDS)
|
|
188
182
|
@patch(f"{class_path}.get_residue_removed_or_burnt_terms", return_value=RESIDUE_REMOVED_OR_BURNT_TERM_IDS)
|
|
189
183
|
@patch(f"{class_path}.get_upland_rice_land_cover_terms", return_value=UPLAND_RICE_LAND_COVER_TERM_IDS)
|
|
190
184
|
@patch(f"{class_path}.get_upland_rice_crop_terms", return_value=UPLAND_RICE_CROP_TERM_IDS)
|
|
@@ -300,11 +294,9 @@ LAND_USE_CATEGORY_PARAMS = [
|
|
|
300
294
|
ids=[params[0] for params in LAND_USE_CATEGORY_PARAMS]
|
|
301
295
|
)
|
|
302
296
|
@patch(f"{class_path}.get_irrigated_terms", return_value=IRRIGATED_TERM_IDS)
|
|
303
|
-
@patch(f"{class_path}.get_long_fallow_land_cover_terms", return_value=LONG_FALLOW_LAND_COVER_TERM_IDS)
|
|
304
297
|
@patch(f"{class_path}.get_upland_rice_land_cover_terms", return_value=UPLAND_RICE_LAND_COVER_TERM_IDS)
|
|
305
298
|
def test_assign_ipcc_land_use_category(
|
|
306
299
|
_mock_get_upland_rice_land_cover_terms,
|
|
307
|
-
_mock_get_long_fallow_land_cover_terms,
|
|
308
300
|
_mock_get_irrigated_terms,
|
|
309
301
|
subfolder,
|
|
310
302
|
soil_category,
|
|
@@ -315,7 +307,7 @@ def test_assign_ipcc_land_use_category(
|
|
|
315
307
|
with open(f"{folder}/site.jsonld", encoding='utf-8') as f:
|
|
316
308
|
site = json.load(f)
|
|
317
309
|
|
|
318
|
-
result = _assign_ipcc_land_use_category(site.get("
|
|
310
|
+
result = _assign_ipcc_land_use_category(site.get("management", []), soil_category)
|
|
319
311
|
assert result == expected
|
|
320
312
|
|
|
321
313
|
|
|
@@ -363,11 +355,9 @@ def test_assign_ipcc_management_category(subfolder, land_use_category, expected)
|
|
|
363
355
|
@patch(f"{class_path}.get_cover_crop_property_terms", return_value=COVER_CROP_PROPERTY_TERM_IDS)
|
|
364
356
|
@patch(f"{class_path}.get_crop_residue_incorporated_or_left_on_field_terms", return_value=CROP_RESIDUE_INCORP_TERM_IDS)
|
|
365
357
|
@patch(f"{class_path}.get_irrigated_terms", return_value=IRRIGATED_TERM_IDS)
|
|
366
|
-
@patch(f"{class_path}.get_long_fallow_land_cover_terms", return_value=LONG_FALLOW_LAND_COVER_TERM_IDS)
|
|
367
358
|
@patch(f"{class_path}.get_residue_removed_or_burnt_terms", return_value=RESIDUE_REMOVED_OR_BURNT_TERM_IDS)
|
|
368
359
|
def test_check_cropland_medium_category(
|
|
369
360
|
_mock_get_residue_removed_or_burnt_terms,
|
|
370
|
-
_mock_get_long_fallow_land_cover_terms,
|
|
371
361
|
_mock_get_irrigated_terms,
|
|
372
362
|
_mock_get_crop_residue_incorporated_or_left_on_field_terms,
|
|
373
363
|
_mock_get_cover_crop_property_terms,
|
|
@@ -390,11 +380,9 @@ def test_check_cropland_medium_category(
|
|
|
390
380
|
@patch(f"{class_path}.get_cover_crop_property_terms", return_value=COVER_CROP_PROPERTY_TERM_IDS)
|
|
391
381
|
@patch(f"{class_path}.get_crop_residue_incorporated_or_left_on_field_terms", return_value=CROP_RESIDUE_INCORP_TERM_IDS)
|
|
392
382
|
@patch(f"{class_path}.get_irrigated_terms", return_value=IRRIGATED_TERM_IDS)
|
|
393
|
-
@patch(f"{class_path}.get_long_fallow_land_cover_terms", return_value=LONG_FALLOW_LAND_COVER_TERM_IDS)
|
|
394
383
|
@patch(f"{class_path}.get_residue_removed_or_burnt_terms", return_value=RESIDUE_REMOVED_OR_BURNT_TERM_IDS)
|
|
395
384
|
def test_check_cropland_low_category(
|
|
396
385
|
_mock_get_residue_removed_or_burnt_terms,
|
|
397
|
-
_mock_get_long_fallow_land_cover_terms,
|
|
398
386
|
_mock_get_irrigated_terms,
|
|
399
387
|
_mock_get_crop_residue_incorporated_or_left_on_field_terms,
|
|
400
388
|
_mock_get_cover_crop_property_terms,
|
|
@@ -459,11 +447,9 @@ CARBON_INPUT_CATEGORY_PARAMS = [
|
|
|
459
447
|
@patch(f"{class_path}.get_cover_crop_property_terms", return_value=COVER_CROP_PROPERTY_TERM_IDS)
|
|
460
448
|
@patch(f"{class_path}.get_crop_residue_incorporated_or_left_on_field_terms", return_value=CROP_RESIDUE_INCORP_TERM_IDS)
|
|
461
449
|
@patch(f"{class_path}.get_irrigated_terms", return_value=IRRIGATED_TERM_IDS)
|
|
462
|
-
@patch(f"{class_path}.get_long_fallow_land_cover_terms", return_value=LONG_FALLOW_LAND_COVER_TERM_IDS)
|
|
463
450
|
@patch(f"{class_path}.get_residue_removed_or_burnt_terms", return_value=RESIDUE_REMOVED_OR_BURNT_TERM_IDS)
|
|
464
451
|
def test_assign_ipcc_carbon_input_category(
|
|
465
452
|
_mock_get_residue_removed_or_burnt_terms,
|
|
466
|
-
_mock_get_long_fallow_land_cover_terms,
|
|
467
453
|
_mock_get_irrigated_terms,
|
|
468
454
|
_mock_get_crop_residue_incorporated_or_left_on_field_terms,
|
|
469
455
|
_mock_get_cover_crop_property_terms,
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
from unittest.mock import patch
|
|
2
|
+
import json
|
|
3
|
+
from tests.utils import fixtures_path, fake_new_emission
|
|
4
|
+
|
|
5
|
+
from hestia_earth.models.schmidt2007.n2OToAirWasteTreatmentDirect import MODEL, TERM_ID, run, _should_run
|
|
6
|
+
|
|
7
|
+
class_path = f"hestia_earth.models.{MODEL}.{TERM_ID}"
|
|
8
|
+
fixtures_folder = f"{fixtures_path}/{MODEL}/{TERM_ID}"
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@patch(f"{class_path}.get_waste_values")
|
|
12
|
+
def test_should_run(mock_get_waste_values):
|
|
13
|
+
# no fuel values => no run
|
|
14
|
+
mock_get_waste_values.return_value = []
|
|
15
|
+
should_run, *args = _should_run({})
|
|
16
|
+
assert not should_run
|
|
17
|
+
|
|
18
|
+
# with fuel values => run
|
|
19
|
+
mock_get_waste_values.return_value = [0]
|
|
20
|
+
should_run, *args = _should_run({})
|
|
21
|
+
assert should_run is True
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
|
|
25
|
+
def test_run(*args):
|
|
26
|
+
with open(f"{fixtures_folder}/cycle.jsonld", encoding='utf-8') as f:
|
|
27
|
+
cycle = json.load(f)
|
|
28
|
+
|
|
29
|
+
with open(f"{fixtures_folder}/result.jsonld", encoding='utf-8') as f:
|
|
30
|
+
expected = json.load(f)
|
|
31
|
+
|
|
32
|
+
value = run(cycle)
|
|
33
|
+
assert value == expected
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
@patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
|
|
37
|
+
def test_run_data_complete(*args):
|
|
38
|
+
with open(f"{fixtures_folder}/no-input-data-complete/cycle.jsonld", encoding='utf-8') as f:
|
|
39
|
+
cycle = json.load(f)
|
|
40
|
+
|
|
41
|
+
with open(f"{fixtures_folder}/no-input-data-complete/result.jsonld", encoding='utf-8') as f:
|
|
42
|
+
expected = json.load(f)
|
|
43
|
+
|
|
44
|
+
value = run(cycle)
|
|
45
|
+
assert value == expected
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
from unittest.mock import patch
|
|
2
|
+
import json
|
|
3
|
+
from tests.utils import fixtures_path, fake_new_emission
|
|
4
|
+
|
|
5
|
+
from hestia_earth.models.schmidt2007.nh3ToAirWasteTreatment import MODEL, TERM_ID, run, _should_run
|
|
6
|
+
|
|
7
|
+
class_path = f"hestia_earth.models.{MODEL}.{TERM_ID}"
|
|
8
|
+
fixtures_folder = f"{fixtures_path}/{MODEL}/{TERM_ID}"
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@patch(f"{class_path}.get_waste_values")
|
|
12
|
+
def test_should_run(mock_get_waste_values):
|
|
13
|
+
# no fuel values => no run
|
|
14
|
+
mock_get_waste_values.return_value = []
|
|
15
|
+
should_run, *args = _should_run({})
|
|
16
|
+
assert not should_run
|
|
17
|
+
|
|
18
|
+
# with fuel values => run
|
|
19
|
+
mock_get_waste_values.return_value = [0]
|
|
20
|
+
should_run, *args = _should_run({})
|
|
21
|
+
assert should_run is True
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
|
|
25
|
+
def test_run(*args):
|
|
26
|
+
with open(f"{fixtures_folder}/cycle.jsonld", encoding='utf-8') as f:
|
|
27
|
+
cycle = json.load(f)
|
|
28
|
+
|
|
29
|
+
with open(f"{fixtures_folder}/result.jsonld", encoding='utf-8') as f:
|
|
30
|
+
expected = json.load(f)
|
|
31
|
+
|
|
32
|
+
value = run(cycle)
|
|
33
|
+
assert value == expected
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
@patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
|
|
37
|
+
def test_run_data_complete(*args):
|
|
38
|
+
with open(f"{fixtures_folder}/no-input-data-complete/cycle.jsonld", encoding='utf-8') as f:
|
|
39
|
+
cycle = json.load(f)
|
|
40
|
+
|
|
41
|
+
with open(f"{fixtures_folder}/no-input-data-complete/result.jsonld", encoding='utf-8') as f:
|
|
42
|
+
expected = json.load(f)
|
|
43
|
+
|
|
44
|
+
value = run(cycle)
|
|
45
|
+
assert value == expected
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import json
|
|
2
2
|
from unittest.mock import patch
|
|
3
|
+
|
|
4
|
+
import pytest
|
|
3
5
|
from hestia_earth.schema import TermTermType
|
|
4
6
|
|
|
5
7
|
from hestia_earth.models.site.management import MODEL, MODEL_KEY, run, _should_run
|
|
@@ -13,6 +15,16 @@ TERM_BY_ID = {
|
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
|
|
18
|
+
def lookup_side_effect(*args, **kwargs):
|
|
19
|
+
# Values taken from real lookups.
|
|
20
|
+
_ = kwargs
|
|
21
|
+
if args[0]["@id"] == "ureaKgN" and args[1] == "nitrogenContent":
|
|
22
|
+
return 45.5
|
|
23
|
+
if args[0]["@id"] == "compostKgMass" and args[1] == "ANIMAL_MANURE":
|
|
24
|
+
return False
|
|
25
|
+
return True
|
|
26
|
+
|
|
27
|
+
|
|
16
28
|
@patch(f"{CLASS_PATH}.download_hestia", side_effect=lambda id, *args: TERM_BY_ID[id])
|
|
17
29
|
@patch(f"{CLASS_PATH}.related_cycles")
|
|
18
30
|
def test_should_run(mock_related_cycles, *args):
|
|
@@ -100,17 +112,26 @@ def test_should_run(mock_related_cycles, *args):
|
|
|
100
112
|
}]
|
|
101
113
|
|
|
102
114
|
|
|
115
|
+
@pytest.mark.parametrize(
|
|
116
|
+
"test_name,fixture_path",
|
|
117
|
+
[
|
|
118
|
+
("Example 1", f"{fixtures_folder}/inputs/example1"),
|
|
119
|
+
("Example 2", f"{fixtures_folder}/inputs/example2"),
|
|
120
|
+
("Example 3", f"{fixtures_folder}/inputs/example3")
|
|
121
|
+
]
|
|
122
|
+
)
|
|
103
123
|
@patch(f"{CLASS_PATH}.download_hestia", side_effect=lambda id, *args: TERM_BY_ID[id])
|
|
104
124
|
@patch(f"{CLASS_PATH}.related_cycles")
|
|
105
|
-
|
|
106
|
-
|
|
125
|
+
@patch(f"{CLASS_PATH}._get_lookup_with_debug", side_effect=lookup_side_effect)
|
|
126
|
+
def test_run(mock_get_lookup_with_debug, mock_related_cycles, mock_download, test_name, fixture_path):
|
|
127
|
+
with open(f"{fixture_path}/cycles.jsonld", encoding='utf-8') as f:
|
|
107
128
|
cycles = json.load(f)
|
|
108
129
|
mock_related_cycles.return_value = cycles
|
|
109
130
|
|
|
110
131
|
with open(f"{fixtures_folder}/site.jsonld", encoding='utf-8') as f:
|
|
111
132
|
site = json.load(f)
|
|
112
133
|
|
|
113
|
-
with open(f"{
|
|
134
|
+
with open(f"{fixture_path}/result.jsonld", encoding='utf-8') as f:
|
|
114
135
|
expected = json.load(f)
|
|
115
136
|
|
|
116
137
|
result = run(site)
|
|
@@ -79,12 +79,12 @@ def test_harmonise_measurements(measurements_list, returns_dict, expected_value)
|
|
|
79
79
|
(
|
|
80
80
|
"missing dates => run",
|
|
81
81
|
{
|
|
82
|
-
"measurements":
|
|
83
|
-
[
|
|
82
|
+
"measurements": [
|
|
84
83
|
{
|
|
85
84
|
"term": {"@id": "clayContent"},
|
|
86
85
|
"depthUpper": 0,
|
|
87
|
-
"depthLower": 20
|
|
86
|
+
"depthLower": 20,
|
|
87
|
+
"value": [0]
|
|
88
88
|
}
|
|
89
89
|
]
|
|
90
90
|
},
|
|
@@ -93,29 +93,43 @@ def test_harmonise_measurements(measurements_list, returns_dict, expected_value)
|
|
|
93
93
|
(
|
|
94
94
|
"no depthUpper => no run",
|
|
95
95
|
{
|
|
96
|
-
"measurements":
|
|
97
|
-
|
|
98
|
-
{
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
96
|
+
"measurements": [
|
|
97
|
+
{
|
|
98
|
+
"term": {"@id": "clayContent"},
|
|
99
|
+
"dates": ["2022-01-02"],
|
|
100
|
+
"depthLower": 20,
|
|
101
|
+
"value": [0]
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
False
|
|
106
|
+
),
|
|
107
|
+
(
|
|
108
|
+
"missing value => not run",
|
|
109
|
+
{
|
|
110
|
+
"measurements": [
|
|
111
|
+
{
|
|
112
|
+
"term": {"@id": "clayContent"},
|
|
113
|
+
"dates": ["2022-01-02"],
|
|
114
|
+
"depthUpper": 0,
|
|
115
|
+
"depthLower": 20
|
|
116
|
+
}
|
|
117
|
+
]
|
|
104
118
|
},
|
|
105
119
|
False
|
|
106
120
|
),
|
|
107
121
|
(
|
|
108
122
|
"all fields => run",
|
|
109
123
|
{
|
|
110
|
-
"measurements":
|
|
111
|
-
|
|
112
|
-
{
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
124
|
+
"measurements": [
|
|
125
|
+
{
|
|
126
|
+
"term": {"@id": "clayContent"},
|
|
127
|
+
"dates": ["2022-01-02"],
|
|
128
|
+
"depthUpper": 0,
|
|
129
|
+
"depthLower": 20,
|
|
130
|
+
"value": [0]
|
|
131
|
+
}
|
|
132
|
+
]
|
|
119
133
|
},
|
|
120
134
|
True
|
|
121
135
|
)
|
|
@@ -141,7 +155,12 @@ def lookup_side_effect(*args, **kwargs):
|
|
|
141
155
|
@pytest.mark.parametrize(
|
|
142
156
|
"test_name",
|
|
143
157
|
[
|
|
144
|
-
"
|
|
158
|
+
"missing-depth",
|
|
159
|
+
"missing-value",
|
|
160
|
+
"simple-soilPh",
|
|
161
|
+
"clayContent",
|
|
162
|
+
"non-unique-measurements",
|
|
163
|
+
"arrays"
|
|
145
164
|
]
|
|
146
165
|
)
|
|
147
166
|
@patch(f"{class_path}._new_measurement", side_effect=fake_new_measurement)
|
tests/models/utils/test_term.py
CHANGED
|
@@ -4,7 +4,7 @@ from hestia_earth.models.utils.term import (
|
|
|
4
4
|
get_liquid_fuel_terms, get_irrigation_terms, get_urea_terms, get_excreta_N_terms, get_excreta_VS_terms,
|
|
5
5
|
get_generic_crop, get_rice_paddy_terms, get_tillage_terms, get_crop_residue_terms, get_cover_crop_property_terms,
|
|
6
6
|
get_crop_residue_incorporated_or_left_on_field_terms, get_irrigated_terms, get_residue_removed_or_burnt_terms,
|
|
7
|
-
get_upland_rice_land_cover_terms, get_upland_rice_crop_terms
|
|
7
|
+
get_upland_rice_land_cover_terms, get_upland_rice_crop_terms
|
|
8
8
|
)
|
|
9
9
|
|
|
10
10
|
class_path = 'hestia_earth.models.utils.term'
|
|
@@ -113,10 +113,3 @@ def test_get_upland_rice_crop_terms(mock_find_node):
|
|
|
113
113
|
id = 'term-id'
|
|
114
114
|
mock_find_node.return_value = [{'@id': id}]
|
|
115
115
|
assert get_upland_rice_crop_terms() == [id]
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
@patch(f"{class_path}.search")
|
|
119
|
-
def test_get_long_fallow_land_cover_terms(mock_find_node):
|
|
120
|
-
id = 'term-id'
|
|
121
|
-
mock_find_node.return_value = [{'@id': id}]
|
|
122
|
-
assert get_long_fallow_land_cover_terms() == [id]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|