hestia-earth-models 0.74.10__py3-none-any.whl → 0.74.12__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/agribalyse2016/fuelElectricity.py +1 -2
- hestia_earth/models/agribalyse2016/machineryInfrastructureDepreciatedAmountPerCycle.py +1 -7
- hestia_earth/models/akagiEtAl2011/utils.py +2 -6
- hestia_earth/models/aware/scarcityWeightedWaterUse.py +1 -4
- hestia_earth/models/aware2_0/scarcityWeightedWaterUse.py +1 -4
- hestia_earth/models/chaudharyBrooks2018/damageToTerrestrialEcosystemsLandOccupation.py +1 -4
- hestia_earth/models/chaudharyBrooks2018/damageToTerrestrialEcosystemsLandTransformation.py +1 -4
- hestia_earth/models/chaudharyBrooks2018/damageToTerrestrialEcosystemsTotalLandUseEffects.py +1 -4
- hestia_earth/models/cml2001Baseline/abioticResourceDepletionFossilFuels.py +1 -4
- hestia_earth/models/cml2001Baseline/abioticResourceDepletionMineralsAndMetals.py +1 -4
- hestia_earth/models/cml2001Baseline/eutrophicationPotentialExcludingFate.py +1 -4
- hestia_earth/models/cml2001Baseline/resourceUseEnergyDepletionDuringCycle.py +12 -10
- hestia_earth/models/cml2001Baseline/resourceUseMineralsAndMetalsDuringCycle.py +5 -5
- hestia_earth/models/cml2001Baseline/terrestrialAcidificationPotentialIncludingFateAverageEurope.py +1 -7
- hestia_earth/models/cml2001NonBaseline/eutrophicationPotentialIncludingFateAverageEurope.py +1 -7
- hestia_earth/models/cml2001NonBaseline/terrestrialAcidificationPotentialExcludingFate.py +1 -7
- hestia_earth/models/config/ImpactAssessment.json +12 -6
- hestia_earth/models/config/Site.json +16 -0
- hestia_earth/models/cycle/aboveGroundCropResidueTotal.py +1 -6
- hestia_earth/models/cycle/practice/landCover.py +9 -9
- hestia_earth/models/dammgen2009/noxToAirExcreta.py +1 -2
- hestia_earth/models/deRuijterEtAl2010/nh3ToAirCropResidueDecomposition.py +1 -2
- hestia_earth/models/ecoalimV9/cycle.py +1 -2
- hestia_earth/models/ecoalimV9/impact_assessment.py +10 -3
- hestia_earth/models/ecoinventV3/cycle.py +1 -2
- hestia_earth/models/ecoinventV3AndEmberClimate/cycle.py +1 -2
- hestia_earth/models/edip2003/ozoneDepletionPotential.py +1 -7
- hestia_earth/models/emepEea2019/utils.py +1 -2
- hestia_earth/models/emissionNotRelevant/__init__.py +2 -2
- hestia_earth/models/environmentalFootprintV3_1/environmentalFootprintSingleOverallScore.py +1 -4
- hestia_earth/models/environmentalFootprintV3_1/freshwaterEcotoxicityPotentialCtue.py +1 -7
- hestia_earth/models/environmentalFootprintV3_1/marineEutrophicationPotential.py +1 -7
- hestia_earth/models/environmentalFootprintV3_1/photochemicalOzoneCreationPotentialHumanHealthNmvocEq.py +1 -7
- hestia_earth/models/environmentalFootprintV3_1/scarcityWeightedWaterUse.py +1 -7
- hestia_earth/models/environmentalFootprintV3_1/soilQualityIndexLandOccupation.py +2 -7
- hestia_earth/models/environmentalFootprintV3_1/soilQualityIndexLandTransformation.py +2 -7
- hestia_earth/models/environmentalFootprintV3_1/soilQualityIndexTotalLandUseEffects.py +2 -7
- hestia_earth/models/epa2014/no3ToGroundwaterExcreta.py +1 -2
- hestia_earth/models/fantkeEtAl2016/damageToHumanHealthParticulateMatterFormation.py +2 -11
- hestia_earth/models/faostat2018/liveweightPerHead.py +11 -7
- hestia_earth/models/faostat2018/product/price.py +9 -5
- hestia_earth/models/faostat2018/seed.py +5 -12
- hestia_earth/models/faostat2018/utils.py +14 -6
- hestia_earth/models/frischknechtEtAl2000/ionisingRadiationKbqU235Eq.py +4 -8
- hestia_earth/models/geospatialDatabase/altitude.py +1 -2
- hestia_earth/models/geospatialDatabase/clayContent.py +1 -2
- hestia_earth/models/geospatialDatabase/croppingIntensity.py +1 -3
- hestia_earth/models/geospatialDatabase/drainageClass.py +1 -2
- hestia_earth/models/geospatialDatabase/ecoClimateZone.py +1 -2
- hestia_earth/models/geospatialDatabase/erodibility.py +1 -2
- hestia_earth/models/geospatialDatabase/heavyWinterPrecipitation.py +1 -2
- hestia_earth/models/geospatialDatabase/histosol.py +1 -2
- hestia_earth/models/geospatialDatabase/longFallowRatio.py +1 -3
- hestia_earth/models/geospatialDatabase/nutrientLossToAquaticEnvironment.py +1 -2
- hestia_earth/models/geospatialDatabase/organicCarbonPerKgSoil.py +1 -2
- hestia_earth/models/geospatialDatabase/potentialEvapotranspirationAnnual.py +1 -2
- hestia_earth/models/geospatialDatabase/potentialEvapotranspirationLongTermAnnualMean.py +1 -2
- hestia_earth/models/geospatialDatabase/potentialEvapotranspirationMonthly.py +1 -2
- hestia_earth/models/geospatialDatabase/precipitationAnnual.py +1 -2
- hestia_earth/models/geospatialDatabase/precipitationLongTermAnnualMean.py +1 -2
- hestia_earth/models/geospatialDatabase/precipitationMonthly.py +1 -2
- hestia_earth/models/geospatialDatabase/sandContent.py +1 -2
- hestia_earth/models/geospatialDatabase/siltContent.py +1 -2
- hestia_earth/models/geospatialDatabase/slope.py +1 -2
- hestia_earth/models/geospatialDatabase/slopeLength.py +1 -2
- hestia_earth/models/geospatialDatabase/soilPh.py +1 -2
- hestia_earth/models/geospatialDatabase/temperatureAnnual.py +1 -2
- hestia_earth/models/geospatialDatabase/temperatureLongTermAnnualMean.py +1 -2
- hestia_earth/models/geospatialDatabase/temperatureMonthly.py +1 -2
- hestia_earth/models/geospatialDatabase/totalNitrogenPerKgSoil.py +1 -2
- hestia_earth/models/geospatialDatabase/totalPhosphorusPerKgSoil.py +1 -2
- hestia_earth/models/geospatialDatabase/waterDepth.py +1 -2
- hestia_earth/models/hestia/aboveGroundCropResidue.py +1 -2
- hestia_earth/models/hestia/aboveGroundCropResidueTotal.py +1 -6
- hestia_earth/models/hestia/brackishWater.py +1 -2
- hestia_earth/models/hestia/cationExchangeCapacityPerKgSoil.py +1 -2
- hestia_earth/models/hestia/cropResidueManagement.py +1 -2
- hestia_earth/models/hestia/croppingIntensity.py +1 -7
- hestia_earth/models/hestia/default_emissions.py +3 -5
- hestia_earth/models/hestia/default_resourceUse.py +4 -11
- hestia_earth/models/hestia/excretaKgMass.py +9 -6
- hestia_earth/models/hestia/excretaKgN.py +8 -7
- hestia_earth/models/hestia/excretaKgVs.py +8 -7
- hestia_earth/models/hestia/feedConversionRatio/__init__.py +5 -7
- hestia_earth/models/hestia/flowingWater.py +1 -2
- hestia_earth/models/hestia/freshWater.py +1 -2
- hestia_earth/models/hestia/histosol.py +1 -2
- hestia_earth/models/hestia/inorganicFertiliser.py +2 -14
- hestia_earth/models/hestia/irrigatedTypeUnspecified.py +1 -7
- hestia_earth/models/hestia/landCover.py +192 -911
- hestia_earth/models/hestia/landCover_utils.py +769 -0
- hestia_earth/models/hestia/landOccupationDuringCycle.py +1 -2
- hestia_earth/models/hestia/liveAnimal.py +1 -3
- hestia_earth/models/hestia/longFallowRatio.py +1 -7
- hestia_earth/models/hestia/management.py +14 -8
- hestia_earth/models/hestia/materialAndSubstrate.py +1 -2
- hestia_earth/models/hestia/milkYield.py +2 -12
- hestia_earth/models/hestia/netPrimaryProduction.py +1 -2
- hestia_earth/models/hestia/organicCarbonPerHa.py +1 -2
- hestia_earth/models/hestia/pToSurfaceWaterAquacultureSystems.py +2 -4
- hestia_earth/models/hestia/pastureGrass.py +3 -4
- hestia_earth/models/hestia/pastureSystem.py +1 -7
- hestia_earth/models/hestia/potentialEvapotranspirationAnnual.py +1 -2
- hestia_earth/models/hestia/potentialEvapotranspirationMonthly.py +1 -2
- hestia_earth/models/hestia/precipitationAnnual.py +1 -2
- hestia_earth/models/hestia/precipitationMonthly.py +1 -2
- hestia_earth/models/hestia/rainfallAnnual.py +1 -2
- hestia_earth/models/hestia/rainfallMonthly.py +1 -2
- hestia_earth/models/hestia/residueBurnt.py +1 -7
- hestia_earth/models/hestia/residueIncorporated.py +1 -7
- hestia_earth/models/hestia/residueLeftOnField.py +1 -7
- hestia_earth/models/hestia/residueRemoved.py +3 -8
- hestia_earth/models/hestia/resourceUse_utils.py +4 -20
- hestia_earth/models/hestia/salineWater.py +1 -2
- hestia_earth/models/hestia/seed_emissions.py +5 -6
- hestia_earth/models/hestia/slope.py +44 -0
- hestia_earth/models/hestia/slopeLength.py +44 -0
- hestia_earth/models/hestia/soilMeasurement.py +1 -2
- hestia_earth/models/hestia/stockingDensityAnimalHousingAverage.py +1 -7
- hestia_earth/models/hestia/temperatureAnnual.py +1 -2
- hestia_earth/models/hestia/temperatureMonthly.py +1 -2
- hestia_earth/models/hestia/totalNitrogenPerKgSoil.py +1 -2
- hestia_earth/models/hestia/unknownPreSeasonWaterRegime.py +1 -7
- hestia_earth/models/hestia/utils.py +5 -5
- hestia_earth/models/hestia/waterDepth.py +1 -2
- hestia_earth/models/hestia/waterSalinity.py +1 -2
- hestia_earth/models/impact_assessment/emissions.py +8 -9
- hestia_earth/models/impact_assessment/post_checks/cycle.py +1 -1
- hestia_earth/models/impact_assessment/pre_checks/cycle.py +1 -1
- hestia_earth/models/ipcc2006/aboveGroundCropResidueRemoved.py +1 -3
- hestia_earth/models/ipcc2006/aboveGroundCropResidueTotal.py +1 -3
- hestia_earth/models/ipcc2006/belowGroundCropResidue.py +1 -3
- hestia_earth/models/ipcc2006/n2OToAirCropResidueDecompositionDirect.py +2 -6
- hestia_earth/models/ipcc2006/n2OToAirCropResidueDecompositionIndirect.py +1 -2
- hestia_earth/models/ipcc2006/n2OToAirExcretaDirect.py +1 -2
- hestia_earth/models/ipcc2006/n2OToAirExcretaIndirect.py +1 -2
- hestia_earth/models/ipcc2006/n2OToAirInorganicFertiliserDirect.py +1 -2
- hestia_earth/models/ipcc2006/n2OToAirInorganicFertiliserIndirect.py +1 -2
- hestia_earth/models/ipcc2006/n2OToAirOrganicFertiliserDirect.py +1 -2
- hestia_earth/models/ipcc2006/n2OToAirOrganicFertiliserIndirect.py +1 -2
- hestia_earth/models/ipcc2013ExcludingFeedbacks/gwp100.py +1 -7
- hestia_earth/models/ipcc2013IncludingFeedbacks/gwp100.py +1 -7
- hestia_earth/models/ipcc2019/aboveGroundBiomass.py +1 -1
- hestia_earth/models/ipcc2019/aboveGroundCropResidueTotal.py +1 -3
- hestia_earth/models/ipcc2019/animal/milkYieldPerAnimal.py +3 -7
- hestia_earth/models/ipcc2019/animal/pastureGrass.py +1 -2
- hestia_earth/models/ipcc2019/belowGroundBiomass.py +1 -1
- hestia_earth/models/ipcc2019/belowGroundCropResidue.py +1 -3
- hestia_earth/models/ipcc2019/biocharOrganicCarbonPerHa.py +1 -1
- hestia_earth/models/ipcc2019/ch4ToAirAquacultureSystems.py +2 -6
- hestia_earth/models/ipcc2019/ch4ToAirEntericFermentation.py +2 -12
- hestia_earth/models/ipcc2019/ch4ToAirExcreta.py +1 -2
- hestia_earth/models/ipcc2019/ch4ToAirFloodedRice.py +2 -10
- hestia_earth/models/ipcc2019/ch4ToAirOrganicSoilCultivation.py +1 -1
- hestia_earth/models/ipcc2019/co2ToAirAboveGroundBiomassStockChange.py +1 -1
- hestia_earth/models/ipcc2019/co2ToAirBelowGroundBiomassStockChange.py +1 -1
- hestia_earth/models/ipcc2019/co2ToAirBiocharStockChange.py +1 -1
- hestia_earth/models/ipcc2019/co2ToAirLimeHydrolysis.py +1 -2
- hestia_earth/models/ipcc2019/co2ToAirOrganicSoilCultivation.py +1 -1
- hestia_earth/models/ipcc2019/co2ToAirSoilOrganicCarbonStockChange.py +1 -1
- hestia_earth/models/ipcc2019/co2ToAirUreaHydrolysis.py +1 -2
- hestia_earth/models/ipcc2019/croppingDuration.py +1 -2
- hestia_earth/models/ipcc2019/n2OToAirCropResidueBurningDirect.py +1 -2
- hestia_earth/models/ipcc2019/n2OToAirCropResidueDecompositionDirect.py +2 -7
- hestia_earth/models/ipcc2019/n2OToAirExcretaDirect.py +1 -2
- hestia_earth/models/ipcc2019/n2OToAirInorganicFertiliserDirect.py +2 -7
- hestia_earth/models/ipcc2019/n2OToAirOrganicFertiliserDirect.py +2 -7
- hestia_earth/models/ipcc2019/n2OToAirOrganicSoilCultivationDirect.py +2 -7
- hestia_earth/models/ipcc2019/n2OToAir_indirect_emissions_utils.py +3 -9
- hestia_earth/models/ipcc2019/nh3ToAirInorganicFertiliser.py +2 -6
- hestia_earth/models/ipcc2019/nh3ToAirOrganicFertiliser.py +2 -6
- hestia_earth/models/ipcc2019/no3ToGroundwaterCropResidueDecomposition.py +2 -7
- hestia_earth/models/ipcc2019/no3ToGroundwaterExcreta.py +2 -8
- hestia_earth/models/ipcc2019/no3ToGroundwaterInorganicFertiliser.py +2 -7
- hestia_earth/models/ipcc2019/no3ToGroundwaterOrganicFertiliser.py +2 -7
- hestia_earth/models/ipcc2019/nonCo2EmissionsToAirNaturalVegetationBurning.py +1 -1
- hestia_earth/models/ipcc2019/noxToAirInorganicFertiliser.py +2 -6
- hestia_earth/models/ipcc2019/noxToAirOrganicFertiliser.py +2 -6
- hestia_earth/models/ipcc2019/organicCarbonPerHa_tier_1.py +1 -1
- hestia_earth/models/ipcc2019/organicCarbonPerHa_tier_2.py +1 -1
- hestia_earth/models/ipcc2019/pastureGrass.py +1 -2
- hestia_earth/models/ipcc2021/gwp100.py +2 -11
- hestia_earth/models/jarvisAndPain1994/n2ToAirExcreta.py +1 -2
- hestia_earth/models/koble2014/utils.py +1 -3
- hestia_earth/models/lcImpactAllEffects100Years/damageToFreshwaterEcosystemsClimateChange.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToFreshwaterEcosystemsFreshwaterEcotoxicity.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToFreshwaterEcosystemsFreshwaterEutrophication.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToFreshwaterEcosystemsPdfYear.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToFreshwaterEcosystemsWaterStress.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToHumanHealth.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToHumanHealthClimateChange.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToHumanHealthHumanToxicityCancerogenic.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToHumanHealthHumanToxicityNonCancerogenic.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToHumanHealthParticulateMatterFormation.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToHumanHealthPhotochemicalOzoneFormation.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToHumanHealthStratosphericOzoneDepletion.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToHumanHealthWaterStress.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToMarineEcosystemsMarineEcotoxicity.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToMarineEcosystemsMarineEutrophication.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToMarineEcosystemsPdfYear.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToTerrestrialEcosystemsClimateChange.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToTerrestrialEcosystemsPdfYear.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToTerrestrialEcosystemsPhotochemicalOzoneFormation.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToTerrestrialEcosystemsTerrestrialAcidification.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToTerrestrialEcosystemsTerrestrialEcotoxicity.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToFreshwaterEcosystemsClimateChange.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToFreshwaterEcosystemsFreshwaterEcotoxicity.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToFreshwaterEcosystemsFreshwaterEutrophication.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToFreshwaterEcosystemsPdfYear.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToFreshwaterEcosystemsWaterStress.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToHumanHealth.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToHumanHealthClimateChange.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToHumanHealthHumanToxicityCancerogenic.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToHumanHealthHumanToxicityNonCancerogenic.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToHumanHealthParticulateMatterFormation.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToHumanHealthPhotochemicalOzoneFormation.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToHumanHealthStratosphericOzoneDepletion.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToHumanHealthWaterStress.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToMarineEcosystemsMarineEcotoxicity.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToMarineEcosystemsMarineEutrophication.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToMarineEcosystemsPdfYear.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToTerrestrialEcosystemsClimateChange.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToTerrestrialEcosystemsPdfYear.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToTerrestrialEcosystemsPhotochemicalOzoneFormation.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToTerrestrialEcosystemsTerrestrialAcidification.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToTerrestrialEcosystemsTerrestrialEcotoxicity.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToFreshwaterEcosystemsFreshwaterEcotoxicity.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToFreshwaterEcosystemsFreshwaterEutrophication.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToFreshwaterEcosystemsPdfYear.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToFreshwaterEcosystemsWaterStress.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToHumanHealth.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToHumanHealthClimateChange.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToHumanHealthHumanToxicityCancerogenic.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToHumanHealthHumanToxicityNonCancerogenic.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToHumanHealthParticulateMatterFormation.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToHumanHealthPhotochemicalOzoneFormation.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToHumanHealthStratosphericOzoneDepletion.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToHumanHealthWaterStress.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToMarineEcosystemsMarineEcotoxicity.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToMarineEcosystemsMarineEutrophication.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToMarineEcosystemsPdfYear.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToTerrestrialEcosystemsClimateChange.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToTerrestrialEcosystemsPdfYear.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToTerrestrialEcosystemsPhotochemicalOzoneFormation.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToTerrestrialEcosystemsTerrestrialAcidification.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToTerrestrialEcosystemsTerrestrialEcotoxicity.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToFreshwaterEcosystemsFreshwaterEcotoxicity.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToFreshwaterEcosystemsFreshwaterEutrophication.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToFreshwaterEcosystemsPdfYear.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToFreshwaterEcosystemsWaterStress.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToHumanHealth.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToHumanHealthClimateChange.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToHumanHealthHumanToxicityCancerogenic.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToHumanHealthHumanToxicityNonCancerogenic.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToHumanHealthParticulateMatterFormation.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToHumanHealthPhotochemicalOzoneFormation.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToHumanHealthStratosphericOzoneDepletion.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToHumanHealthWaterStress.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToMarineEcosystemsMarineEcotoxicity.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToMarineEcosystemsMarineEutrophication.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToMarineEcosystemsPdfYear.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToTerrestrialEcosystemsClimateChange.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToTerrestrialEcosystemsPdfYear.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToTerrestrialEcosystemsPhotochemicalOzoneFormation.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToTerrestrialEcosystemsTerrestrialAcidification.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToTerrestrialEcosystemsTerrestrialEcotoxicity.py +1 -7
- hestia_earth/models/linkedImpactAssessment/emissions.py +4 -6
- hestia_earth/models/linkedImpactAssessment/utils.py +4 -6
- hestia_earth/models/mocking/search-results.json +1 -1
- hestia_earth/models/pooreNemecek2018/aboveGroundCropResidueTotal.py +1 -3
- hestia_earth/models/pooreNemecek2018/belowGroundCropResidue.py +1 -3
- hestia_earth/models/pooreNemecek2018/ch4ToAirAquacultureSystems.py +1 -2
- hestia_earth/models/pooreNemecek2018/excretaKgN.py +3 -4
- hestia_earth/models/pooreNemecek2018/excretaKgVs.py +4 -4
- hestia_earth/models/pooreNemecek2018/freshwaterWithdrawalsDuringCycle.py +3 -9
- hestia_earth/models/pooreNemecek2018/landOccupationDuringCycle.py +3 -7
- hestia_earth/models/pooreNemecek2018/longFallowDuration.py +1 -7
- hestia_earth/models/pooreNemecek2018/n2OToAirAquacultureSystemsDirect.py +1 -2
- hestia_earth/models/pooreNemecek2018/n2ToAirAquacultureSystems.py +1 -2
- hestia_earth/models/pooreNemecek2018/nh3ToAirAquacultureSystems.py +1 -2
- hestia_earth/models/pooreNemecek2018/no3ToGroundwaterCropResidueDecomposition.py +1 -2
- hestia_earth/models/pooreNemecek2018/no3ToGroundwaterExcreta.py +1 -2
- hestia_earth/models/pooreNemecek2018/no3ToGroundwaterInorganicFertiliser.py +1 -2
- hestia_earth/models/pooreNemecek2018/no3ToGroundwaterOrganicFertiliser.py +1 -2
- hestia_earth/models/pooreNemecek2018/no3ToGroundwaterSoilFlux_utils.py +1 -2
- hestia_earth/models/pooreNemecek2018/noxToAirAquacultureSystems.py +1 -2
- hestia_earth/models/pooreNemecek2018/nurseryDensity.py +1 -7
- hestia_earth/models/pooreNemecek2018/nurseryDuration.py +1 -7
- hestia_earth/models/pooreNemecek2018/plantationDensity.py +1 -7
- hestia_earth/models/pooreNemecek2018/plantationLifespan.py +1 -7
- hestia_earth/models/pooreNemecek2018/plantationProductiveLifespan.py +1 -7
- hestia_earth/models/pooreNemecek2018/rotationDuration.py +1 -7
- hestia_earth/models/pooreNemecek2018/saplingsDepreciatedAmountPerCycle.py +1 -7
- hestia_earth/models/poschEtAl2008/terrestrialAcidificationPotentialAccumulatedExceedance.py +1 -7
- hestia_earth/models/poschEtAl2008/terrestrialEutrophicationPotentialAccumulatedExceedance.py +1 -7
- hestia_earth/models/recipe2016Egalitarian/damageToFreshwaterEcosystemsSpeciesYear.py +1 -7
- hestia_earth/models/recipe2016Egalitarian/damageToHumanHealth.py +1 -7
- hestia_earth/models/recipe2016Egalitarian/damageToMarineEcosystemsSpeciesYear.py +1 -7
- hestia_earth/models/recipe2016Egalitarian/damageToResourceAvailability.py +1 -7
- hestia_earth/models/recipe2016Egalitarian/damageToTerrestrialEcosystemsSpeciesYear.py +1 -7
- hestia_earth/models/recipe2016Egalitarian/ecosystemDamageOzoneFormation.py +1 -7
- hestia_earth/models/recipe2016Egalitarian/fossilResourceScarcity.py +1 -7
- hestia_earth/models/recipe2016Egalitarian/freshwaterAquaticEcotoxicityPotential14Dcbeq.py +1 -7
- hestia_earth/models/recipe2016Egalitarian/freshwaterEutrophicationPotential.py +1 -7
- hestia_earth/models/recipe2016Egalitarian/humanCarcinogenicToxicity.py +1 -7
- hestia_earth/models/recipe2016Egalitarian/humanDamageOzoneFormation.py +2 -10
- hestia_earth/models/recipe2016Egalitarian/humanNonCarcinogenicToxicity.py +1 -7
- hestia_earth/models/recipe2016Egalitarian/marineAquaticEcotoxicityPotential14Dcbeq.py +1 -7
- hestia_earth/models/recipe2016Egalitarian/marineEutrophicationPotential.py +1 -7
- hestia_earth/models/recipe2016Egalitarian/ozoneDepletionPotential.py +1 -7
- hestia_earth/models/recipe2016Egalitarian/terrestrialAcidificationPotential.py +1 -7
- hestia_earth/models/recipe2016Egalitarian/terrestrialEcotoxicityPotential14Dcbeq.py +1 -7
- hestia_earth/models/recipe2016Hierarchist/damageToFreshwaterEcosystemsSpeciesYear.py +1 -7
- hestia_earth/models/recipe2016Hierarchist/damageToHumanHealth.py +1 -7
- hestia_earth/models/recipe2016Hierarchist/damageToMarineEcosystemsSpeciesYear.py +1 -7
- hestia_earth/models/recipe2016Hierarchist/damageToResourceAvailability.py +1 -7
- hestia_earth/models/recipe2016Hierarchist/damageToTerrestrialEcosystemsSpeciesYear.py +1 -7
- hestia_earth/models/recipe2016Hierarchist/ecosystemDamageOzoneFormation.py +2 -10
- hestia_earth/models/recipe2016Hierarchist/fossilResourceScarcity.py +1 -7
- hestia_earth/models/recipe2016Hierarchist/freshwaterAquaticEcotoxicityPotential14Dcbeq.py +1 -7
- hestia_earth/models/recipe2016Hierarchist/freshwaterEutrophicationPotential.py +1 -7
- hestia_earth/models/recipe2016Hierarchist/humanCarcinogenicToxicity.py +1 -7
- hestia_earth/models/recipe2016Hierarchist/humanDamageOzoneFormation.py +2 -10
- hestia_earth/models/recipe2016Hierarchist/humanNonCarcinogenicToxicity.py +1 -7
- hestia_earth/models/recipe2016Hierarchist/marineAquaticEcotoxicityPotential14Dcbeq.py +1 -7
- hestia_earth/models/recipe2016Hierarchist/marineEutrophicationPotential.py +1 -7
- hestia_earth/models/recipe2016Hierarchist/ozoneDepletionPotential.py +1 -7
- hestia_earth/models/recipe2016Hierarchist/terrestrialAcidificationPotential.py +1 -7
- hestia_earth/models/recipe2016Hierarchist/terrestrialEcotoxicityPotential14Dcbeq.py +1 -7
- hestia_earth/models/recipe2016Individualist/damageToFreshwaterEcosystemsSpeciesYear.py +1 -7
- hestia_earth/models/recipe2016Individualist/damageToHumanHealth.py +1 -7
- hestia_earth/models/recipe2016Individualist/damageToMarineEcosystemsSpeciesYear.py +1 -7
- hestia_earth/models/recipe2016Individualist/damageToResourceAvailability.py +1 -7
- hestia_earth/models/recipe2016Individualist/damageToTerrestrialEcosystemsSpeciesYear.py +1 -7
- hestia_earth/models/recipe2016Individualist/ecosystemDamageOzoneFormation.py +2 -10
- hestia_earth/models/recipe2016Individualist/fossilResourceScarcity.py +1 -7
- hestia_earth/models/recipe2016Individualist/freshwaterAquaticEcotoxicityPotential14Dcbeq.py +1 -7
- hestia_earth/models/recipe2016Individualist/freshwaterEutrophicationPotential.py +1 -7
- hestia_earth/models/recipe2016Individualist/humanCarcinogenicToxicity.py +1 -7
- hestia_earth/models/recipe2016Individualist/humanDamageOzoneFormation.py +2 -10
- hestia_earth/models/recipe2016Individualist/humanNonCarcinogenicToxicity.py +1 -7
- hestia_earth/models/recipe2016Individualist/marineAquaticEcotoxicityPotential14Dcbeq.py +1 -7
- hestia_earth/models/recipe2016Individualist/marineEutrophicationPotential.py +1 -7
- hestia_earth/models/recipe2016Individualist/ozoneDepletionPotential.py +1 -7
- hestia_earth/models/recipe2016Individualist/terrestrialAcidificationPotential.py +1 -7
- hestia_earth/models/recipe2016Individualist/terrestrialEcotoxicityPotential14Dcbeq.py +1 -7
- hestia_earth/models/resourceUseNotRelevant/__init__.py +2 -8
- hestia_earth/models/schererPfister2015/nErosionSoilFlux.py +1 -2
- hestia_earth/models/schererPfister2015/pErosionSoilFlux.py +1 -2
- hestia_earth/models/schererPfister2015/pToDrainageWaterSoilFlux.py +1 -2
- hestia_earth/models/schererPfister2015/pToGroundwaterSoilFlux.py +1 -2
- hestia_earth/models/schererPfister2015/pToSurfaceWaterSoilFlux.py +1 -2
- hestia_earth/models/schmidt2007/ch4ToAirWasteTreatment.py +1 -2
- hestia_earth/models/schmidt2007/h2SToAirWasteTreatment.py +1 -2
- hestia_earth/models/schmidt2007/n2OToAirWasteTreatmentDirect.py +1 -2
- hestia_earth/models/schmidt2007/nh3ToAirWasteTreatment.py +1 -2
- hestia_earth/models/site/grouped_measurement.py +2 -3
- hestia_earth/models/stehfestBouwman2006/n2OToAirCropResidueDecompositionDirect.py +1 -2
- hestia_earth/models/stehfestBouwman2006/n2OToAirExcretaDirect.py +1 -2
- hestia_earth/models/stehfestBouwman2006/n2OToAirInorganicFertiliserDirect.py +1 -2
- hestia_earth/models/stehfestBouwman2006/n2OToAirOrganicFertiliserDirect.py +1 -2
- hestia_earth/models/stehfestBouwman2006/n2OToAirSoilFlux_utils.py +1 -2
- hestia_earth/models/stehfestBouwman2006/noxToAirCropResidueDecomposition.py +1 -2
- hestia_earth/models/stehfestBouwman2006/noxToAirExcreta.py +1 -2
- hestia_earth/models/stehfestBouwman2006/noxToAirInorganicFertiliser.py +1 -2
- hestia_earth/models/stehfestBouwman2006/noxToAirOrganicFertiliser.py +1 -2
- hestia_earth/models/stehfestBouwman2006/noxToAirSoilFlux_utils.py +1 -2
- hestia_earth/models/stehfestBouwman2006GisImplementation/noxToAirCropResidueDecomposition.py +1 -2
- hestia_earth/models/stehfestBouwman2006GisImplementation/noxToAirExcreta.py +1 -2
- hestia_earth/models/stehfestBouwman2006GisImplementation/noxToAirInorganicFertiliser.py +1 -2
- hestia_earth/models/stehfestBouwman2006GisImplementation/noxToAirOrganicFertiliser.py +1 -2
- hestia_earth/models/stehfestBouwman2006GisImplementation/noxToAirSoilFlux_utils.py +1 -2
- hestia_earth/models/transformation/input/excreta.py +7 -5
- hestia_earth/models/transformation/product/excreta.py +4 -4
- hestia_earth/models/usetoxV2/freshwaterEcotoxicityPotentialCtue.py +1 -7
- hestia_earth/models/utils/__init__.py +26 -7
- hestia_earth/models/utils/background_emissions.py +3 -3
- hestia_earth/models/utils/blank_node.py +31 -12
- hestia_earth/models/utils/emission.py +24 -10
- hestia_earth/models/utils/indicator.py +28 -13
- hestia_earth/models/utils/input.py +22 -5
- hestia_earth/models/utils/management.py +18 -4
- hestia_earth/models/utils/measurement.py +14 -6
- hestia_earth/models/utils/practice.py +24 -4
- hestia_earth/models/utils/product.py +32 -14
- hestia_earth/models/version.py +1 -1
- hestia_earth/models/webbEtAl2012AndSintermannEtAl2012/nh3ToAirOrganicFertiliser.py +1 -2
- hestia_earth/orchestrator/models/__init__.py +22 -11
- {hestia_earth_models-0.74.10.dist-info → hestia_earth_models-0.74.12.dist-info}/METADATA +2 -2
- {hestia_earth_models-0.74.10.dist-info → hestia_earth_models-0.74.12.dist-info}/RECORD +410 -404
- tests/models/cml2001Baseline/test_abioticResourceDepletionFossilFuels.py +4 -9
- tests/models/cml2001Baseline/test_abioticResourceDepletionMineralsAndMetals.py +4 -9
- tests/models/environmentalFootprintV3_1/test_environmentalFootprintSingleOverallScore.py +4 -9
- tests/models/environmentalFootprintV3_1/test_marineEutrophicationPotential.py +1 -7
- tests/models/environmentalFootprintV3_1/test_scarcityWeightedWaterUse.py +2 -8
- tests/models/environmentalFootprintV3_1/test_soilQualityIndexLandTransformation.py +3 -13
- tests/models/hestia/test_default_emissions.py +2 -2
- tests/models/hestia/test_default_resourceUse.py +3 -3
- tests/models/hestia/test_landCover.py +42 -295
- tests/models/hestia/test_landCover_utils.py +233 -0
- tests/models/hestia/test_slope.py +23 -0
- tests/models/hestia/test_slopeLength.py +23 -0
- tests/models/ipcc2019/test_no3ToGroundwaterExcreta.py +1 -0
- tests/models/poschEtAl2008/test_terrestrialAcidificationPotentialAccumulatedExceedance.py +4 -9
- tests/models/poschEtAl2008/test_terrestrialEutrophicationPotentialAccumulatedExceedance.py +4 -9
- tests/models/utils/test_indicator.py +6 -4
- tests/models/utils/test_measurement.py +7 -5
- {hestia_earth_models-0.74.10.dist-info → hestia_earth_models-0.74.12.dist-info}/LICENSE +0 -0
- {hestia_earth_models-0.74.10.dist-info → hestia_earth_models-0.74.12.dist-info}/WHEEL +0 -0
- {hestia_earth_models-0.74.10.dist-info → hestia_earth_models-0.74.12.dist-info}/top_level.txt +0 -0
|
@@ -3,20 +3,15 @@ from unittest.mock import patch
|
|
|
3
3
|
|
|
4
4
|
from pytest import mark
|
|
5
5
|
|
|
6
|
-
from hestia_earth.models.cml2001Baseline.abioticResourceDepletionFossilFuels import
|
|
7
|
-
get_all_non_renewable_terms
|
|
6
|
+
from hestia_earth.models.cml2001Baseline.abioticResourceDepletionFossilFuels import (
|
|
7
|
+
MODEL, TERM_ID, run, _should_run, get_all_non_renewable_terms
|
|
8
|
+
)
|
|
8
9
|
from tests.utils import fixtures_path, fake_new_indicator
|
|
9
10
|
|
|
10
11
|
class_path = f"hestia_earth.models.{MODEL}.{TERM_ID}"
|
|
11
12
|
fixtures_folder = f"{fixtures_path}/{MODEL}/{TERM_ID}"
|
|
12
13
|
|
|
13
14
|
|
|
14
|
-
def fake_rounded_indicator(value: float):
|
|
15
|
-
indicator = fake_new_indicator(TERM_ID, MODEL)
|
|
16
|
-
indicator['value'] = round(value, 7)
|
|
17
|
-
return indicator
|
|
18
|
-
|
|
19
|
-
|
|
20
15
|
def fake_get_terms(filename, column_name):
|
|
21
16
|
data = {
|
|
22
17
|
'fuel.csv': ["lignite", "conventionalCrudeOil", "naturalGas", "coalTar"],
|
|
@@ -118,7 +113,7 @@ def test_should_run(mock_get_all_non_renewable_terms, resources, expected, num_i
|
|
|
118
113
|
|
|
119
114
|
|
|
120
115
|
@patch(f"{class_path}.get_all_non_renewable_terms", side_effect=fake_get_terms)
|
|
121
|
-
@patch(f"{class_path}.
|
|
116
|
+
@patch(f"{class_path}._new_indicator", side_effect=fake_new_indicator)
|
|
122
117
|
def test_run(*args):
|
|
123
118
|
with open(f"{fixtures_folder}/impactassessment.jsonld", encoding='utf-8') as f:
|
|
124
119
|
impactassessment = json.load(f)
|
|
@@ -3,20 +3,15 @@ from unittest.mock import patch
|
|
|
3
3
|
|
|
4
4
|
from pytest import mark
|
|
5
5
|
|
|
6
|
-
from hestia_earth.models.cml2001Baseline.abioticResourceDepletionMineralsAndMetals import
|
|
7
|
-
_should_run
|
|
6
|
+
from hestia_earth.models.cml2001Baseline.abioticResourceDepletionMineralsAndMetals import (
|
|
7
|
+
MODEL, TERM_ID, run, _should_run
|
|
8
|
+
)
|
|
8
9
|
from tests.utils import fixtures_path, fake_new_indicator
|
|
9
10
|
|
|
10
11
|
class_path = f"hestia_earth.models.{MODEL}.{TERM_ID}"
|
|
11
12
|
fixtures_folder = f"{fixtures_path}/{MODEL}/{TERM_ID}"
|
|
12
13
|
|
|
13
14
|
|
|
14
|
-
def fake_rounded_indicator(value: float):
|
|
15
|
-
indicator = fake_new_indicator(TERM_ID, MODEL)
|
|
16
|
-
indicator['value'] = round(value, 7)
|
|
17
|
-
return indicator
|
|
18
|
-
|
|
19
|
-
|
|
20
15
|
iodine_input = {"@id": "iodineMaterial", "termType": "material", "units": "kg"}
|
|
21
16
|
boron_input = {"@id": "boron", "termType": "soilAmendment", "units": "kg B"}
|
|
22
17
|
tellurium_input = {"@id": "CAS-13494-80-9", "termType": "otherInorganicChemical", "units": "kg"}
|
|
@@ -98,7 +93,7 @@ def test_should_run(resources, expected, num_inputs):
|
|
|
98
93
|
assert len(grouped_inputs) == num_inputs
|
|
99
94
|
|
|
100
95
|
|
|
101
|
-
@patch(f"{class_path}.
|
|
96
|
+
@patch(f"{class_path}._new_indicator", side_effect=fake_new_indicator)
|
|
102
97
|
def test_run(*args):
|
|
103
98
|
with open(f"{fixtures_folder}/impactassessment.jsonld", encoding='utf-8') as f:
|
|
104
99
|
impactassessment = json.load(f)
|
|
@@ -3,20 +3,15 @@ from pytest import mark
|
|
|
3
3
|
from unittest.mock import patch, Mock
|
|
4
4
|
|
|
5
5
|
from hestia_earth.models.environmentalFootprintV3_1 import MODEL_FOLDER
|
|
6
|
-
from hestia_earth.models.environmentalFootprintV3_1.environmentalFootprintSingleOverallScore import
|
|
7
|
-
run, _should_run
|
|
6
|
+
from hestia_earth.models.environmentalFootprintV3_1.environmentalFootprintSingleOverallScore import (
|
|
7
|
+
TERM_ID, run, _should_run
|
|
8
|
+
)
|
|
8
9
|
from tests.utils import fixtures_path, fake_new_indicator
|
|
9
10
|
|
|
10
11
|
class_path = f"hestia_earth.models.{MODEL_FOLDER}.{TERM_ID}"
|
|
11
12
|
fixtures_folder = f"{fixtures_path}/{MODEL_FOLDER}/{TERM_ID}"
|
|
12
13
|
|
|
13
14
|
|
|
14
|
-
def fake_rounded_indicator(value: float):
|
|
15
|
-
indicator = fake_new_indicator(TERM_ID, MODEL)
|
|
16
|
-
indicator['value'] = round(value, 20)
|
|
17
|
-
return indicator
|
|
18
|
-
|
|
19
|
-
|
|
20
15
|
methodModelEFV31 = {"@type": "Term", "@id": "environmentalFootprintV3-1"}
|
|
21
16
|
methodModelFantkeEtAl2016 = {"@type": "Term", "@id": "fantkeEtAl2016"}
|
|
22
17
|
methodModelfrischknechtEtAl2000 = {"@type": "Term", "@id": "frischknechtEtAl2000"}
|
|
@@ -131,7 +126,7 @@ def test_should_run(impacts, expected, num_inputs):
|
|
|
131
126
|
assert len(resources) == num_inputs
|
|
132
127
|
|
|
133
128
|
|
|
134
|
-
@patch(f"{class_path}.
|
|
129
|
+
@patch(f"{class_path}._new_indicator", side_effect=fake_new_indicator)
|
|
135
130
|
def test_run(_mocked_indicator: Mock, *args):
|
|
136
131
|
with open(f"{fixtures_folder}/impactassessment.jsonld", encoding='utf-8') as f:
|
|
137
132
|
impactassessment = json.load(f)
|
|
@@ -2,19 +2,13 @@ import json
|
|
|
2
2
|
from unittest.mock import patch
|
|
3
3
|
|
|
4
4
|
from hestia_earth.models.environmentalFootprintV3_1 import MODEL_FOLDER
|
|
5
|
-
from hestia_earth.models.environmentalFootprintV3_1.marineEutrophicationPotential import
|
|
5
|
+
from hestia_earth.models.environmentalFootprintV3_1.marineEutrophicationPotential import TERM_ID, run
|
|
6
6
|
from tests.utils import fixtures_path, fake_new_indicator
|
|
7
7
|
|
|
8
8
|
class_path = f"hestia_earth.models.{MODEL_FOLDER}.{TERM_ID}"
|
|
9
9
|
fixtures_folder = f"{fixtures_path}/{MODEL_FOLDER}/{TERM_ID}"
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
def fake_rounded_indicator(value: float):
|
|
13
|
-
indicator = fake_new_indicator(TERM_ID, MODEL)
|
|
14
|
-
indicator['value'] = round(value, 7)
|
|
15
|
-
return indicator
|
|
16
|
-
|
|
17
|
-
|
|
18
12
|
@patch(f"{class_path}._new_indicator", side_effect=fake_new_indicator)
|
|
19
13
|
def test_run(*args):
|
|
20
14
|
with open(f"{fixtures_folder}/impact-assessment.jsonld", encoding='utf-8') as f:
|
|
@@ -4,7 +4,7 @@ from unittest.mock import patch
|
|
|
4
4
|
from pytest import mark
|
|
5
5
|
|
|
6
6
|
from hestia_earth.models.environmentalFootprintV3_1 import MODEL_FOLDER
|
|
7
|
-
from hestia_earth.models.environmentalFootprintV3_1.scarcityWeightedWaterUse import
|
|
7
|
+
from hestia_earth.models.environmentalFootprintV3_1.scarcityWeightedWaterUse import TERM_ID, run
|
|
8
8
|
from tests.utils import fixtures_path, fake_new_indicator
|
|
9
9
|
|
|
10
10
|
class_path = f"hestia_earth.models.{MODEL_FOLDER}.{TERM_ID}"
|
|
@@ -12,14 +12,8 @@ fixtures_folder = f"{fixtures_path}/{MODEL_FOLDER}/{TERM_ID}"
|
|
|
12
12
|
_folders = [d for d in os.listdir(fixtures_folder) if os.path.isdir(os.path.join(fixtures_folder, d))]
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
def fake_rounded_indicator(value: float):
|
|
16
|
-
indicator = fake_new_indicator(TERM_ID, MODEL)
|
|
17
|
-
indicator['value'] = round(value, 13)
|
|
18
|
-
return indicator
|
|
19
|
-
|
|
20
|
-
|
|
21
15
|
@mark.parametrize("folder", _folders)
|
|
22
|
-
@patch(f"{class_path}.
|
|
16
|
+
@patch(f"{class_path}._new_indicator", side_effect=fake_new_indicator)
|
|
23
17
|
def test_run(mock_indicator, folder):
|
|
24
18
|
with open(f"{fixtures_folder}/{folder}/impactassessment.jsonld", encoding='utf-8') as f:
|
|
25
19
|
impactassessment = json.load(f)
|
|
@@ -5,7 +5,7 @@ from pytest import mark
|
|
|
5
5
|
|
|
6
6
|
from hestia_earth.models.environmentalFootprintV3_1 import MODEL_FOLDER
|
|
7
7
|
from hestia_earth.models.environmentalFootprintV3_1.soilQualityIndexLandTransformation import (
|
|
8
|
-
|
|
8
|
+
TERM_ID, run, _should_run
|
|
9
9
|
)
|
|
10
10
|
from tests.utils import fixtures_path, fake_new_indicator
|
|
11
11
|
|
|
@@ -13,12 +13,6 @@ class_path = f"hestia_earth.models.{MODEL_FOLDER}.{TERM_ID}"
|
|
|
13
13
|
fixtures_folder = f"{fixtures_path}/{MODEL_FOLDER}/{TERM_ID}"
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
def fake_rounded_indicator(value: float):
|
|
17
|
-
indicator = fake_new_indicator(TERM_ID, MODEL)
|
|
18
|
-
indicator['value'] = round(value, 7)
|
|
19
|
-
return indicator
|
|
20
|
-
|
|
21
|
-
|
|
22
16
|
crop_land = {"@id": "cropland", "termType": "landCover"}
|
|
23
17
|
sea_land_cover = {"@id": "seaOrOcean", "termType": "landCover"}
|
|
24
18
|
forest = {"@id": "forest", "termType": "landCover"}
|
|
@@ -179,16 +173,12 @@ def test_run_italy(*args):
|
|
|
179
173
|
ids=["No country/region => default to region world",
|
|
180
174
|
"region-europe not in the lookup file => default to region world"]
|
|
181
175
|
)
|
|
182
|
-
@patch(f"{class_path}.
|
|
176
|
+
@patch(f"{class_path}._new_indicator", side_effect=fake_new_indicator)
|
|
183
177
|
def test_run_with_country_fallback(mocked_indicator: Mock, added_data: dict):
|
|
184
|
-
"""
|
|
185
|
-
When given valid sub-region or country not in the lookup file, default to country 'region-world' with value 574.56
|
|
186
|
-
"""
|
|
187
|
-
|
|
188
178
|
with open(f"{fixtures_folder}/multipleTransformations/impact-assessment.jsonld", encoding='utf-8') as f:
|
|
189
179
|
impact = json.load(f)
|
|
190
180
|
|
|
191
181
|
impact = impact | added_data
|
|
192
182
|
|
|
193
183
|
value = run(impact)
|
|
194
|
-
assert value['value'] ==
|
|
184
|
+
assert value['value'] == 575
|
|
@@ -11,8 +11,8 @@ fixtures_folder = f"{fixtures_path}/{MODEL}/{MODEL_KEY}"
|
|
|
11
11
|
_folders = [d for d in os.listdir(fixtures_folder) if os.path.isdir(os.path.join(fixtures_folder, d))]
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
def fake_new_emission_extended(*args):
|
|
15
|
-
data = fake_new_emission(*args)
|
|
14
|
+
def fake_new_emission_extended(*args, **kwargs):
|
|
15
|
+
data = fake_new_emission(*args, **kwargs)
|
|
16
16
|
data['term']['termType'] = 'emission'
|
|
17
17
|
return data
|
|
18
18
|
|
|
@@ -11,8 +11,8 @@ fixtures_folder = f"{fixtures_path}/{MODEL}/{MODEL_KEY}"
|
|
|
11
11
|
_folders = [d for d in os.listdir(fixtures_folder) if os.path.isdir(os.path.join(fixtures_folder, d))]
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
def fake_new_indicator_extended(*args):
|
|
15
|
-
data = fake_new_indicator(*args)
|
|
14
|
+
def fake_new_indicator_extended(*args, **kwargs):
|
|
15
|
+
data = fake_new_indicator(*args, **kwargs)
|
|
16
16
|
data['term']['termType'] = 'resourceUse'
|
|
17
17
|
return data
|
|
18
18
|
|
|
@@ -28,5 +28,5 @@ def test_run(mock, subfolder: str):
|
|
|
28
28
|
expected = json.load(f)
|
|
29
29
|
|
|
30
30
|
result = run(impact)
|
|
31
|
-
print(json.dumps(result, indent=2))
|
|
31
|
+
# print(json.dumps(result, indent=2))
|
|
32
32
|
assert result == expected
|
|
@@ -1,332 +1,87 @@
|
|
|
1
|
-
import logging
|
|
2
1
|
import os
|
|
3
2
|
import json
|
|
4
3
|
import pytest
|
|
5
4
|
from unittest.mock import patch
|
|
5
|
+
from tests.utils import fixtures_path, fake_new_management
|
|
6
6
|
|
|
7
|
+
from hestia_earth.models.log import logRequirements
|
|
7
8
|
from hestia_earth.models.hestia.utils import (
|
|
8
9
|
FOREST_LAND, PERMANENT_PASTURE, PERMANENT_CROPLAND, ANNUAL_CROPLAND, OTHER_LAND, TOTAL_CROPLAND,
|
|
9
10
|
TOTAL_AGRICULTURAL_CHANGE
|
|
10
11
|
)
|
|
11
|
-
from hestia_earth.models.
|
|
12
|
-
from tests.utils import fixtures_path, fake_new_management
|
|
13
|
-
from hestia_earth.models.faostat2018.utils import MODEL as FAOSTAT_MODEL
|
|
14
|
-
from hestia_earth.models.hestia.landCover import (
|
|
15
|
-
MODEL, MODEL_KEY, _get_changes, _estimate_maximum_forest_change,
|
|
16
|
-
run, site_area_sum_to_100, _get_sums_of_crop_expansion, _get_sum_for_land_category, scale_values_to_one,
|
|
17
|
-
_get_most_common_or_alphabetically_first, _get_land_cover_lookup_suffix, _get_ratio_between_land_use_types
|
|
18
|
-
)
|
|
12
|
+
from hestia_earth.models.hestia.landCover import MODEL, MODEL_KEY, run
|
|
19
13
|
|
|
20
|
-
|
|
14
|
+
class_path = f"hestia_earth.models.{MODEL}.{MODEL_KEY}"
|
|
15
|
+
class_path_utils = f"hestia_earth.models.{MODEL}.{MODEL_KEY}_utils"
|
|
21
16
|
fixtures_folder = f"{fixtures_path}/{MODEL}/{MODEL_KEY}"
|
|
22
17
|
_folders = [
|
|
23
18
|
d for d in os.listdir(fixtures_folder)
|
|
24
19
|
if os.path.isdir(os.path.join(fixtures_folder, d)) and not d.startswith("_")
|
|
25
20
|
]
|
|
26
21
|
|
|
27
|
-
FAOSTAT_CLASS_PATH = f"hestia_earth.models.{FAOSTAT_MODEL}.utils"
|
|
28
|
-
faostat_fixtures_folder = f"{fixtures_path}/{FAOSTAT_MODEL}/utils"
|
|
29
|
-
|
|
30
|
-
BRAZIL_SITE = {
|
|
31
|
-
"@type": "Site",
|
|
32
|
-
"id": "Brazil-example",
|
|
33
|
-
"country": {
|
|
34
|
-
"name": "Brazil",
|
|
35
|
-
"type": "Term"
|
|
36
|
-
},
|
|
37
|
-
"siteType": "cropland",
|
|
38
|
-
"management": [
|
|
39
|
-
{
|
|
40
|
-
"term": {
|
|
41
|
-
"@id": "maizePlant",
|
|
42
|
-
"name": "Maize plant",
|
|
43
|
-
"type": "Term",
|
|
44
|
-
"termType": "landCover"
|
|
45
|
-
},
|
|
46
|
-
"value": 100,
|
|
47
|
-
"startDate": "2010-01-01",
|
|
48
|
-
"endDate": "2010-12-31",
|
|
49
|
-
"type": "Management"
|
|
50
|
-
}
|
|
51
|
-
]
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
@pytest.mark.parametrize(
|
|
56
|
-
"terms,expected_output",
|
|
57
|
-
[
|
|
58
|
-
( # Only term
|
|
59
|
-
["Annual crops", "Annual crops"],
|
|
60
|
-
"Annual crops"
|
|
61
|
-
),
|
|
62
|
-
( # Most common
|
|
63
|
-
["Perennial crops", "Perennial crops", "Annual crops"],
|
|
64
|
-
"Perennial crops"
|
|
65
|
-
),
|
|
66
|
-
( # Tied frequency, Alphabetically first
|
|
67
|
-
["Perennial crops", "Perennial crops", "Annual crops", "Annual crops"],
|
|
68
|
-
"Annual crops"
|
|
69
|
-
)
|
|
70
|
-
]
|
|
71
|
-
)
|
|
72
|
-
def test_get_most_common_or_alphabetically_first(terms, expected_output):
|
|
73
|
-
actual_result = _get_most_common_or_alphabetically_first(terms)
|
|
74
|
-
assert actual_result == expected_output
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
def test_get_changes():
|
|
78
|
-
result, missing_values = _get_changes(
|
|
79
|
-
country_id="GADM-AFG",
|
|
80
|
-
end_year=2010
|
|
81
|
-
)
|
|
82
|
-
assert (
|
|
83
|
-
result == {
|
|
84
|
-
"Arable land": -117.0,
|
|
85
|
-
"Cropland": -123.0,
|
|
86
|
-
"Forest land": 0,
|
|
87
|
-
"Other land": 123.0,
|
|
88
|
-
"Land area": 0,
|
|
89
|
-
"Permanent crops": -6.0,
|
|
90
|
-
"Permanent meadows and pastures": 0,
|
|
91
|
-
"Total agricultural change": -123.0
|
|
92
|
-
}
|
|
93
|
-
)
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
@pytest.mark.parametrize(
|
|
97
|
-
"description,inputs,expected_output",
|
|
98
|
-
[
|
|
99
|
-
(
|
|
100
|
-
"Annual cropland gain from forest",
|
|
101
|
-
{
|
|
102
|
-
"forest_change": -1000,
|
|
103
|
-
"total_cropland_change": 1000,
|
|
104
|
-
"pasture_change": 0,
|
|
105
|
-
"total_agricultural_change": 1000
|
|
106
|
-
},
|
|
107
|
-
-1000
|
|
108
|
-
),
|
|
109
|
-
(
|
|
110
|
-
"Pasture gain from forest",
|
|
111
|
-
{
|
|
112
|
-
"forest_change": -1000,
|
|
113
|
-
"total_cropland_change": 0,
|
|
114
|
-
"pasture_change": 1000,
|
|
115
|
-
"total_agricultural_change": 1000
|
|
116
|
-
},
|
|
117
|
-
-1000
|
|
118
|
-
),
|
|
119
|
-
(
|
|
120
|
-
"Brazil",
|
|
121
|
-
{
|
|
122
|
-
"forest_change": -77317,
|
|
123
|
-
"total_cropland_change": 5201,
|
|
124
|
-
"pasture_change": -8267,
|
|
125
|
-
"total_agricultural_change": -3066
|
|
126
|
-
},
|
|
127
|
-
-5201
|
|
128
|
-
),
|
|
129
|
-
(
|
|
130
|
-
"Argentina",
|
|
131
|
-
{
|
|
132
|
-
"forest_change": -4990,
|
|
133
|
-
"total_cropland_change": 11408,
|
|
134
|
-
"pasture_change": -12705,
|
|
135
|
-
"total_agricultural_change": -1297
|
|
136
|
-
},
|
|
137
|
-
-4990
|
|
138
|
-
),
|
|
139
|
-
(
|
|
140
|
-
"Madagascar",
|
|
141
|
-
{
|
|
142
|
-
"forest_change": -1131,
|
|
143
|
-
"total_cropland_change": 275,
|
|
144
|
-
"pasture_change": 4295,
|
|
145
|
-
"total_agricultural_change": 4570
|
|
146
|
-
},
|
|
147
|
-
-1131
|
|
148
|
-
),
|
|
149
|
-
(
|
|
150
|
-
"Afforestation",
|
|
151
|
-
{
|
|
152
|
-
"forest_change": 100,
|
|
153
|
-
"total_cropland_change": -1000,
|
|
154
|
-
"pasture_change": -50,
|
|
155
|
-
"total_agricultural_change": -1000
|
|
156
|
-
},
|
|
157
|
-
0
|
|
158
|
-
),
|
|
159
|
-
(
|
|
160
|
-
"Pasture gain more than forest loss",
|
|
161
|
-
{
|
|
162
|
-
"forest_change": -49,
|
|
163
|
-
"total_cropland_change": -1000,
|
|
164
|
-
"pasture_change": 50,
|
|
165
|
-
"total_agricultural_change": -950
|
|
166
|
-
},
|
|
167
|
-
-49
|
|
168
|
-
)
|
|
169
|
-
]
|
|
170
|
-
)
|
|
171
|
-
def test_estimate_maximum_forest_change(description, inputs, expected_output):
|
|
172
|
-
assert _estimate_maximum_forest_change(**inputs) == expected_output, description
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
@pytest.mark.parametrize(
|
|
176
|
-
"description,inputs,expected_result",
|
|
177
|
-
[
|
|
178
|
-
("All zeros, OK", {"a": 0, "b": 0, "c": 0.0, "d": 0.0}, True),
|
|
179
|
-
("Exactly 1, OK", {"a": 0.1, "b": 0.5, "c": 0.4, "d": 0.0}, True),
|
|
180
|
-
("Almost 1, OK", {"a": 0.1, "b": 0.5, "c": 0.4, "d": 0.01}, True),
|
|
181
|
-
("Less than 1, Fail", {"a": 0.1, "b": 0, "c": 0.0, "d": 0.65}, False),
|
|
182
|
-
("More than 1, Fail", {"a": 0.15, "b": 0.7, "c": 0.0, "d": 0.65}, False),
|
|
183
|
-
]
|
|
184
|
-
)
|
|
185
|
-
def test_check_sum_of_percentages(description, inputs, expected_result):
|
|
186
|
-
assert site_area_sum_to_100(dict_of_percentages=inputs) == expected_result
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
def test_get_sums_of_crop_expansion():
|
|
190
|
-
result = _get_sums_of_crop_expansion(
|
|
191
|
-
country_id="GADM-AFG",
|
|
192
|
-
year=2010,
|
|
193
|
-
include_negatives=True
|
|
194
|
-
)
|
|
195
|
-
assert result == (753973.3, 18354.0)
|
|
196
|
-
|
|
197
|
-
result = _get_sums_of_crop_expansion(
|
|
198
|
-
country_id="GADM-AFG",
|
|
199
|
-
year=2010,
|
|
200
|
-
include_negatives=False
|
|
201
|
-
)
|
|
202
|
-
assert result == (940270.0, 28139.0)
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
def test_get_sum_for_land_category():
|
|
206
|
-
values = {
|
|
207
|
-
"mangoes_guavas_and_mangosteens": "2022:5",
|
|
208
|
-
"kiwi_fruit": "2020:4",
|
|
209
|
-
"maize_corn": "2020:3",
|
|
210
|
-
"other_beans_green": "2021:2",
|
|
211
|
-
"olives": "2020:-1"
|
|
212
|
-
}
|
|
213
|
-
fao_stat_to_ipcc_type = {
|
|
214
|
-
"mangoes_guavas_and_mangosteens": "Perennial crops",
|
|
215
|
-
'kiwi_fruit': "Perennial crops",
|
|
216
|
-
'maize_corn': "Annual crops",
|
|
217
|
-
'other_beans_green': "Annual crops",
|
|
218
|
-
'olives': "Perennial crops"
|
|
219
|
-
}
|
|
220
|
-
result = _get_sum_for_land_category(
|
|
221
|
-
values=values,
|
|
222
|
-
year=2020,
|
|
223
|
-
ipcc_land_use_category="Perennial crops",
|
|
224
|
-
fao_stat_to_ipcc_type=fao_stat_to_ipcc_type,
|
|
225
|
-
include_negatives=True
|
|
226
|
-
)
|
|
227
|
-
assert result == 3.0
|
|
228
|
-
|
|
229
22
|
|
|
230
|
-
@pytest.mark.parametrize(
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
),
|
|
237
|
-
(
|
|
238
|
-
{"a": 1000},
|
|
239
|
-
{"a": 1}
|
|
240
|
-
),
|
|
241
|
-
(
|
|
242
|
-
{"a": 10, "b": 5, "c": 3},
|
|
243
|
-
{"a": 0.5556, "b": 0.2778, "c": 0.1667}
|
|
244
|
-
)
|
|
245
|
-
]
|
|
246
|
-
)
|
|
247
|
-
def test_scale_values_to_one(dictionary, expected_result):
|
|
248
|
-
result = scale_values_to_one(dictionary)
|
|
249
|
-
for k, v in result.items():
|
|
250
|
-
assert k in expected_result
|
|
251
|
-
assert round(v, 3) == round(expected_result[k], 3)
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
@pytest.mark.parametrize(
|
|
255
|
-
"land_type,expected",
|
|
256
|
-
[
|
|
257
|
-
(FOREST_LAND, "forest"),
|
|
258
|
-
(ANNUAL_CROPLAND, "annualCropland"),
|
|
259
|
-
(PERMANENT_CROPLAND, "permanentCropland"),
|
|
260
|
-
(PERMANENT_PASTURE, "permanentPasture"),
|
|
261
|
-
(OTHER_LAND, "otherLand"),
|
|
262
|
-
]
|
|
263
|
-
)
|
|
264
|
-
def test_get_land_cover_lookup_suffix(land_type: str, expected: str):
|
|
265
|
-
assert _get_land_cover_lookup_suffix(land_type=land_type) == expected, land_type
|
|
23
|
+
@pytest.mark.parametrize("subfolder", _folders)
|
|
24
|
+
@patch(f"{class_path}._new_management", side_effect=fake_new_management)
|
|
25
|
+
def test_run(mock, subfolder: str):
|
|
26
|
+
folder = f"{fixtures_folder}/{subfolder}"
|
|
27
|
+
with open(f"{folder}/site.jsonld", encoding='utf-8') as f:
|
|
28
|
+
site = json.load(f)
|
|
266
29
|
|
|
30
|
+
with open(f"{folder}/result.jsonld", encoding='utf-8') as f:
|
|
31
|
+
expected = json.load(f)
|
|
267
32
|
|
|
268
|
-
|
|
269
|
-
result =
|
|
270
|
-
|
|
271
|
-
end_year=2004,
|
|
272
|
-
first_land_use_term="Arable land",
|
|
273
|
-
second_land_use_term="Permanent crops"
|
|
274
|
-
)
|
|
275
|
-
assert result == (3800.0, 57.417)
|
|
33
|
+
result = run(site)
|
|
34
|
+
print(json.dumps(result, indent=2))
|
|
35
|
+
assert result == expected
|
|
276
36
|
|
|
277
37
|
|
|
278
|
-
@patch(f"{
|
|
279
|
-
@patch(f"{
|
|
280
|
-
@patch(f"{
|
|
281
|
-
@patch(f"{
|
|
282
|
-
|
|
38
|
+
@patch(f"{class_path}.logShouldRun")
|
|
39
|
+
@patch(f"{class_path}.logRequirements", wraps=logRequirements)
|
|
40
|
+
@patch(f"{class_path_utils}._get_changes")
|
|
41
|
+
@patch(f"{class_path}.get_site_area_from_lookups", return_value={})
|
|
42
|
+
@patch(f"{class_path}._new_management", side_effect=fake_new_management)
|
|
43
|
+
def test_run_missing_changes_logs(mock_new_mgt, mock_area, mock_get_changes, mock_logRequirements, mock_logShouldRun):
|
|
283
44
|
fake_changes = {
|
|
284
45
|
FOREST_LAND: 0, ANNUAL_CROPLAND: 10, PERMANENT_CROPLAND: 20, PERMANENT_PASTURE: 70, OTHER_LAND: 0,
|
|
285
46
|
TOTAL_CROPLAND: 30, TOTAL_AGRICULTURAL_CHANGE: 100
|
|
286
47
|
}
|
|
287
|
-
mock_get_changes.return_value = (fake_changes, [
|
|
48
|
+
mock_get_changes.return_value = (fake_changes, [FOREST_LAND])
|
|
49
|
+
|
|
288
50
|
folder = f"{fixtures_folder}/malaysia"
|
|
289
51
|
with open(f"{folder}/site.jsonld", encoding='utf-8') as f:
|
|
290
52
|
site = json.load(f)
|
|
291
53
|
|
|
292
54
|
_ = run(site)
|
|
293
55
|
mock_logRequirements.assert_any_call(
|
|
294
|
-
|
|
56
|
+
site,
|
|
295
57
|
model=MODEL,
|
|
296
|
-
term="
|
|
58
|
+
term="oilPalmTree",
|
|
297
59
|
model_key=MODEL_KEY,
|
|
298
|
-
land_use_type=PERMANENT_CROPLAND,
|
|
299
60
|
country_id="GADM-MYS",
|
|
300
|
-
|
|
301
|
-
|
|
61
|
+
site_type_allowed=True,
|
|
62
|
+
allowed_land_use_types='Arable land;Permanent crops;Permanent meadows and pastures;Cropland',
|
|
63
|
+
land_use_type='Permanent crops',
|
|
64
|
+
values="year:2010_isValid:False_percentage:0_term-id:annualCropland_changes:10_site-area:0_"
|
|
65
|
+
"site-area-from-lookup:None_missing-changes:Forest land;year:2010_isValid:False_percentage:0_term-id:forest_"
|
|
66
|
+
"changes:0_site-area:0_site-area-from-lookup:None_missing-changes:Forest land;year:2010_isValid:False_"
|
|
67
|
+
"percentage:99.6_term-id:oilPalmTree_changes:20_site-area:0.9958907764054092_site-area-from-lookup:None_"
|
|
68
|
+
"missing-changes:Forest land;year:2010_isValid:False_percentage:0.411_term-id:otherLand_changes:0_"
|
|
69
|
+
"site-area:0.004109223594590805_site-area-from-lookup:None_missing-changes:Forest land;year:2010_"
|
|
70
|
+
"isValid:False_percentage:0_term-id:permanentPasture_changes:70_site-area:0_site-area-from-lookup:None_"
|
|
71
|
+
"missing-changes:Forest land"
|
|
302
72
|
)
|
|
303
73
|
|
|
304
|
-
mock_logShouldRun.assert_any_call(site, MODEL, "
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
@pytest.mark.parametrize("subfolder", _folders)
|
|
308
|
-
@patch(f"{CLASS_PATH}._new_management", side_effect=fake_new_management)
|
|
309
|
-
def test_run(mock, subfolder: str):
|
|
310
|
-
folder = f"{fixtures_folder}/{subfolder}"
|
|
311
|
-
with open(f"{folder}/site.jsonld", encoding='utf-8') as f:
|
|
312
|
-
site = json.load(f)
|
|
313
|
-
|
|
314
|
-
with open(f"{folder}/result.jsonld", encoding='utf-8') as f:
|
|
315
|
-
expected = json.load(f)
|
|
316
|
-
|
|
317
|
-
result = run(site)
|
|
318
|
-
assert result == expected
|
|
74
|
+
mock_logShouldRun.assert_any_call(site, MODEL, "oilPalmTree", False, model_key=MODEL_KEY)
|
|
319
75
|
|
|
320
76
|
|
|
321
|
-
def
|
|
77
|
+
def _fake_region_lookup(*args, **kwargs):
|
|
322
78
|
"""Returns obviously-wrong mock results from Brazil to be distinct from model."""
|
|
323
79
|
return ("2010:55.0")
|
|
324
80
|
|
|
325
81
|
|
|
326
|
-
@patch(f"{
|
|
327
|
-
@patch(f"{
|
|
82
|
+
@patch(f"{class_path_utils}.get_region_lookup_value", side_effect=_fake_region_lookup)
|
|
83
|
+
@patch(f"{class_path}._new_management", side_effect=fake_new_management)
|
|
328
84
|
def test_landCover_from_lookup_run(mock_mgmt, mock_region_lookup, caplog):
|
|
329
|
-
caplog.set_level(logging.INFO)
|
|
330
85
|
folder = f"{fixtures_folder}/_from_lookups"
|
|
331
86
|
with open(f"{folder}/site.jsonld", encoding='utf-8') as f:
|
|
332
87
|
site = json.load(f)
|
|
@@ -338,16 +93,8 @@ def test_landCover_from_lookup_run(mock_mgmt, mock_region_lookup, caplog):
|
|
|
338
93
|
mock_region_lookup.assert_called_with(
|
|
339
94
|
lookup_name='region-crop-cropGroupingFAOSTAT-landCover-otherLand.csv',
|
|
340
95
|
term_id='GADM-BRA',
|
|
341
|
-
column='Maize
|
|
96
|
+
column='Maize (corn)',
|
|
342
97
|
model='hestia',
|
|
343
98
|
key='landCover'
|
|
344
99
|
)
|
|
345
|
-
expected_message = ("site=Brazil-example, requirements=true, model=hestia, model_key=landCover, "
|
|
346
|
-
"has_management_nodes=True, land_use_type=Arable land, allowed_land_use_types=Arable land;"
|
|
347
|
-
"Permanent crops;Permanent meadows and pastures;Cropland, has_no_prior_land_cover_data=True, "
|
|
348
|
-
"management_nodes=value:100_id:maizePlant_land-use-type:Arable land"
|
|
349
|
-
"_endDate:2010-12-31_startDate:2010-01-01, landCover_from_lookups=Forest land:0.55;"
|
|
350
|
-
"Arable land:0.55;Permanent crops:0.55;Permanent meadows and pastures:0.55;Other land:0.55,"
|
|
351
|
-
" should_run_nodes=True")
|
|
352
|
-
assert expected_message in [r.msg for r in caplog.records]
|
|
353
100
|
assert result == expected
|