API for the functional_group module

The models.animals.functional_group module contains a class that organizes constants and rate equations used by AnimalCohorts in the animals module.

Classes:

FunctionalGroup(name, taxa, diet, ...[, ...])

This is a class of animal functional groups.

Functions:

import_functional_groups(fg_csv_file, constants)

The function to import pre-defined functional groups.

class virtual_ecosystem.models.animals.functional_group.FunctionalGroup(name: str, taxa: str, diet: str, metabolic_type: str, birth_mass: float, adult_mass: float, constants: AnimalConsts = AnimalConsts())

This is a class of animal functional groups.

The goal of this class is to collect the correct constants and scaling relationships needed by an animal cohort such that they are accessed at initialization and stored in the AnimalCohort object as attributes. This should result in a system where an animal cohort can be auto-generated with a few keywords and numbers but that this procedure only need run once, at initialization, and that all further references to constants and scaling relationships are accessed through attributes of the AnimalCohort in question.

Attributes:

adult_mass

The mass of the functional group at adulthood.

birth_mass

The mass of the functional group at birth.

constants

Animal constants.

conversion_efficiency

The conversion efficiency of the functional group based on diet.

damuths_law_terms

The coefficient and exponent of damuth's law for population density.

diet

The diet of the functional group.

fat_mass_terms

The coefficient and exponent of fat mass allometry.

intake_rate_terms

The coefficient and exponent of intake allometry.

longevity_scaling

The coefficient and exponent for lifespan allometry.

mechanical_efficiency

The mechanical transfer efficiency of a functional group based on diet.

metabolic_rate_terms

The coefficient and exponent of metabolic rate.

metabolic_type

The metabolic type of the functional group

muscle_mass_terms

The coefficient and exponent of muscle mass allometry.

name

The name of the functional group.

prey_scaling

The predator-prey mass ratio scaling relationship.

taxa

The taxa of the functional group.

adult_mass

The mass of the functional group at adulthood.

birth_mass

The mass of the functional group at birth.

constants

Animal constants.

conversion_efficiency

The conversion efficiency of the functional group based on diet.

damuths_law_terms

The coefficient and exponent of damuth’s law for population density.

diet

The diet of the functional group.

fat_mass_terms

The coefficient and exponent of fat mass allometry.

intake_rate_terms

The coefficient and exponent of intake allometry.

longevity_scaling

The coefficient and exponent for lifespan allometry.

mechanical_efficiency

The mechanical transfer efficiency of a functional group based on diet.

metabolic_rate_terms

The coefficient and exponent of metabolic rate.

metabolic_type

The metabolic type of the functional group

muscle_mass_terms

The coefficient and exponent of muscle mass allometry.

name

The name of the functional group.

prey_scaling

The predator-prey mass ratio scaling relationship.

taxa

The taxa of the functional group.

virtual_ecosystem.models.animals.functional_group.import_functional_groups(fg_csv_file: str, constants: AnimalConsts) list[FunctionalGroup]

The function to import pre-defined functional groups.

This function is a first-pass of how we might import pre-defined functional groups. The current expected csv structure is: - [“name”, “taxa”, “diet”, “metabolic_type”, “birth_mass”, “adult_mass”] the specific options of which can be found in functional_group.py. This allows a user to set out a basic outline of functional groups that accept our definitions of parameters and scaling relationships based on those traits.

We will need a structure for users changing those underlying definitions but that can be constructed later.

Parameters:

csv_file – The location of the csv file holding the functional group definitions.

Returns:

A list of the FunctionalGroup instances created by the import.