pynn_brainscales.brainscales2.populations.NixIO
-
class
pynn_brainscales.brainscales2.populations.
NixIO
(filename, mode='rw') Bases:
neo.io.baseio.BaseIO
Class for reading and writing NIX files.
-
__init__
(filename, mode='rw') Initialise IO instance and NIX file.
- Parameters
filename – Full path to the file
Methods
__init__
(filename[, mode])Initialise IO instance and NIX file.
close
()Closes the open nix file and resets maps.
Returns an iterator which can be used to consecutively load and convert all Blocks from the NIX File.
read_all_blocks
([lazy])read_block
([index, nixname, neoname, lazy])Loads a Block from the NIX file along with all contained child objects and returns the equivalent Neo Block.
write_all_blocks
(neo_blocks[, use_obj_names])Convert all
neo_blocks
to the NIX equivalent and write them to the file.write_block
(block[, use_obj_names])Convert the provided Neo Block to a NIX Block and write it to the NIX file.
Attributes
-
close
() Closes the open nix file and resets maps.
-
extensions
= ['h5', 'nix']
-
is_readable
= True
-
is_writable
= True
-
iter_blocks
() Returns an iterator which can be used to consecutively load and convert all Blocks from the NIX File.
-
mode
= 'file'
-
name
= 'NIX'
-
read_all_blocks
(lazy=False)
-
read_block
(index=None, nixname=None, neoname=None, lazy=False) Loads a Block from the NIX file along with all contained child objects and returns the equivalent Neo Block.
The Block to read can be specified in one of three ways: - Index (position) in the file - Name of the NIX Block (see […] for details on the naming) - Name of the original Neo Block
If no arguments are specified, the first Block is returned and consecutive calls to the function return the next Block in the file. After all Blocks have been loaded this way, the function returns None.
If more than one argument is specified, the precedence order is: index, nixname, neoname
Note that Neo objects can be anonymous or have non-unique names, so specifying a Neo name may be ambiguous.
See also
NixIO.iter_blocks()
.- Parameters
index – The position of the Block to be loaded (creation order)
nixname – The name of the Block in NIX
neoname – The name of the original Neo Block
-
readable_objects
= [<class 'neo.core.block.Block'>]
-
supported_objects
= [<class 'neo.core.block.Block'>, <class 'neo.core.segment.Segment'>, <class 'neo.core.group.Group'>, <class 'neo.core.view.ChannelView'>, <class 'neo.core.analogsignal.AnalogSignal'>, <class 'neo.core.irregularlysampledsignal.IrregularlySampledSignal'>, <class 'neo.core.epoch.Epoch'>, <class 'neo.core.event.Event'>, <class 'neo.core.spiketrain.SpikeTrain'>]
-
write_all_blocks
(neo_blocks, use_obj_names=False) Convert all
neo_blocks
to the NIX equivalent and write them to the file.- Parameters
neo_blocks – List (or iterable) containing Neo blocks
use_obj_names – If True, will not generate unique object names
but will instead try to use the name of each Neo object. If these are not unique, an exception will be raised.
-
write_block
(block, use_obj_names=False) Convert the provided Neo Block to a NIX Block and write it to the NIX file.
- Parameters
block – Neo Block to be written
use_obj_names – If True, will not generate unique object names
but will instead try to use the name of each Neo object. If these are not unique, an exception will be raised.
-
writeable_objects
= [<class 'neo.core.block.Block'>]
-