QuantitySelection.group

compartment_model.QuantitySelection.group(strata=False, subscript=False)

Groups quantities according to the given options.

By default, any quantities that directly match each other will be combined. This generally only happens with events, where there may be multiple edges between the same compartments like S->I, perhaps due to meta edges in a multistrata model.

With strata=True, quantities that would match if you removed the strata name will be combined. e.g., S_young and S_old; or S_young->I_young and S_old->I_old.

With subscript=True, quantities that would match if you removed subscript names will be combined. e.g., I_asymptomatic_young and I_symptomatic_young belong to the same strata (young) but have different subscripts so they will be combined.

And if both options are True, we consider matches after removing both strata and subscript names – effectively matching on the base compartment and event names.

Parameters

strata: bool = False

Whether or not to combine different strata.

subscript: bool = False

Whether or not the combine different subscripts.

Returns

QuantityGroup

A grouping strategy object.