miv_simulator.utils.io#
Functions
|
|
|
|
|
str values are stored as bytes in h5py container attrs dictionaries. |
|
|
|
|
|
|
|
|
|
|
|
|
|
Writes local field potential voltage traces to specified HDF5 output file. |
|
|
|
Creates simulation results file and adds H5Types group compatible with NeuroH5. |
|
|
|
Writes intracellular state traces to specified NeuroH5 output file. |
|
str values are stored as bytes in h5py container attrs dictionaries. |
|
|
|
Given the H5 file, output the table of cell types, starting id, and counts. |
|
Writes spike times to specified NeuroH5 output file. |
|
Writes out the data necessary to instantiate the selected cells. |
|
Loads NeuroH5 connectivity file, and writes the corresponding synapse and network connection mechanisms for the selected postsynaptic cells. |
|
Writes out predefined spike trains when only a subset of the network is instantiated. |
Classes
|
Utility to manage NeuroH5 simulator files |
- miv_simulator.utils.io.show_celltypes(input_path, output=<built-in function print>)[source]#
Given the H5 file, output the table of cell types, starting id, and counts.. The CLI command is provided as
'show-h5types'.- Parameters:
- input_pathstr
Input h5 file path
- outputCallable
output stream (default=print)
- miv_simulator.utils.io.mkout(env, results_filename)[source]#
Creates simulation results file and adds H5Types group compatible with NeuroH5.
- Parameters:
env (
AbstractEnv) –results_filename (
str) –
- Return type:
None- Returns:
- miv_simulator.utils.io.spikeout(env, output_path, t_start=None, clear_data=False)[source]#
Writes spike times to specified NeuroH5 output file.
- Parameters:
env (
AbstractEnv) –output_path (
str) –clear_data (
bool) –
- Return type:
None- Returns:
- miv_simulator.utils.io.recsout(env, output_path, t_start=None, clear_data=False, write_cell_location_data=False, write_trial_data=False)[source]#
Writes intracellular state traces to specified NeuroH5 output file.
- Parameters:
env (
AbstractEnv) –output_path (
str) –clear_data (
bool) –reduce_data –
- Return type:
None- Returns:
- miv_simulator.utils.io.lfpout(env, output_path)[source]#
Writes local field potential voltage traces to specified HDF5 output file.
- Parameters:
env (
AbstractEnv) –output_path (
str) –clear_data –
- Returns:
- miv_simulator.utils.io.get_h5py_attr(attrs, key)[source]#
str values are stored as bytes in h5py container attrs dictionaries. This function enables py2/py3 compatibility by always returning them to str type upon read. Values should be converted during write with the companion function set_h5py_str_attr. :type attrs: :param attrs: :class:’h5py._hl.attrs.AttributeManager’ :type key: :param key: str :return: val with type converted if str or array of str
- miv_simulator.utils.io.set_h5py_attr(attrs, key, val)[source]#
str values are stored as bytes in h5py container attrs dictionaries. This function enables py2/py3 compatibility by always converting them to np.string_ upon write. Values should be converted back to str during read with the companion function get_h5py_str_attr.
- Parameters:
attrs – :class:’h5py._hl.attrs.AttributeManager’
key – str
val – type converted if str or array of str
- miv_simulator.utils.io.get_h5py_group(file, hierarchy, create=False)[source]#
- Parameters:
file –
- class:
in [‘h5py.File’, ‘h5py.Group’]
hierarchy – list of str
create – bool
- Returns:
:class:’h5py.Group’
- miv_simulator.utils.io.write_cell_selection(env, write_selection_file_path, populations=None, write_kwds={})[source]#
Writes out the data necessary to instantiate the selected cells.
- Parameters:
env (
AbstractEnv) – an instance of the Env class
- miv_simulator.utils.io.write_connection_selection(env, write_selection_file_path, populations=None, write_kwds={})[source]#
Loads NeuroH5 connectivity file, and writes the corresponding synapse and network connection mechanisms for the selected postsynaptic cells.
- Parameters:
env (
AbstractEnv) – an instance of the Env class
- miv_simulator.utils.io.write_input_cell_selection(env, input_sources, write_selection_file_path, populations=None, write_kwds={})[source]#
Writes out predefined spike trains when only a subset of the network is instantiated.
- Parameters:
env (
AbstractEnv) – an instance of the Env classinput_sources – a dictionary of the form { pop_name, gid_sources }