hestia-earth-models 0.59.1__py3-none-any.whl → 0.59.3__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/irrigatedTypeUnspecified.py +6 -7
- hestia_earth/models/impact_assessment/irrigated.py +4 -1
- hestia_earth/models/ipcc2006/n2OToAirCropResidueDecompositionDirect.py +83 -0
- hestia_earth/models/ipcc2006/n2OToAirCropResidueDecompositionIndirect.py +3 -3
- hestia_earth/models/ipcc2006/n2OToAirExcretaIndirect.py +3 -3
- hestia_earth/models/ipcc2006/n2OToAirInorganicFertiliserIndirect.py +5 -4
- hestia_earth/models/ipcc2006/n2OToAirOrganicFertiliserIndirect.py +5 -4
- hestia_earth/models/ipcc2006/utils.py +12 -16
- hestia_earth/models/ipcc2019/n2OToAirCropResidueDecompositionDirect.py +8 -7
- hestia_earth/models/ipcc2019/n2OToAirCropResidueDecompositionIndirect.py +100 -0
- hestia_earth/models/ipcc2019/n2OToAirExcretaIndirect.py +100 -0
- hestia_earth/models/ipcc2019/n2OToAirInorganicFertiliserIndirect.py +54 -61
- hestia_earth/models/ipcc2019/n2OToAirOrganicFertiliserIndirect.py +58 -66
- hestia_earth/models/ipcc2019/nh3ToAirInorganicFertiliser.py +112 -0
- hestia_earth/models/ipcc2019/nh3ToAirOrganicFertiliser.py +107 -0
- hestia_earth/models/ipcc2019/noxToAirInorganicFertiliser.py +112 -0
- hestia_earth/models/ipcc2019/noxToAirOrganicFertiliser.py +107 -0
- hestia_earth/models/ipcc2019/organicCarbonPerHa.py +67 -21
- hestia_earth/models/ipcc2019/utils.py +28 -16
- hestia_earth/models/site/soilMeasurement.py +197 -0
- hestia_earth/models/utils/cycle.py +7 -6
- hestia_earth/models/utils/emission.py +15 -0
- hestia_earth/models/version.py +1 -1
- {hestia_earth_models-0.59.1.dist-info → hestia_earth_models-0.59.3.dist-info}/METADATA +1 -1
- {hestia_earth_models-0.59.1.dist-info → hestia_earth_models-0.59.3.dist-info}/RECORD +40 -24
- tests/models/ipcc2006/test_n2OToAirCropResidueDecompositionDirect.py +50 -0
- tests/models/ipcc2019/test_n2OToAirCropResidueDecompositionIndirect.py +71 -0
- tests/models/ipcc2019/test_n2OToAirExcretaIndirect.py +71 -0
- tests/models/ipcc2019/test_n2OToAirInorganicFertiliserIndirect.py +36 -13
- tests/models/ipcc2019/test_n2OToAirOrganicFertiliserIndirect.py +36 -13
- tests/models/ipcc2019/test_nh3ToAirInorganicFertiliser.py +47 -0
- tests/models/ipcc2019/test_nh3ToAirOrganicFertiliser.py +35 -0
- tests/models/ipcc2019/test_noxToAirInorganicFertiliser.py +47 -0
- tests/models/ipcc2019/test_noxToAirOrganicFertiliser.py +35 -0
- tests/models/ipcc2019/test_organicCarbonPerHa.py +51 -5
- tests/models/site/test_soilMeasurement.py +159 -0
- tests/models/utils/test_blank_node.py +5 -5
- {hestia_earth_models-0.59.1.dist-info → hestia_earth_models-0.59.3.dist-info}/LICENSE +0 -0
- {hestia_earth_models-0.59.1.dist-info → hestia_earth_models-0.59.3.dist-info}/WHEEL +0 -0
- {hestia_earth_models-0.59.1.dist-info → hestia_earth_models-0.59.3.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=CbLC-bytMU-XpY8CM5H7SMZR8Ap_SRMUQNvt55nruo0,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
|
|
@@ -44,7 +44,7 @@ hestia_earth/models/cycle/excretaKgMass.py,sha256=iA8Kfl3WvyxbQpx1QOGPQZ9O_Pc5rj
|
|
|
44
44
|
hestia_earth/models/cycle/excretaKgN.py,sha256=mgJTneQIYJ9Su-rTK5ppb_k3YhICFNWsfPZtGR98RI0,2968
|
|
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
|
-
hestia_earth/models/cycle/irrigatedTypeUnspecified.py,sha256=
|
|
47
|
+
hestia_earth/models/cycle/irrigatedTypeUnspecified.py,sha256=KlIa5eDvT47Twz6Q1kpw0rMlRjCK25CExaW58DEvc9w,2125
|
|
48
48
|
hestia_earth/models/cycle/liveAnimal.py,sha256=orJz6ZN3bbGNzU9s5xsTk3u8K4ntPSv1_PyG0Nwslh8,3934
|
|
49
49
|
hestia_earth/models/cycle/milkYield.py,sha256=RGaD5RtinMTsu6p49YUgr5z1NAVgCNFNPmwWa_Wrk3Q,5718
|
|
50
50
|
hestia_earth/models/cycle/pastureGrass.py,sha256=7PrmDMJPtsbKGa8WIOh_4NXNtbH3Pxb23pmjawQuY9o,1226
|
|
@@ -176,7 +176,7 @@ hestia_earth/models/impact_assessment/__init__.py,sha256=gTR_PhWps593fPhm-V826VL
|
|
|
176
176
|
hestia_earth/models/impact_assessment/emissions.py,sha256=zRQd17joMqij8mjRcrY9LssHgwzsYC5bkoy7iGdjj-Q,3429
|
|
177
177
|
hestia_earth/models/impact_assessment/freshwaterWithdrawalsDuringCycle.py,sha256=wvNwABEh4blgm95G9y_yorMNEjyYsq4MZiFggkPRuIE,3932
|
|
178
178
|
hestia_earth/models/impact_assessment/freshwaterWithdrawalsInputsProduction.py,sha256=DSLX_aEWaUFcFZRD46bG5lIQ4TtAtIqH-sMkVCJH2Dg,990
|
|
179
|
-
hestia_earth/models/impact_assessment/irrigated.py,sha256=
|
|
179
|
+
hestia_earth/models/impact_assessment/irrigated.py,sha256=qopAYbD91uu1Q2hJ3aB5Xl3br2Nzh7LoMTRCFOXmOv0,783
|
|
180
180
|
hestia_earth/models/impact_assessment/landOccupationInputsProduction.py,sha256=SggB_4tpiKNeb6TIQWBm-X9VwG4pzLoyHdK8JroRIsE,576
|
|
181
181
|
hestia_earth/models/impact_assessment/landTransformationFromCropland100YearAverageInputsProduction.py,sha256=jxeJS8r1qYIoyeEE-MGKbldEDL3x9CG8aIb4JdcUnj4,1036
|
|
182
182
|
hestia_earth/models/impact_assessment/landTransformationFromCropland20YearAverageInputsProduction.py,sha256=vluuIcr1jYhs11oz7nANk2qUuUVPy5uNkvpfMv_M4LE,1034
|
|
@@ -202,15 +202,16 @@ hestia_earth/models/ipcc2006/aboveGroundCropResidueRemoved.py,sha256=6FDgMH5eiO1
|
|
|
202
202
|
hestia_earth/models/ipcc2006/aboveGroundCropResidueTotal.py,sha256=vD_kpvOJmjTOjDEnlqSYBSZxjuPGvzpmCr0JIC84GKE,3431
|
|
203
203
|
hestia_earth/models/ipcc2006/belowGroundCropResidue.py,sha256=KzeRphJb1IWB_EPVcxa9tbCoNmEe80D9lKxgQOqfKoU,4138
|
|
204
204
|
hestia_earth/models/ipcc2006/co2ToAirOrganicSoilCultivation.py,sha256=8AzFuqRprk6o-uyyI3XYsTGl2dP_ALgYJXWCseYEBQ8,3029
|
|
205
|
-
hestia_earth/models/ipcc2006/
|
|
205
|
+
hestia_earth/models/ipcc2006/n2OToAirCropResidueDecompositionDirect.py,sha256=_2oTngpspikbFwgFTtOWs-SgEVF8LzznvITGITTtol4,2913
|
|
206
|
+
hestia_earth/models/ipcc2006/n2OToAirCropResidueDecompositionIndirect.py,sha256=kf4WjdMzs6d8h433LFuUH9LJKJ_aMHTqEHDToGY5-Xk,2315
|
|
206
207
|
hestia_earth/models/ipcc2006/n2OToAirExcretaDirect.py,sha256=VvQTIh58JyhrdPk5FdJQBkjBDr5-Cv7CnGkNEcco3P4,1986
|
|
207
|
-
hestia_earth/models/ipcc2006/n2OToAirExcretaIndirect.py,sha256=
|
|
208
|
+
hestia_earth/models/ipcc2006/n2OToAirExcretaIndirect.py,sha256=me1MLX2WI5A_VZ11774CRxwRC6seOaxgMg_GGYCckIk,2243
|
|
208
209
|
hestia_earth/models/ipcc2006/n2OToAirInorganicFertiliserDirect.py,sha256=hhFioTDxWZ2g_SjDt0k5tq6P8AJrq48i65qUpAfW_sU,2144
|
|
209
|
-
hestia_earth/models/ipcc2006/n2OToAirInorganicFertiliserIndirect.py,sha256=
|
|
210
|
+
hestia_earth/models/ipcc2006/n2OToAirInorganicFertiliserIndirect.py,sha256=MNFyXPCLX_RqfRQkO0UzVIYVevpEBO3R2uh3sIoIycM,2863
|
|
210
211
|
hestia_earth/models/ipcc2006/n2OToAirOrganicFertiliserDirect.py,sha256=MZUmA3ajGkpi4wr020OU6m4WJdujjKkRhUVsbPgUVb8,2094
|
|
211
|
-
hestia_earth/models/ipcc2006/n2OToAirOrganicFertiliserIndirect.py,sha256=
|
|
212
|
+
hestia_earth/models/ipcc2006/n2OToAirOrganicFertiliserIndirect.py,sha256=pgNG18EwgTA7kmVw9QFtucMn8ScVeEKJAsSPxcExbI8,2801
|
|
212
213
|
hestia_earth/models/ipcc2006/n2OToAirOrganicSoilCultivationDirect.py,sha256=0J6ntZxYyLg3pUQeSQelDe36fb0nQtbMLjIBtwzHUyc,3038
|
|
213
|
-
hestia_earth/models/ipcc2006/utils.py,sha256=
|
|
214
|
+
hestia_earth/models/ipcc2006/utils.py,sha256=flB7HWrynzOorKlmrpbETGD63NMv45H8Wxjj3RCav98,739
|
|
214
215
|
hestia_earth/models/ipcc2013ExcludingFeedbacks/__init__.py,sha256=v4Qe-X4w3tqIHGJBNnEAK81x4ZuQMwYxQYXRncugmcU,427
|
|
215
216
|
hestia_earth/models/ipcc2013ExcludingFeedbacks/gwp100.py,sha256=8VRg-Vvzc86_CQmBH-iHNhaSnAFHew2swAMecT0aXW4,979
|
|
216
217
|
hestia_earth/models/ipcc2013IncludingFeedbacks/__init__.py,sha256=VJ16KIGQQHybzZiTvu3mpZy_3j0xcd06RHHCfPrCMgU,427
|
|
@@ -227,20 +228,26 @@ hestia_earth/models/ipcc2019/co2ToAirSoilCarbonStockChangeManagementChange.py,sh
|
|
|
227
228
|
hestia_earth/models/ipcc2019/co2ToAirUreaHydrolysis.py,sha256=ICE3r8GMoHj6WfMUxQdqdejRpOLa3cxDMyF3GvSTW0U,3700
|
|
228
229
|
hestia_earth/models/ipcc2019/croppingDuration.py,sha256=_jlFrTNDOARH2_g8s4dzuaCoLHSX2BHzSQd3uuQN32Y,3173
|
|
229
230
|
hestia_earth/models/ipcc2019/ligninContent.py,sha256=wp5EbCthCDAKyvPBfZULS9-uKEY58TQQ8ey1pf-juv8,7267
|
|
230
|
-
hestia_earth/models/ipcc2019/n2OToAirCropResidueDecompositionDirect.py,sha256=
|
|
231
|
+
hestia_earth/models/ipcc2019/n2OToAirCropResidueDecompositionDirect.py,sha256=Fand7NbT27unwgFTxi_9NxT024s63vQ7U6-tk9yp3d8,3990
|
|
232
|
+
hestia_earth/models/ipcc2019/n2OToAirCropResidueDecompositionIndirect.py,sha256=_Oj6Jw8F4rce7FmhWkzeqyB7W3ZQWpOiA10p6xrfSwc,3777
|
|
231
233
|
hestia_earth/models/ipcc2019/n2OToAirExcretaDirect.py,sha256=9rpp5NvFZOGRSnkfLhBoMqArdzKSd4fH-fgQEnbTT4I,1722
|
|
234
|
+
hestia_earth/models/ipcc2019/n2OToAirExcretaIndirect.py,sha256=4TfJg5OhTnj_ulW-IH8Jz1hMRB0zKMQdh0vBZKL6nqg,3650
|
|
232
235
|
hestia_earth/models/ipcc2019/n2OToAirInorganicFertiliserDirect.py,sha256=NfS6EiEVSf-hpWHqO3r-1PKPuHPVb6ijTNLTbOlRCp0,4062
|
|
233
|
-
hestia_earth/models/ipcc2019/n2OToAirInorganicFertiliserIndirect.py,sha256=
|
|
236
|
+
hestia_earth/models/ipcc2019/n2OToAirInorganicFertiliserIndirect.py,sha256=iNjwTyktLqD0HpwfwAEnAHbQUDNQmT7ekONF_lJobzE,3715
|
|
234
237
|
hestia_earth/models/ipcc2019/n2OToAirOrganicFertiliserDirect.py,sha256=pMyl6UtUVgPWfczgA_cdm1RUdMGi4Ln16qWrw1eesv4,4138
|
|
235
|
-
hestia_earth/models/ipcc2019/n2OToAirOrganicFertiliserIndirect.py,sha256=
|
|
238
|
+
hestia_earth/models/ipcc2019/n2OToAirOrganicFertiliserIndirect.py,sha256=9YbaR8h7P-4rLHgcwtDLnQ_hT7cKzyELjCVJ9lWV2jI,3701
|
|
239
|
+
hestia_earth/models/ipcc2019/nh3ToAirInorganicFertiliser.py,sha256=IASHAUO_tV043qLxll9M7Bp9WM5N290lkmkh1yQr-1U,4226
|
|
240
|
+
hestia_earth/models/ipcc2019/nh3ToAirOrganicFertiliser.py,sha256=mPAoC6mRc4F7bXRt02JQWqhJvds-bEIEnk2XbdJzmEU,3911
|
|
236
241
|
hestia_earth/models/ipcc2019/nitrogenContent.py,sha256=6fGG7diDp9zAidVH75gXz9c8uxURx0Q2COo8KrkT3I4,7191
|
|
237
242
|
hestia_earth/models/ipcc2019/no3ToGroundwaterCropResidueDecomposition.py,sha256=8NOjbqJuQ-wnLz3bYmwaygSzKBdaF3N7hoELGNnO4YQ,3115
|
|
238
243
|
hestia_earth/models/ipcc2019/no3ToGroundwaterExcreta.py,sha256=mJUXLGtg9EOZq9LH0KFOKvzER1ypCUucs0ZMaNYMShc,2991
|
|
239
244
|
hestia_earth/models/ipcc2019/no3ToGroundwaterInorganicFertiliser.py,sha256=wTvMBthqmiKMn4nLbL4VD6_8_gGI2WGR3OYz3KK8sXs,3105
|
|
240
245
|
hestia_earth/models/ipcc2019/no3ToGroundwaterOrganicFertiliser.py,sha256=zOhp6NhYUuUNU_LMMwhZBP78YC2XRWRlGnajBUX2AN8,3095
|
|
241
|
-
hestia_earth/models/ipcc2019/
|
|
246
|
+
hestia_earth/models/ipcc2019/noxToAirInorganicFertiliser.py,sha256=D-UyzY55mOiIcXRzEtvPY-r1bDFgb9YqA08SmHsQeNA,4226
|
|
247
|
+
hestia_earth/models/ipcc2019/noxToAirOrganicFertiliser.py,sha256=SVgVNp76bIv9oUjrZZuI6xYLo4Gw2DRU5tbp14gydOE,3911
|
|
248
|
+
hestia_earth/models/ipcc2019/organicCarbonPerHa.py,sha256=9zWmAolHbFuvw2dxK4zZ8bW-1VDy7j44DYPmspJ0U-M,142577
|
|
242
249
|
hestia_earth/models/ipcc2019/pastureGrass.py,sha256=CpDEtdnbKd_8eaDLcflJ-dGik3t879HIoEIzuaHNmC0,23168
|
|
243
|
-
hestia_earth/models/ipcc2019/utils.py,sha256=
|
|
250
|
+
hestia_earth/models/ipcc2019/utils.py,sha256=MSDMu15D9DnilFUgi4_6jYXC0FaKso3OODauGTMB6hs,6229
|
|
244
251
|
hestia_earth/models/ipcc2021/__init__.py,sha256=VTgGFKhwMmk_nuI1RRq0in27fHYVPBonlXlPK00K8no,409
|
|
245
252
|
hestia_earth/models/ipcc2021/gwp100.py,sha256=v-DYU-11XnWI1Ns1GEiKrJqL3JafxvhTsLmuBuFcxJU,1021
|
|
246
253
|
hestia_earth/models/jarvisAndPain1994/__init__.py,sha256=ercUwy29sV7oPIESj8UjsGB5lqiBCss9OZcbjxeeG8E,418
|
|
@@ -447,6 +454,7 @@ hestia_earth/models/site/precipitationAnnual.py,sha256=to14BEFjUaYyCu5aIBQZtuaIr
|
|
|
447
454
|
hestia_earth/models/site/precipitationMonthly.py,sha256=yGUbiUCu1Prp3qVHuZodGrcfrbYu170WTUGyaj-KEjY,1896
|
|
448
455
|
hestia_earth/models/site/rainfallAnnual.py,sha256=Ix_B8Ny7IIRkJ_3lUvoHOjPgqCyR9I0U3_ADUUtMqsY,2003
|
|
449
456
|
hestia_earth/models/site/rainfallMonthly.py,sha256=2Uo8F-YxnTK0_txlHmiAyVp1bGfWD4bneRKyg4tdQkI,1881
|
|
457
|
+
hestia_earth/models/site/soilMeasurement.py,sha256=pFh7-lpcBrvpOZ071XhadpuK_5AoywIFaekRfGosY5U,7839
|
|
450
458
|
hestia_earth/models/site/temperatureAnnual.py,sha256=Q3b1RH2_hpA0JWwOYA5nKgMGcXHjV8-akXT9vB0cbwc,2012
|
|
451
459
|
hestia_earth/models/site/temperatureMonthly.py,sha256=yXwpFCGT2tUqvVBNedaPyBmN_KlzZqo5yv2TWem1pBk,1890
|
|
452
460
|
hestia_earth/models/site/totalNitrogenPerKgSoil.py,sha256=8ERrTZpN_yCRUyFg_EYaX4abE9jLcyX3lx3MO4Bi6CE,1938
|
|
@@ -501,9 +509,9 @@ hestia_earth/models/utils/crop.py,sha256=S8UycHpkgx_TznW3Q7pchEMlCQ623T_SqU6V5fB
|
|
|
501
509
|
hestia_earth/models/utils/cropResidue.py,sha256=_0Q35CrliJeo31xGHsPWe8A2oHxijdIsOrf3gBEqhlA,612
|
|
502
510
|
hestia_earth/models/utils/cropResidueManagement.py,sha256=nIDFjf39rDD10UHSVudfDyu-EiL261g8jyrgS-2aDKw,347
|
|
503
511
|
hestia_earth/models/utils/currency.py,sha256=f_ArJANb--pZq4LL49SXQ1AMX_oKroqwBXKRRQqZwsM,578
|
|
504
|
-
hestia_earth/models/utils/cycle.py,sha256=
|
|
512
|
+
hestia_earth/models/utils/cycle.py,sha256=F5dykDeHJfnSm6m7YCqQT3Ip3OZsAB-oipbKwbvslBE,16647
|
|
505
513
|
hestia_earth/models/utils/ecoClimateZone.py,sha256=NHFt-A9EiWXC6tUNIxkgOWUZOjj4I4uwJIP9ddDZegw,1112
|
|
506
|
-
hestia_earth/models/utils/emission.py,sha256=
|
|
514
|
+
hestia_earth/models/utils/emission.py,sha256=AVp-ngrb4VHYT8BG1QA5EEb17edT3cLonsXV3cNm04U,1576
|
|
507
515
|
hestia_earth/models/utils/excretaManagement.py,sha256=NuWPQjFZxMVt9sYgBjcqhGWCFk_OKb3sA9Ovcff3fRQ,428
|
|
508
516
|
hestia_earth/models/utils/feedipedia.py,sha256=fqlpAwG_jbZAFPWJ-yUI7gwn0oq--1GLTlHLsCeBbPQ,3181
|
|
509
517
|
hestia_earth/models/utils/fuel.py,sha256=r1MKMMxg-PYiVlRutP83RuvY2rsdCQ1iN6ekSGGQGpA,1379
|
|
@@ -719,6 +727,7 @@ tests/models/ipcc2006/test_aboveGroundCropResidueRemoved.py,sha256=5F7eU4qWYfTZA
|
|
|
719
727
|
tests/models/ipcc2006/test_aboveGroundCropResidueTotal.py,sha256=FrSR1xBTRtJ99pXAklXLtDRC00FSW1vXSAvQNeBoXTQ,1725
|
|
720
728
|
tests/models/ipcc2006/test_belowGroundCropResidue.py,sha256=cFqLDFy5pcgOyzKC9l-RClEP6CWCdVNnq48S90SITVM,1720
|
|
721
729
|
tests/models/ipcc2006/test_co2ToAirOrganicSoilCultivation.py,sha256=wM1BYFcK28aiNVP6JUEWdc90kCd3w4rjOnpxzwuYV_o,1609
|
|
730
|
+
tests/models/ipcc2006/test_n2OToAirCropResidueDecompositionDirect.py,sha256=rmL8K9ToJa9SAO-kxSd8Zz3cl5bTWrDRDxsPAMMTmCo,1626
|
|
722
731
|
tests/models/ipcc2006/test_n2OToAirCropResidueDecompositionIndirect.py,sha256=cxn5rX_pZqbl7m8rhJARuyjG2P5O-BQbufeEcTmO06k,1357
|
|
723
732
|
tests/models/ipcc2006/test_n2OToAirExcretaDirect.py,sha256=tm6Lm90_4qEkCU6UIFsOD6yhrMrq69lkF1LvCjXPjE4,2132
|
|
724
733
|
tests/models/ipcc2006/test_n2OToAirExcretaIndirect.py,sha256=712I87Wkpp4KcHfHaK1kgfD6nfHGo3iZqKIwfMG9a6A,1282
|
|
@@ -744,17 +753,23 @@ tests/models/ipcc2019/test_co2ToAirUreaHydrolysis.py,sha256=MmtEME0xjsa3KojFk_fx
|
|
|
744
753
|
tests/models/ipcc2019/test_croppingDuration.py,sha256=gLRXeR6Tqa7ciD9KTRfsIflSeIIWT2iOpZMdcxAQla4,1871
|
|
745
754
|
tests/models/ipcc2019/test_ligninContent.py,sha256=eIKEN__ab-0R52EhlhPSBiHnmTl6xOf1XbI33O-W9A4,4146
|
|
746
755
|
tests/models/ipcc2019/test_n2OToAirCropResidueDecompositionDirect.py,sha256=lVfSKpVszGK42pzo2FefXNZRmXbqOt25IBcnxvhC_X0,2418
|
|
756
|
+
tests/models/ipcc2019/test_n2OToAirCropResidueDecompositionIndirect.py,sha256=it2PVNYBNAvQWmWLDJ9Evjqtx7SJl-X0ZyQz3Fuvb3k,2119
|
|
747
757
|
tests/models/ipcc2019/test_n2OToAirExcretaDirect.py,sha256=JYvBK4edcqfHrMPwgBFXF6km51ew9RISUcfQ_RNf2RY,1216
|
|
758
|
+
tests/models/ipcc2019/test_n2OToAirExcretaIndirect.py,sha256=z46L5JMB4-W0uCyyFlLKTEyDnt2gUHRkH7dEXK6ioHk,2098
|
|
748
759
|
tests/models/ipcc2019/test_n2OToAirInorganicFertiliserDirect.py,sha256=ffk-aom1BqyEmqm-JESWX5MErrAVAgVuH1gjW32U5Pk,2407
|
|
749
|
-
tests/models/ipcc2019/test_n2OToAirInorganicFertiliserIndirect.py,sha256=
|
|
760
|
+
tests/models/ipcc2019/test_n2OToAirInorganicFertiliserIndirect.py,sha256=RnU8CkUCYBBO1bgJALnoVgjTHLL1L1sja2nsyeVA_cg,2113
|
|
750
761
|
tests/models/ipcc2019/test_n2OToAirOrganicFertiliserDirect.py,sha256=XQpzdEFT7qSw6KKRYEZ6Cmzkc_xLyG98FHH1PSfOUo0,2403
|
|
751
|
-
tests/models/ipcc2019/test_n2OToAirOrganicFertiliserIndirect.py,sha256=
|
|
762
|
+
tests/models/ipcc2019/test_n2OToAirOrganicFertiliserIndirect.py,sha256=hW84sTlhB8mKRSFJX_iQS4gYo74zCtY-9zr1VHLC5GU,2111
|
|
763
|
+
tests/models/ipcc2019/test_nh3ToAirInorganicFertiliser.py,sha256=xmRHSTmyh--EZX29Z5NHD4LqEZl7Lkc5HntBCXlIRHE,1537
|
|
764
|
+
tests/models/ipcc2019/test_nh3ToAirOrganicFertiliser.py,sha256=Z4a20I2UnZdzm6FqHnlHRXXVCY993_SHT7nG-zAhx-c,1104
|
|
752
765
|
tests/models/ipcc2019/test_nitrogenContent.py,sha256=rKl_05PCC0OSsAhG0cHJOqnt9LsCaFnRpJorkm1TShA,3704
|
|
753
766
|
tests/models/ipcc2019/test_no3ToGroundwaterCropResidueDecomposition.py,sha256=4__3HDUDWt5KjQGcXEFXHBgP_jT0rxvIzpBLH_mP9WE,1729
|
|
754
767
|
tests/models/ipcc2019/test_no3ToGroundwaterExcreta.py,sha256=Z-pCBQvlUf0ttmCERgezW-6e3KlX45YEVccOwthf5lU,1588
|
|
755
768
|
tests/models/ipcc2019/test_no3ToGroundwaterInorganicFertiliser.py,sha256=e7REnQ9r9a8xroq5aPp0NIzmkad_6MyTuceRTYoKdkE,1613
|
|
756
769
|
tests/models/ipcc2019/test_no3ToGroundwaterOrganicFertiliser.py,sha256=e1ZViD12qB3bLdH3TJw3GbBP8iqMen-UJbcFkytb3VQ,1609
|
|
757
|
-
tests/models/ipcc2019/
|
|
770
|
+
tests/models/ipcc2019/test_noxToAirInorganicFertiliser.py,sha256=NZBSBJLM_j2PEpHRON2ysgKNF8x5sHfQVoAKQdGsfzk,1537
|
|
771
|
+
tests/models/ipcc2019/test_noxToAirOrganicFertiliser.py,sha256=LR5pjV5vRbgSSQAw8kYRp_ij4CHInzgaDS6EggQuBiw,1104
|
|
772
|
+
tests/models/ipcc2019/test_organicCarbonPerHa.py,sha256=g6EYKDiotsmod8zup2316g3auvy3cdGncaZ_2rO03Fg,21876
|
|
758
773
|
tests/models/ipcc2019/test_pastureGrass.py,sha256=pE4PWdR541v4xWDYihP7Dou8V1iqg5GwD5_rjGRzrds,2292
|
|
759
774
|
tests/models/ipcc2021/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
760
775
|
tests/models/ipcc2021/test_gwp100.py,sha256=JRklKMSg-OXopb9ZufGgl94deuMuJSsfNXRZDBtOZrE,1119
|
|
@@ -956,6 +971,7 @@ tests/models/site/test_precipitationAnnual.py,sha256=h0tXvykZw4Zaw225RHfvw-3DvAy
|
|
|
956
971
|
tests/models/site/test_precipitationMonthly.py,sha256=iccr-_ZrseM_OT3AKZbTNQhRFSIe-R6wXTDS-2wIVew,995
|
|
957
972
|
tests/models/site/test_rainfallAnnual.py,sha256=4YYna66qjJptPJ_URvdcQuRC3dri9SB0xmWP8DFwslM,986
|
|
958
973
|
tests/models/site/test_rainfallMonthly.py,sha256=A3gIe2Yxt9CLtLcAJNCQ0-8aRB49VdfKBLBy-7eDgJw,985
|
|
974
|
+
tests/models/site/test_soilMeasurement.py,sha256=yXOG0EKyk57NvIqVDIohjZRubQ4aJoLw63Nwi6H54r8,4445
|
|
959
975
|
tests/models/site/test_temperatureAnnual.py,sha256=nOJG9ZJ8NCMM8T47uxxBeloIYLFN6-xtvUBqJsqt8xk,992
|
|
960
976
|
tests/models/site/test_temperatureMonthly.py,sha256=C2lv-lpYqH7VUGOlxNLE6d7k_dFS6NYe8BvMlrJorCw,991
|
|
961
977
|
tests/models/site/test_totalNitrogenPerKgSoil.py,sha256=2ILrA0jQKGniiKwS5FF3ZLtudgUgjcMnzFtrHpJKPTc,1161
|
|
@@ -997,7 +1013,7 @@ tests/models/transformation/product/test_excreta.py,sha256=Q9OQpk8qVPv3alIz2i5XQ
|
|
|
997
1013
|
tests/models/usetoxV2/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
998
1014
|
tests/models/usetoxV2/test_freshwaterEcotoxicityPotentialCtue.py,sha256=eq7Gcmfya9g0eOKKkuBhz8vq7xi_CmZ_LTSxueBwZt4,835
|
|
999
1015
|
tests/models/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
1000
|
-
tests/models/utils/test_blank_node.py,sha256=
|
|
1016
|
+
tests/models/utils/test_blank_node.py,sha256=T1-JRrWcK6oFavYAEy7gt2iojnTdNgoX2WDc08-4h-I,31333
|
|
1001
1017
|
tests/models/utils/test_cropResidueManagement.py,sha256=RQt8lexeJzCyxZceIutgDpw7BpcqmjsUB0C0yZC2QpY,930
|
|
1002
1018
|
tests/models/utils/test_currency.py,sha256=BPsojPsY9QW2aj8vgbjkPQXU8GU6wDwwtPZ3HdC4KTU,277
|
|
1003
1019
|
tests/models/utils/test_cycle.py,sha256=evTHH73ftNVhv5vHlYE2973msKE4pSCd3D0GfX1ZPUA,465
|
|
@@ -1017,8 +1033,8 @@ tests/models/utils/test_source.py,sha256=mv3vHZV5cjpoLA2I1109-YUkuzAiuhbRSnv_76_
|
|
|
1017
1033
|
tests/models/utils/test_term.py,sha256=JJmzyHnhVGeQ7tG-T6DjE7CoIJPH0guH-y2kjGeZiJY,3756
|
|
1018
1034
|
tests/models/webbEtAl2012AndSintermannEtAl2012/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
1019
1035
|
tests/models/webbEtAl2012AndSintermannEtAl2012/test_nh3ToAirOrganicFertiliser.py,sha256=qi2FNXS5Af2WDtm7nq_FsprH3BfCF0XxnE0XHmC4aIY,2244
|
|
1020
|
-
hestia_earth_models-0.59.
|
|
1021
|
-
hestia_earth_models-0.59.
|
|
1022
|
-
hestia_earth_models-0.59.
|
|
1023
|
-
hestia_earth_models-0.59.
|
|
1024
|
-
hestia_earth_models-0.59.
|
|
1036
|
+
hestia_earth_models-0.59.3.dist-info/LICENSE,sha256=EFSZhfUdZCTsCIYdHzTGewMKfRfp7X9t1s2aaKxm8O0,1154
|
|
1037
|
+
hestia_earth_models-0.59.3.dist-info/METADATA,sha256=gyNoaOgImXrijST_O_SKIa6sDSY9vSDOJA0716l11uU,3134
|
|
1038
|
+
hestia_earth_models-0.59.3.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
1039
|
+
hestia_earth_models-0.59.3.dist-info/top_level.txt,sha256=1dqA9TqpOLTEgpqa-YBsmbCmmNU1y56AtfFGEceZ2A0,19
|
|
1040
|
+
hestia_earth_models-0.59.3.dist-info/RECORD,,
|
|
@@ -0,0 +1,50 @@
|
|
|
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.ipcc2006.n2OToAirCropResidueDecompositionDirect 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}._is_term_type_complete", return_value=False)
|
|
12
|
+
@patch(f"{class_path}.get_crop_residue_decomposition_N_total", return_value=0)
|
|
13
|
+
def test_should_run(mock_N_total, mock_complete):
|
|
14
|
+
# no N => no run
|
|
15
|
+
should_run, *args = _should_run({})
|
|
16
|
+
assert not should_run
|
|
17
|
+
|
|
18
|
+
# with N => no run
|
|
19
|
+
mock_N_total.return_value = 10
|
|
20
|
+
should_run, *args = _should_run({})
|
|
21
|
+
assert not should_run
|
|
22
|
+
|
|
23
|
+
# is complete => run
|
|
24
|
+
mock_complete.return_value = True
|
|
25
|
+
should_run, *args = _should_run({})
|
|
26
|
+
assert should_run is True
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
@patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
|
|
30
|
+
def test_run(*args):
|
|
31
|
+
with open(f"{fixtures_folder}/cycle.jsonld", encoding='utf-8') as f:
|
|
32
|
+
cycle = json.load(f)
|
|
33
|
+
|
|
34
|
+
with open(f"{fixtures_folder}/result.jsonld", encoding='utf-8') as f:
|
|
35
|
+
expected = json.load(f)
|
|
36
|
+
|
|
37
|
+
value = run(cycle)
|
|
38
|
+
assert value == expected
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
@patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
|
|
42
|
+
def test_run_flooded_rice(*args):
|
|
43
|
+
with open(f"{fixtures_folder}/with-flooded-rice/cycle.jsonld", encoding='utf-8') as f:
|
|
44
|
+
cycle = json.load(f)
|
|
45
|
+
|
|
46
|
+
with open(f"{fixtures_folder}/with-flooded-rice/result.jsonld", encoding='utf-8') as f:
|
|
47
|
+
expected = json.load(f)
|
|
48
|
+
|
|
49
|
+
value = run(cycle)
|
|
50
|
+
assert value == expected
|
|
@@ -0,0 +1,71 @@
|
|
|
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.ipcc2019.n2OToAirCropResidueDecompositionIndirect import (
|
|
6
|
+
MODEL, TERM_ID, run, _should_run, NH3_TERM_ID, NO3_TERM_ID, NOX_TERM_ID
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
class_path = f"hestia_earth.models.{MODEL}.{TERM_ID}"
|
|
10
|
+
fixtures_folder = f"{fixtures_path}/{MODEL}/{TERM_ID}"
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def test_should_run():
|
|
14
|
+
# no emissions => no run
|
|
15
|
+
cycle = {'completeness': {'cropResidue': True}, 'emissions': []}
|
|
16
|
+
should_run, *args = _should_run(cycle)
|
|
17
|
+
assert not should_run
|
|
18
|
+
|
|
19
|
+
# with no3 emission => run
|
|
20
|
+
cycle['emissions'] = [
|
|
21
|
+
{
|
|
22
|
+
'term': {'@id': NO3_TERM_ID},
|
|
23
|
+
'value': [100]
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
'term': {'@id': NH3_TERM_ID},
|
|
27
|
+
'value': [100]
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
'term': {'@id': NOX_TERM_ID},
|
|
31
|
+
'value': [100]
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
should_run, *args = _should_run(cycle)
|
|
35
|
+
assert should_run is True
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
@patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
|
|
39
|
+
def test_run(*args):
|
|
40
|
+
with open(f"{fixtures_folder}/cycle.jsonld", encoding='utf-8') as f:
|
|
41
|
+
cycle = json.load(f)
|
|
42
|
+
|
|
43
|
+
with open(f"{fixtures_folder}/result.jsonld", encoding='utf-8') as f:
|
|
44
|
+
expected = json.load(f)
|
|
45
|
+
|
|
46
|
+
value = run(cycle)
|
|
47
|
+
assert value == expected
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
@patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
|
|
51
|
+
def test_run_wet(*args):
|
|
52
|
+
with open(f"{fixtures_folder}/ecoClimateZone-wet/cycle.jsonld", encoding='utf-8') as f:
|
|
53
|
+
cycle = json.load(f)
|
|
54
|
+
|
|
55
|
+
with open(f"{fixtures_folder}/ecoClimateZone-wet/result.jsonld", encoding='utf-8') as f:
|
|
56
|
+
expected = json.load(f)
|
|
57
|
+
|
|
58
|
+
value = run(cycle)
|
|
59
|
+
assert value == expected
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
@patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
|
|
63
|
+
def test_run_dry(*args):
|
|
64
|
+
with open(f"{fixtures_folder}/ecoClimateZone-dry/cycle.jsonld", encoding='utf-8') as f:
|
|
65
|
+
cycle = json.load(f)
|
|
66
|
+
|
|
67
|
+
with open(f"{fixtures_folder}/ecoClimateZone-dry/result.jsonld", encoding='utf-8') as f:
|
|
68
|
+
expected = json.load(f)
|
|
69
|
+
|
|
70
|
+
value = run(cycle)
|
|
71
|
+
assert value == expected
|
|
@@ -0,0 +1,71 @@
|
|
|
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.ipcc2019.n2OToAirExcretaIndirect import (
|
|
6
|
+
MODEL, TERM_ID, run, _should_run, NH3_TERM_ID, NO3_TERM_ID, NOX_TERM_ID
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
class_path = f"hestia_earth.models.{MODEL}.{TERM_ID}"
|
|
10
|
+
fixtures_folder = f"{fixtures_path}/{MODEL}/{TERM_ID}"
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def test_should_run():
|
|
14
|
+
# no emissions => no run
|
|
15
|
+
cycle = {'completeness': {'excreta': True}, 'emissions': []}
|
|
16
|
+
should_run, *args = _should_run(cycle)
|
|
17
|
+
assert not should_run
|
|
18
|
+
|
|
19
|
+
# with no3 emission => run
|
|
20
|
+
cycle['emissions'] = [
|
|
21
|
+
{
|
|
22
|
+
'term': {'@id': NO3_TERM_ID},
|
|
23
|
+
'value': [100]
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
'term': {'@id': NH3_TERM_ID},
|
|
27
|
+
'value': [100]
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
'term': {'@id': NOX_TERM_ID},
|
|
31
|
+
'value': [100]
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
should_run, *args = _should_run(cycle)
|
|
35
|
+
assert should_run is True
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
@patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
|
|
39
|
+
def test_run(*args):
|
|
40
|
+
with open(f"{fixtures_folder}/cycle.jsonld", encoding='utf-8') as f:
|
|
41
|
+
cycle = json.load(f)
|
|
42
|
+
|
|
43
|
+
with open(f"{fixtures_folder}/result.jsonld", encoding='utf-8') as f:
|
|
44
|
+
expected = json.load(f)
|
|
45
|
+
|
|
46
|
+
value = run(cycle)
|
|
47
|
+
assert value == expected
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
@patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
|
|
51
|
+
def test_run_wet(*args):
|
|
52
|
+
with open(f"{fixtures_folder}/ecoClimateZone-wet/cycle.jsonld", encoding='utf-8') as f:
|
|
53
|
+
cycle = json.load(f)
|
|
54
|
+
|
|
55
|
+
with open(f"{fixtures_folder}/ecoClimateZone-wet/result.jsonld", encoding='utf-8') as f:
|
|
56
|
+
expected = json.load(f)
|
|
57
|
+
|
|
58
|
+
value = run(cycle)
|
|
59
|
+
assert value == expected
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
@patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
|
|
63
|
+
def test_run_dry(*args):
|
|
64
|
+
with open(f"{fixtures_folder}/ecoClimateZone-dry/cycle.jsonld", encoding='utf-8') as f:
|
|
65
|
+
cycle = json.load(f)
|
|
66
|
+
|
|
67
|
+
with open(f"{fixtures_folder}/ecoClimateZone-dry/result.jsonld", encoding='utf-8') as f:
|
|
68
|
+
expected = json.load(f)
|
|
69
|
+
|
|
70
|
+
value = run(cycle)
|
|
71
|
+
assert value == expected
|
|
@@ -2,26 +2,49 @@ from unittest.mock import patch
|
|
|
2
2
|
import json
|
|
3
3
|
from tests.utils import fixtures_path, fake_new_emission
|
|
4
4
|
|
|
5
|
-
from hestia_earth.models.ipcc2019.n2OToAirInorganicFertiliserIndirect import
|
|
5
|
+
from hestia_earth.models.ipcc2019.n2OToAirInorganicFertiliserIndirect import (
|
|
6
|
+
MODEL, TERM_ID, run, _should_run, NH3_TERM_ID, NO3_TERM_ID, NOX_TERM_ID
|
|
7
|
+
)
|
|
6
8
|
|
|
7
9
|
class_path = f"hestia_earth.models.{MODEL}.{TERM_ID}"
|
|
8
10
|
fixtures_folder = f"{fixtures_path}/{MODEL}/{TERM_ID}"
|
|
9
11
|
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
assert not _should_run({})
|
|
13
|
+
def test_should_run():
|
|
14
|
+
# no emissions => no run
|
|
15
|
+
cycle = {'completeness': {'fertiliser': True}, 'emissions': []}
|
|
16
|
+
should_run, *args = _should_run(cycle)
|
|
17
|
+
assert not should_run
|
|
17
18
|
|
|
18
|
-
# with
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
# with no3 emission => run
|
|
20
|
+
cycle['emissions'] = [
|
|
21
|
+
{
|
|
22
|
+
'term': {'@id': NO3_TERM_ID},
|
|
23
|
+
'value': [100]
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
'term': {'@id': NH3_TERM_ID},
|
|
27
|
+
'value': [100]
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
'term': {'@id': NOX_TERM_ID},
|
|
31
|
+
'value': [100]
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
should_run, *args = _should_run(cycle)
|
|
35
|
+
assert should_run is True
|
|
21
36
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
37
|
+
|
|
38
|
+
@patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
|
|
39
|
+
def test_run(*args):
|
|
40
|
+
with open(f"{fixtures_folder}/cycle.jsonld", encoding='utf-8') as f:
|
|
41
|
+
cycle = json.load(f)
|
|
42
|
+
|
|
43
|
+
with open(f"{fixtures_folder}/result.jsonld", encoding='utf-8') as f:
|
|
44
|
+
expected = json.load(f)
|
|
45
|
+
|
|
46
|
+
value = run(cycle)
|
|
47
|
+
assert value == expected
|
|
25
48
|
|
|
26
49
|
|
|
27
50
|
@patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
|
|
@@ -2,26 +2,49 @@ from unittest.mock import patch
|
|
|
2
2
|
import json
|
|
3
3
|
from tests.utils import fixtures_path, fake_new_emission
|
|
4
4
|
|
|
5
|
-
from hestia_earth.models.ipcc2019.n2OToAirOrganicFertiliserIndirect import
|
|
5
|
+
from hestia_earth.models.ipcc2019.n2OToAirOrganicFertiliserIndirect import (
|
|
6
|
+
MODEL, TERM_ID, run, _should_run, NH3_TERM_ID, NO3_TERM_ID, NOX_TERM_ID
|
|
7
|
+
)
|
|
6
8
|
|
|
7
9
|
class_path = f"hestia_earth.models.{MODEL}.{TERM_ID}"
|
|
8
10
|
fixtures_folder = f"{fixtures_path}/{MODEL}/{TERM_ID}"
|
|
9
11
|
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
assert not _should_run({})
|
|
13
|
+
def test_should_run():
|
|
14
|
+
# no emissions => no run
|
|
15
|
+
cycle = {'completeness': {'fertiliser': True}, 'emissions': []}
|
|
16
|
+
should_run, *args = _should_run(cycle)
|
|
17
|
+
assert not should_run
|
|
17
18
|
|
|
18
|
-
# with
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
# with no3 emission => run
|
|
20
|
+
cycle['emissions'] = [
|
|
21
|
+
{
|
|
22
|
+
'term': {'@id': NO3_TERM_ID},
|
|
23
|
+
'value': [100]
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
'term': {'@id': NH3_TERM_ID},
|
|
27
|
+
'value': [100]
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
'term': {'@id': NOX_TERM_ID},
|
|
31
|
+
'value': [100]
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
should_run, *args = _should_run(cycle)
|
|
35
|
+
assert should_run is True
|
|
21
36
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
37
|
+
|
|
38
|
+
@patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
|
|
39
|
+
def test_run(*args):
|
|
40
|
+
with open(f"{fixtures_folder}/cycle.jsonld", encoding='utf-8') as f:
|
|
41
|
+
cycle = json.load(f)
|
|
42
|
+
|
|
43
|
+
with open(f"{fixtures_folder}/result.jsonld", encoding='utf-8') as f:
|
|
44
|
+
expected = json.load(f)
|
|
45
|
+
|
|
46
|
+
value = run(cycle)
|
|
47
|
+
assert value == expected
|
|
25
48
|
|
|
26
49
|
|
|
27
50
|
@patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
|
|
@@ -0,0 +1,47 @@
|
|
|
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.ipcc2019.nh3ToAirInorganicFertiliser 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}._is_term_type_complete", return_value=False)
|
|
12
|
+
@patch(f"{class_path}.get_inorganic_fertiliser_N_total", return_value=0)
|
|
13
|
+
def test_should_run(mock_N_total, mock_complete, *args):
|
|
14
|
+
# no N => no run
|
|
15
|
+
assert not _should_run({})
|
|
16
|
+
|
|
17
|
+
# with N => no run
|
|
18
|
+
mock_N_total.return_value = 10
|
|
19
|
+
assert not _should_run({})
|
|
20
|
+
|
|
21
|
+
# is complete => run
|
|
22
|
+
mock_complete.return_value = True
|
|
23
|
+
assert _should_run({}) is True
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
|
|
27
|
+
def test_run_aggregated(*args):
|
|
28
|
+
with open(f"{fixtures_folder}/aggregated/cycle.jsonld", encoding='utf-8') as f:
|
|
29
|
+
cycle = json.load(f)
|
|
30
|
+
|
|
31
|
+
with open(f"{fixtures_folder}/aggregated/result.jsonld", encoding='utf-8') as f:
|
|
32
|
+
expected = json.load(f)
|
|
33
|
+
|
|
34
|
+
value = run(cycle)
|
|
35
|
+
assert value == expected
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
@patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
|
|
39
|
+
def test_run_disaggregated(*args):
|
|
40
|
+
with open(f"{fixtures_folder}/disaggregated/cycle.jsonld", encoding='utf-8') as f:
|
|
41
|
+
cycle = json.load(f)
|
|
42
|
+
|
|
43
|
+
with open(f"{fixtures_folder}/disaggregated/result.jsonld", encoding='utf-8') as f:
|
|
44
|
+
expected = json.load(f)
|
|
45
|
+
|
|
46
|
+
value = run(cycle)
|
|
47
|
+
assert value == expected
|
|
@@ -0,0 +1,35 @@
|
|
|
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.ipcc2019.nh3ToAirOrganicFertiliser 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}._is_term_type_complete", return_value=False)
|
|
12
|
+
@patch(f"{class_path}.get_organic_fertiliser_N_total", return_value=0)
|
|
13
|
+
def test_should_run(mock_N_total, mock_complete, *args):
|
|
14
|
+
# no N => no run
|
|
15
|
+
assert not _should_run({})
|
|
16
|
+
|
|
17
|
+
# with N => no run
|
|
18
|
+
mock_N_total.return_value = 10
|
|
19
|
+
assert not _should_run({})
|
|
20
|
+
|
|
21
|
+
# is complete => run
|
|
22
|
+
mock_complete.return_value = True
|
|
23
|
+
assert _should_run({}) is True
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
|
|
27
|
+
def test_run(*args):
|
|
28
|
+
with open(f"{fixtures_folder}/cycle.jsonld", encoding='utf-8') as f:
|
|
29
|
+
cycle = json.load(f)
|
|
30
|
+
|
|
31
|
+
with open(f"{fixtures_folder}/result.jsonld", encoding='utf-8') as f:
|
|
32
|
+
expected = json.load(f)
|
|
33
|
+
|
|
34
|
+
value = run(cycle)
|
|
35
|
+
assert value == expected
|
|
@@ -0,0 +1,47 @@
|
|
|
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.ipcc2019.noxToAirInorganicFertiliser 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}._is_term_type_complete", return_value=False)
|
|
12
|
+
@patch(f"{class_path}.get_inorganic_fertiliser_N_total", return_value=0)
|
|
13
|
+
def test_should_run(mock_N_total, mock_complete, *args):
|
|
14
|
+
# no N => no run
|
|
15
|
+
assert not _should_run({})
|
|
16
|
+
|
|
17
|
+
# with N => no run
|
|
18
|
+
mock_N_total.return_value = 10
|
|
19
|
+
assert not _should_run({})
|
|
20
|
+
|
|
21
|
+
# is complete => run
|
|
22
|
+
mock_complete.return_value = True
|
|
23
|
+
assert _should_run({}) is True
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
|
|
27
|
+
def test_run_aggregated(*args):
|
|
28
|
+
with open(f"{fixtures_folder}/aggregated/cycle.jsonld", encoding='utf-8') as f:
|
|
29
|
+
cycle = json.load(f)
|
|
30
|
+
|
|
31
|
+
with open(f"{fixtures_folder}/aggregated/result.jsonld", encoding='utf-8') as f:
|
|
32
|
+
expected = json.load(f)
|
|
33
|
+
|
|
34
|
+
value = run(cycle)
|
|
35
|
+
assert value == expected
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
@patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
|
|
39
|
+
def test_run_disaggregated(*args):
|
|
40
|
+
with open(f"{fixtures_folder}/disaggregated/cycle.jsonld", encoding='utf-8') as f:
|
|
41
|
+
cycle = json.load(f)
|
|
42
|
+
|
|
43
|
+
with open(f"{fixtures_folder}/disaggregated/result.jsonld", encoding='utf-8') as f:
|
|
44
|
+
expected = json.load(f)
|
|
45
|
+
|
|
46
|
+
value = run(cycle)
|
|
47
|
+
assert value == expected
|