Print the computation log of a simulation.
If aggregate
is False
(default), print the value of each
computed vector.
If aggregate
is True
, only print the minimum, maximum, and
average value of each computed vector.
This mode is more suited for simulations on a large population.
If max_depth
is sys.maxsize
(default), print the entire
computation.
If max_depth
is set, for example to 3
, only print computed
vectors up to a depth of max_depth
.
A node in the tracing tree.
Calculate the time spent in the node.
round – Whether to round the result.
float – The time spent in the node.
Examples
>>> from openfisca_core import tracers
>>> node = tracers.TraceNode("variable", 2020)
>>> node.start = 1.123122313
>>> node.end = 1.12312313123
>>> node.calculation_time()
8.182e-07
>>> node.calculation_time(round_=False)
8.182299999770493e-07
Calculate the time spent on the formula.
float – The time spent on the formula.
Examples
>>> from openfisca_core import tracers
>>> node = tracers.TraceNode("variable", 2020)
>>> node.start = 1.123122313 * 11
>>> node.end = 1.12312313123 * 11
>>> child = tracers.TraceNode("variable", 2020)
>>> child.start = 1.123122313
>>> child.end = 1.12312313123
>>> for i in range(10):
... node.children = [child, *node.children]
>>> node.formula_time()
8.182e-07