HDF5 Output¶
All parameters, before and after triage, and all data stored during simulation (using TO_STORE list, community.add_to_store
method or population.add_attribute
method with store=True
) can be stored in a hdf5 file using the tools.save_hdf5
function.
Data will be stored using the h5dict library using the following structure:
[hdf5_file.hdf5]
├─"parameters"
│ ├─[parameter 1]
│ │ └─[value]
│ ├─[...]
│ └─[parameter n]
│ └─[value]
├─"triaged_parameters"
│ ├─[parameter 1]
│ │ └─[triaged value]
│ ├─[...]
│ └─[parameter n]
│ └─[triaged value]
├─"realizations"
│ ├─[seed 1]
│ │ ├─[output data 1]
│ │ │ └─[value]
│ │ ├─[...]
│ │ └─[output data n]
│ │ └─[value]
│ ├─[...]
│ └─[seed n]
└─"version"
└─[COMORBUSS version]
Important
COMORBUSS uses the h5dict library, that extends the data formats that the more common h5py library can store (mostly uniform data, lists os lists, dictionaries, etc.), to store its HDF5 files. Those files can be opened by any HDF5 reader/library, but it might be difficult to navigate data that where in formats incompatible with h5py.
TO_STORE list¶
The TO_STORE
list is passed as the to_store
parameter of the tools.save_hdf5
function and can be used to select data to be stored in the hdf5 file.
This parameter must be a list of tuples, where each tuple has 3 elements: a name to store data, an expression to be evaluate where the community
can be accessed as comm
, and a boolean to determine if data is supposed to be stored compressed or not.
[
(
"data_name",
"comm.evaluate.expression",
False,
),
(
"susceptible",
"comm.pop.susceptible",
False,
),
]