agora.io.writer.StateWriter¶
- class StateWriter(file)[source]¶
Bases:
DynamicWriter
Write information summarising the current state of the pipeline - the ‘last_state’ dataset in the h5 file.
MOVEDatatypes are specified with the first variable specifying the number of traps and the other specifying the shape of the object.
- Attributes
- metadata
Methods
format_field
(states, field)Flatten a field in the states list to save as an h5 dataset.
format_states
(states)Re-format state data into a dict of lists, with one element per per list per state.
format_values_tpback
(states, val_name)Unpacks a dict of state data into tp_back, trap, value.
format_values_traps
(states, val_name)Format either lifetime, p_was_bud, or p_is_mother variables as a list.
pad_if_needed
(array, pad_size)Pad a 2D array with zeros for large indices.
write
(data, overwrite[, tp])Write the current state of the pipeline.
- __init__(file)¶
Methods
__init__
(file)format_field
(states, field)Flatten a field in the states list to save as an h5 dataset.
format_states
(states)Re-format state data into a dict of lists, with one element per per list per state.
format_values_tpback
(states, val_name)Unpacks a dict of state data into tp_back, trap, value.
format_values_traps
(states, val_name)Format either lifetime, p_was_bud, or p_is_mother variables as a list.
pad_if_needed
(array, pad_size)Pad a 2D array with zeros for large indices.
write
(data, overwrite[, tp])Write the current state of the pipeline.
Attributes
compression
compression_opts
data_types
datatypes
group
metadata
- static format_field(states, field)[source]¶
Flatten a field in the states list to save as an h5 dataset.
- format_states(states)[source]¶
Re-format state data into a dict of lists, with one element per per list per state.
- static format_values_tpback(states, val_name)[source]¶
Unpacks a dict of state data into tp_back, trap, value.