base#

The module contains frequently-used functions that do not neatly fit into other areas of the code base.

Classes

LayerGroup

A generic class for individual setting group and some methods to operate on each.

Functions

norm_dic

Normalize the dictionary dic.

norm_age_group

Create a normalized dictionary for the range age_min to age_max, inclusive.

get_index_by_brackets

Create a dictionary mapping each item in the value arrays to the key.

get_age_by_brackets

Create a dictionary mapping age to the age bracket it falls in.

get_ids_by_age

Get lists of IDs that map to each age.

count_ages

Create an age count from a population dictionary.

get_aggregate_ages

Create a dictionary of the count of ages by age brackets.

get_aggregate_matrix

Aggregate a symmetric matrix to fewer age brackets.

get_asymmetric_matrix

Get the contact matrix for the average individual in each age bracket.

get_bin_edges

Get the bin edges for size brackets.

get_bin_labels

Get the bin labels from the values contained within each bracket or bin.

count_values

Counter of values in the dictionary.

count_binned_values

Binned counter of values in the dictionary.

binned_values_dist

Binned distribution of values in the dictionary.