cellsystem.logging package¶
Subpackages¶
Submodules¶
cellsystem.logging.full module¶
-
class
cellsystem.logging.full.
FullLog
(*args, **kwargs)[source]¶ Bases:
cellsystem.logging.core.multi.MultiLog
An aggregate log that records geometric information, mutations, ancestry and prints the actions to the screen. (Technically is a multilog that contains a GeometricLog, a MutationsLog, an AncestryLog and a PrinterLog.)
Each part can be accesed with:
log[{{logname}}]
where {{logname}} can be one of: ‘geometry’, ‘mutations’, ‘ancestry’ or ‘printer’.
also, each log can be (de)activated with:
# Deactivate log log[{{logname}}].silence() # Reactivate log log[{{logname}}].activate()
cellsystem.logging.geometric module¶
Geometric Logging¶
This module defines functionality for following the geometric evolution of the cell blob through time.
The classes GeometricLog and WorldLines are defined here.
-
class
cellsystem.logging.geometric.
GeometricLog
(*args, **kwargs)[source]¶ Bases:
cellsystem.logging.core.weak.WeakLog
Registers the geometric positions of the cells in time.
One may view the state of a GeometricLog object ‘glog’ by ‘glog.worldlines().show()’
-
class
cellsystem.logging.geometric.
WorldLines
(initial_state=None, time=0)[source]¶ Bases:
object
A class that represents the worldlines of a set of cells.
A worldline is the place in time and space that a cell occupies throughout it’s existence.
In other words, it stores for each cell ‘c’, a list of space-time points in which the cell has been (a spacetime point is a pair t, x where t is time and x is the geometric position of the cell at that time).
A world line may store a state similar to:
# wl is an initialized Worldline object >>> wl.worldlines {0: [(0, 50, 50), (1, 51, 51), (2, 52, 50)],
1: [(3, 51, 50), (2, 52, 50), (4, 51, 50), (5, 51, 50), (6, 51, 50)], 2: [(3, 52, 49), (2, 52, 50), (4, 52, 49), (5, 52, 48), (6, 52, 48)]}
cellsystem.logging.simple module¶
cellsystem.logging.treelogs module¶
-
class
cellsystem.logging.treelogs.
AncestryLog
(*args, **kwargs)[source]¶ Bases:
cellsystem.logging.treelogs.TreeLog
A tree log that maintains a “family tree”.
Each leaf represents a cell. When that cell divides, the leaf branches into leaves representing the daughters.
The current state of an object ‘tree’ is handily accessible by ‘print(tree)’
-
class
cellsystem.logging.treelogs.
MutationsLog
(*args, **kwargs)[source]¶ Bases:
cellsystem.logging.treelogs.TreeLog
A tree log that maintains a record of genome branching events.
Each leaf represents a genome that may be present in one or more cells. When one of those cells mutates, the new genome is added as a child of that leaf.
The current state of an object ‘tree’ is handily accessible by ‘print(tree)’
-
class
cellsystem.logging.treelogs.
TreeLog
(*args, **kwargs)[source]¶ Bases:
cellsystem.logging.core.weak.WeakLog
Base class for logs that grow trees.
-
alive_nodes
¶
-
Module contents¶
Logging classes.
Classes related to the recording of the simulation progress, analysis and history.
-
class
cellsystem.logging.
FullLog
(*args, **kwargs)[source]¶ Bases:
cellsystem.logging.core.multi.MultiLog
An aggregate log that records geometric information, mutations, ancestry and prints the actions to the screen. (Technically is a multilog that contains a GeometricLog, a MutationsLog, an AncestryLog and a PrinterLog.)
Each part can be accesed with:
log[{{logname}}]
where {{logname}} can be one of: ‘geometry’, ‘mutations’, ‘ancestry’ or ‘printer’.
also, each log can be (de)activated with:
# Deactivate log log[{{logname}}].silence() # Reactivate log log[{{logname}}].activate()
-
class
cellsystem.logging.
PrinterLog
(*args, **kwargs)[source]¶ Bases:
cellsystem.logging.core.log.Log
Simple logger that prints the steps to the screen.
-
class
cellsystem.logging.
MutationsLog
(*args, **kwargs)[source]¶ Bases:
cellsystem.logging.treelogs.TreeLog
A tree log that maintains a record of genome branching events.
Each leaf represents a genome that may be present in one or more cells. When one of those cells mutates, the new genome is added as a child of that leaf.
The current state of an object ‘tree’ is handily accessible by ‘print(tree)’
-
class
cellsystem.logging.
AncestryLog
(*args, **kwargs)[source]¶ Bases:
cellsystem.logging.treelogs.TreeLog
A tree log that maintains a “family tree”.
Each leaf represents a cell. When that cell divides, the leaf branches into leaves representing the daughters.
The current state of an object ‘tree’ is handily accessible by ‘print(tree)’
-
class
cellsystem.logging.
GeometricLog
(*args, **kwargs)[source]¶ Bases:
cellsystem.logging.core.weak.WeakLog
Registers the geometric positions of the cells in time.
One may view the state of a GeometricLog object ‘glog’ by ‘glog.worldlines().show()’
-
cellsystem.logging.
logged
(action_name, prepare=True)[source]¶ Decorate an action with logging.
Allows to specify if a prelogging action is called.
An action is a function ‘f’. The decorated function is another function
` logf = logged('action', prepare)(f) `
such that, if ‘log’ is a Log, then calling ‘logf(*args, log=log, **kwargs)’ also triggers transparently the log for the action name specified, that is, roughly the next steps are followed: ``` if prepare:log.preparefor(‘action’)log.log(‘action’, result)