Domain Data Summary

Data in a model domain are easily queried and aggregated using the ModelSummary class:

class summary.ModelSummary(domain)

Collect summarized results from the model domain. With each summary function call, no computations take place. Rather, the to_compute attribute is appended with the output dask object, all of which are optimized and computed only when the compute() method is called.

Note

The to_compute attribute maintains the order of summary function calls. The returned list from compute will maintain summarized data in the call order.

Parameters:domain – A Domain instance
average_age(species=None, time=None, sex=None, group=None)

Collect the average age from a domain, filtering by sub-populations

Parameters:
  • species (str) – Species name - may be an iterable
  • time – time slice: int or iterable
  • sex – Sex (one of ‘male’ or ‘female’) - may be an iterable
  • group – group name - may be an iterable :return: ndarray with the average age
compute()

Compute all loaded summaries in the to_compute attribute

Returns:list of computed computed objects from to_compute attribute
fecundity(species=None, time=None, sex=None, group=None, coeff=False)

Collect the total fecundity using the given query

Parameters:
  • species (str) – Species name
  • time – time slice - may be an iterable or int
  • sex (str) – Sex (‘male’ or ‘female’) - may be an iterable
  • group (str) – Group name - may be an iterable
  • coeff (bool) – If True, the average fecundity reduction rate based on density is returned
Returns:

ndarray of total offspring

list_mortality_types(species=None, time=None, sex=None, group=None)

List the mortality names in the domain for the given query

Parameters:
  • species (str) – Species name
  • time – time slice - may be an iterable or int
  • sex (str) – Sex (‘male’ or ‘female’) - may be an iterable
  • group (str) – Group name - may be an iterable
Returns:

list of mortality names

model_summary()

Summarize totals of each species and their parameters in the domain. This is used primarily to service the data requirements of an excel output in logger.write_xlsx

Returns:dict of species and their parameters
total_carrying_capacity(species=None, time=None, sex=None, group=None)

Collect the total carrying capacity in the domain for the given query.

Attention

Carrying capacity may be calculated for an entire species in the solver (see Numerical Solvers). As such, query results that are filtered by sex or age group will include carrying capacity for the entire species.

Parameters:
  • species (str) – Species name
  • time – time slice - may be an iterable or int
  • sex (str) – Sex (‘male’ or ‘female’) - may be an iterable
  • group (str) – Group name - may be an iterable
Returns:

ndarray of total carrying capacity

total_mortality(species=None, time=None, sex=None, group=None, mortality_name=None, as_population=True)

Collect either the total population or the mortality parameter value for the given query

Parameters:
  • species (str) – Species name
  • time – time slice - may be an iterable or int
  • sex (str) – Sex (‘male’ or ‘female’) - may be an iterable
  • group (str) – Group name - may be an iterable
  • as_population (bool) – Use to determine whether the query output is the population that succumbs to the mortality, or the mortality rate
Returns:

ndarray of the mortality population or parameter

total_offspring(species=None, time=None, sex=None, group=None, offspring_sex=None)

Collect the total offspring using the given query

Parameters:
  • species (str) – Species name
  • time – time slice - may be an iterable or int
  • sex (str) – Sex (‘male’ or ‘female’) - may be an iterable
  • group (str) – Group name - may be an iterable
Returns:

ndarray of total offspring

total_population(species=None, time=None, sex=None, group=None, age=None)

Collect the sum of populations from a domain, filtering by sub-populations

Parameters:
  • species (str) – Species name - may be an iterable
  • time – time slice: int or iterable
  • sex – Sex (one of ‘male’ or ‘female’) - may be an iterable
  • group – group name - may be an iterable
  • age – discrete Age - may be an iterable
Returns:

ndarray with the total population