Ejemplo n.º 1
0
def test_plant_decreases():
    # first get a benchmark
    plant_biomass = 90.
    soil_water = 0
    grazing_loss = 0.3
    senescence = 0.1
    growth_constant = 0.05
    uptake = 10.
    uptake_saturation = 3.
    change_1 = PG.calc_plant_change(plant_biomass, soil_water, uptake,
                                    uptake_saturation, growth_constant,
                                    senescence, grazing_loss)

    # now increase grazing_loss
    grazing_loss = 0.5
    change_2 = PG.calc_plant_change(plant_biomass, soil_water, uptake,
                                    uptake_saturation, growth_constant,
                                    senescence, grazing_loss)

    assert (change_1 > change_2)

    # now increase senescence
    senescence = 0.2
    change_3 = PG.calc_plant_change(plant_biomass, soil_water, uptake,
                                    uptake_saturation, growth_constant,
                                    senescence, grazing_loss)

    assert (change_2 > change_3)
Ejemplo n.º 2
0
def test_plant_increases():
    # first get a benchmark
    plant_biomass = 90.0
    soil_water = 0
    grazing_loss = 0.3
    senescence = 0.1
    growth_constant = 0.05
    uptake = 10.0
    uptake_saturation = 3.0
    change_1 = PG.calc_plant_change(
        plant_biomass,
        soil_water,
        uptake,
        uptake_saturation,
        growth_constant,
        senescence,
        grazing_loss,
    )

    # now increase the soil water
    soil_water = 3.0
    change_2 = PG.calc_plant_change(
        plant_biomass,
        soil_water,
        uptake,
        uptake_saturation,
        growth_constant,
        senescence,
        grazing_loss,
    )

    assert change_2 > change_1
Ejemplo n.º 3
0
def test_plant_change_zero():
    plant_biomass = 0.
    soil_water = 0
    grazing_loss = 0.3
    senescence = 0.1
    growth_constant = 0.05
    uptake = 10.
    uptake_saturation = 3.
    assert (PG.calc_plant_change(plant_biomass, soil_water, uptake,
                                 uptake_saturation, growth_constant,
                                 senescence, grazing_loss) == 0)