Tree Mass

class vivarium.processes.tree_mass.TreeMass(parameters=None)[source]

Bases: vivarium.core.process.Step

Derive total mass from molecular counts and weights.

Parameters

parameters (dict) –

Dictionary of parameters. The following keys are required:

  • from_path (tuple): Path to the root of the subtree whose mass will be summed.

defaults: Dict[str, Any] = {'from_path': ('..', '..'), 'initial_mass': <Quantity(0, 'femtogram')>}
initial_state(config=None)[source]
name = 'mass_deriver'
next_update(timestep, states)[source]

Return a _reduce update to store the total mass.

Store mass in ('global', 'mass').

ports_schema()[source]
vivarium.processes.tree_mass.calculate_mass(value, path, node)[source]

Reducer for summing masses in hierarchy

Parameters
  • value – The value to add mass to.

  • path – Unused.

  • node – The node whose mass will be added.

Returns

The mass of the node (accounting for the node’s molecular weight, which should be stored in its mw property) added to value.