API for the decay module#
The decay module contains
pools which are still potentially forageable by animals but are in the process of
microbial decomposition. This includes excrement and carcasses that are tracked solely
in the animal module. This also includes plant litter which is mainly tracked in the
litter module, but is made available for animal consumption.
Classes:
|
This class stores information about the carcass biomass in each grid cell. |
|
This class stores information about the amount of excrement in each grid cell. |
|
A class to track the mass of fungal fruiting bodies in each grid cell. |
|
A class to track the amount of waste generated by each form of herbivory. |
Mixin for nutrient pools that can be scavenged by animal cohorts. |
|
|
Interface between litter model variables in |
Functions:
Find fraction of biomass that is assumed to decay rather than being scavenged. |
- class virtual_ecosystem.models.animal.decay.CarcassPool(scavengeable_cnp: ~virtual_ecosystem.models.animal.cnp.CNP = <factory>, decomposed_cnp: ~virtual_ecosystem.models.animal.cnp.CNP = <factory>, cell_id: int = -1, vertical_occupancy: ~virtual_ecosystem.models.animal.animal_traits.VerticalOccupancy = <VerticalOccupancy.GROUND: 2>)[source]#
This class stores information about the carcass biomass in each grid cell.
Methods:
add_carcass(C, N, P)Add carcass mass to the pool based on the provided mass.
decomposed_nutrient_per_area(nutrient, ...)Convert decomposed carcass nutrient content to mass per area units.
reset()Reset tracking of the nutrients associated with decomposed carcasses.
Attributes:
Grid position of carcass pool.
A CNP object storing decomposed nutrients in the carcass pool.
Total scavengeable carcass mass (kg).
A CNP object storing animal-accessible nutrients in the carcass pool.
Vertical position of carcass pool.
- add_carcass(C: float, N: float, P: float) None[source]#
Add carcass mass to the pool based on the provided mass.
- Parameters:
- Raises:
ValueError – If any input mass is negative.
- decomposed_nutrient_per_area(nutrient: str, grid_cell_area: float) float[source]#
Convert decomposed carcass nutrient content to mass per area units.
- Parameters:
- Raises:
ValueError – If a nutrient other than carbon, nitrogen, or phosphorus is chosen.
- Returns:
- The nutrient content of the decomposed carcasses on a per area basis
[kg m^-2].
- Return type:
- reset() None[source]#
Reset tracking of the nutrients associated with decomposed carcasses.
This function sets the decomposed carbon, nitrogen, and phosphorus to zero. It should only be called after transfers to the soil model due to decomposition have been calculated.
- vertical_occupancy: VerticalOccupancy = 2#
Vertical position of carcass pool.
- class virtual_ecosystem.models.animal.decay.ExcrementPool(scavengeable_cnp: ~virtual_ecosystem.models.animal.cnp.CNP = <factory>, decomposed_cnp: ~virtual_ecosystem.models.animal.cnp.CNP = <factory>, cell_id: int = -1, vertical_occupancy: ~virtual_ecosystem.models.animal.animal_traits.VerticalOccupancy = <VerticalOccupancy.GROUND: 2>)[source]#
This class stores information about the amount of excrement in each grid cell.
Methods:
add_excrement(C, N, P)Add excrement mass to the pool based on the provided input mass.
decomposed_nutrient_per_area(nutrient, ...)Convert decomposed excrement nutrient content to mass per area units.
reset()Reset tracking of the nutrients associated with decomposed excrement.
Attributes:
Grid position of carcass pool.
A CNP object storing decomposed nutrients in the excrement pool.
Total scavengeable excrement mass (kg).
A CNP object storing animal-accessible nutrients in the excrement pool.
Vertical position of carcass pool.
- add_excrement(C: float, N: float, P: float) None[source]#
Add excrement mass to the pool based on the provided input mass.
- Parameters:
- Raises:
ValueError – If any input mass is negative.
- decomposed_nutrient_per_area(nutrient: str, grid_cell_area: float) float[source]#
Convert decomposed excrement nutrient content to mass per area units.
- Parameters:
- Raises:
ValueError – If a nutrient other than carbon, nitrogen, or phosphorus is chosen.
- Returns:
- The nutrient content of the decomposed excrement on a per area basis
[kg m^-2].
- Return type:
- reset() None[source]#
Reset tracking of the nutrients associated with decomposed excrement.
This function sets the decomposed carbon, nitrogen, and phosphorus to zero. It should only be called after transfers to the soil model due to decomposition have been calculated.
- vertical_occupancy: VerticalOccupancy = 2#
Vertical position of carcass pool.
- class virtual_ecosystem.models.animal.decay.FungalFruitPool(cell_id: int, data: Data, cell_area: float, c_n_ratio: float, c_p_ratio: float)[source]#
A class to track the mass of fungal fruiting bodies in each grid cell.
TODO - A proper explanation as I add stuff
Methods:
apply_decay(decay_constant, time_period)Apply exponential decay to the fungal fruiting bodies pool.
get_eaten(consumed_mass, detritivore)Remove biomass when a cohort consumes fungal fruiting bodies.
Attributes:
Return current carbon mass in the pool [kg].
Vertical position of fungal fruiting pool.
- apply_decay(decay_constant: float, time_period: float) float[source]#
Apply exponential decay to the fungal fruiting bodies pool.
- Parameters:
decay_constant – The rate constant for fungal fruiting body decay [day^-1].
time_period – The time period over which decay occurs [day].
- Returns:
The total amount of fungal fruiting bodies that decayed in this specific grid cell (in carbon terms) [kg]
- get_eaten(consumed_mass: float, detritivore: Consumer) tuple[dict[str, float], dict[str, float]][source]#
Remove biomass when a cohort consumes fungal fruiting bodies.
- Parameters:
consumed_mass – Target wet-mass to consume after mechanical efficiency is applied (kg). Any attempt to over-consume is automatically capped.
detritivore – The cohort that is feeding used only to obtain mechanical efficiency.
- Returns:
Dictionary of element masses actually assimilated, keys
C,N,P(kg).
- vertical_occupancy: VerticalOccupancy = 2#
Vertical position of fungal fruiting pool.
- class virtual_ecosystem.models.animal.decay.HerbivoryWaste(plant_matter_type: str)[source]#
A class to track the amount of waste generated by each form of herbivory.
This is used as a temporary storage location before the wastes are added to the litter model. As such it is not made available for animal consumption.
The litter model splits its plant matter into four classes: wood, leaves, roots, and reproductive tissues (fruits and flowers). A separate instance of this class should be used for each of these groups.
- Parameters:
pool_name – Type of plant matter this waste pool contains.
- Raises:
ValueError – If initialised for a plant matter type that the litter model doesn’t accept.
Methods:
add_waste(input_mass_cnp)Add waste to the pool based on the provided stoichiometric mass.
Attributes:
Proportion of the herbivory waste pool carbon that is lignin [unitless].
The mass of each stoichiometric element found in the plant resources, {"C": value, "N": value, "P": value}.
Type of plant matter this waste pool contains.
- add_waste(input_mass_cnp: dict[str, float]) None[source]#
Add waste to the pool based on the provided stoichiometric mass.
- Parameters:
input_mass_cnp – Dictionary specifying the mass of each element in the waste {“C”: value, “N”: value, “P”: value}.
- Raises:
ValueError – If the input dictionary is missing required elements or contains negative values.
- lignin_proportion#
Proportion of the herbivory waste pool carbon that is lignin [unitless].
- mass_cnp: dict[str, float]#
The mass of each stoichiometric element found in the plant resources, {“C”: value, “N”: value, “P”: value}.
- plant_matter_type#
Type of plant matter this waste pool contains.
- class virtual_ecosystem.models.animal.decay.ScavengeableMixin[source]#
Mixin for nutrient pools that can be scavenged by animal cohorts.
Methods:
get_eaten(consumed_mass, scavenger)Remove biomass from the scavengeable pool and return stoichiometric gain.
- get_eaten(consumed_mass: float, scavenger: Consumer) tuple[dict[str, float], dict[str, float]][source]#
Remove biomass from the scavengeable pool and return stoichiometric gain.
- Parameters:
consumed_mass – Wet-mass the scavenger tries to eat [kg].
scavenger – The animal cohort consuming the material.
- Returns:
Dict with keys
"C","N","P"giving the mass of each element actually ingested, and a second empty dict.- Raises:
ValueError – If
consumed_massis negative.
- class virtual_ecosystem.models.animal.decay.SoilPool(pool_name: str, cell_id: int, data: Data, cell_area: float, max_depth_microbial_activity: float, c_n_p_ratios: dict[str, dict[str, float]])[source]#
Interface between litter model variables in
Dataand the animal module.One
SoilPoolinstance now represents one soil pool type *in one grid cell*.Methods:
get_eaten(consumed_mass, detritivore)Remove biomass when a cohort consumes this soil pool.
Attributes:
Return current carbon mass in the pool [kg].
Vertical position of soil pool.
- get_eaten(consumed_mass: float, detritivore: Consumer) tuple[dict[str, float], dict[str, float]][source]#
Remove biomass when a cohort consumes this soil pool.
In contrast to the LitterPool case, for soil pools mechanical efficiency is assumed to be 100% so does not factor into this calculation.
- Parameters:
consumed_mass – Target wet-mass to consume (kg). Any attempt to over-consume is automatically capped.
detritivore – The cohort that is feeding, this is only needed to maintain same function signature as SoilPool case
- Returns:
Dictionary of element masses actually assimilated, keys
C,N,P(kg).
- vertical_occupancy: VerticalOccupancy = 1#
Vertical position of soil pool.
- virtual_ecosystem.models.animal.decay.find_decay_consumed_split(microbial_decay_rate: float, animal_scavenging_rate: float)[source]#
Find fraction of biomass that is assumed to decay rather than being scavenged.
This should be calculated separately for each relevant biomass type (excrement and carcasses). This function should could be replaced in future by something that incorporates more of the factors determining this split (e.g. temperature).
- Parameters:
microbial_decay_rate – Rate at which biomass type decays due to microbes [day^-1]
animal_scavenging_rate – Rate at which biomass type is scavenged due to animals [day^-1]