Spike Interface#
Interface with spikeinterface#
- get_nwb_metadata(recording: BaseRecording, metadata: Optional[dict] = None)[source]#
Return default metadata for all recording fields.
- Parameters
recording (spikeinterface.BaseRecording)
metadata (dict) – metadata info for constructing the nwb file (optional).
- add_devices(nwbfile: NWBFile, metadata: Optional[DeepDict] = None)[source]#
Add device information to nwbfile object.
Will always ensure nwbfile has at least one device, but multiple devices within the metadata list will also be created.
- Parameters
nwbfile (NWBFile) – nwb file to which the recording information is to be added
metadata (DeepDict) – metadata info for constructing the nwb file (optional). Should be of the format
- metadata[‘Ecephys’][‘Device’] = [
- {
‘name’: my_name, ‘description’: my_description
]
Missing keys in an element of metadata[‘Ecephys’][‘Device’] will be auto-populated with defaults.
- add_electrode_groups(recording: BaseRecording, nwbfile: NWBFile, metadata: Optional[dict] = None)[source]#
Add electrode group information to nwbfile object.
Will always ensure nwbfile has at least one electrode group. Will auto-generate a linked device if the specified name does not exist in the nwbfile.
- Parameters
recording (spikeinterface.BaseRecording)
nwbfile (pynwb.NWBFile) – nwb file to which the recording information is to be added
metadata (dict) – metadata info for constructing the nwb file (optional). Should be of the format
- metadata[‘Ecephys’][‘ElectrodeGroup’] = [
- {
‘name’: my_name, ‘description’: my_description, ‘location’: electrode_location, ‘device’: my_device_name
]
Missing keys in an element of metadata[‘Ecephys’][‘ElectrodeGroup’] will be auto-populated with defaults. Group names set by RecordingExtractor channel properties will also be included with passed metadata, but will only use default description and location.
- add_electrodes(recording: BaseRecording, nwbfile: NWBFile, metadata: Optional[dict] = None, exclude: tuple = ())[source]#
Add channels from recording object as electrodes to nwbfile object.
- Parameters
recording (spikeinterface.BaseRecording)
nwbfile (NWBFile) – nwb file to which the recording information is to be added
metadata (dict) – metadata info for constructing the nwb file (optional). Should be of the format
- metadata[‘Ecephys’][‘Electrodes’] = [
- {
‘name’: my_name, ‘description’: my_description
]
Note that data intended to be added to the electrodes table of the NWBFile should be set as channel properties in the RecordingExtractor object. Missing keys in an element of metadata[‘Ecephys’][‘ElectrodeGroup’] will be auto-populated with defaults whenever possible. If ‘my_name’ is set to one of the required fields for nwbfile electrodes (id, x, y, z, imp, location, filtering, group_name), then the metadata will override their default values. Setting ‘my_name’ to metadata field ‘group’ is not supported as the linking to nwbfile.electrode_groups is handled automatically; please specify the string ‘group_name’ in this case. If no group information is passed via metadata, automatic linking to existing electrode groups, possibly including the default, will occur.
exclude (tuple) – An iterable containing the string names of channel properties in the RecordingExtractor object to ignore when writing to the NWBFile.
- check_if_recording_traces_fit_into_memory(recording: BaseRecording, segment_index: int = 0) None[source]#
Raises an error if the full traces of a recording extractor are larger than psutil.virtual_memory().available.
- Parameters
recording (spikeinterface.BaseRecording) – A recording extractor object from spikeinterface.
segment_index (int, optional) – The segment index of the recording extractor object, by default 0
- Raises
MemoryError –
- _recording_traces_to_hdmf_iterator(recording: BaseRecording, segment_index: Optional[int] = None, return_scaled: bool = False, iterator_type: str = 'v2', iterator_opts: Optional[dict] = None) AbstractDataChunkIterator[source]#
Function to wrap traces of spikeinterface recording into an AbstractDataChunkIterator.
- Parameters
recording (spikeinterface.BaseRecording) – A recording extractor from spikeinterface
segment_index (int, optional) – The recording segment to add to the NWBFile.
return_scaled (bool, defaults to False) – When True recording extractor objects from spikeinterface return their traces in microvolts.
iterator_type ({“v2”, “v1”, None}, default: ‘v2’) – The type of DataChunkIterator to use. ‘v1’ is the original DataChunkIterator of the hdmf data_utils. ‘v2’ is the locally developed SpikeInterfaceRecordingDataChunkIterator, which offers full control over chunking. None: write the TimeSeries with no memory chunking.
iterator_opts (dict, optional) – Dictionary of options for the iterator. See https://hdmf.readthedocs.io/en/stable/hdmf.data_utils.html#hdmf.data_utils.GenericDataChunkIterator for the full list of options.
- Returns
traces_as_iterator – The traces of the recording extractor wrapped in an iterator object.
- Return type
AbstractDataChunkIterator
- Raises
ValueError – If the iterator_type is not ‘v1’, ‘v2’ or None.
- add_electrical_series(recording: BaseRecording, nwbfile: NWBFile, metadata: Optional[dict] = None, segment_index: int = 0, starting_time: Optional[float] = None, write_as: Literal['raw', 'processed', 'lfp'] = 'raw', es_key: Optional[str] = None, write_scaled: bool = False, compression: Optional[str] = 'gzip', compression_opts: Optional[int] = None, iterator_type: Optional[str] = 'v2', iterator_opts: Optional[dict] = None)[source]#
Adds traces from recording object as ElectricalSeries to an NWBFile object.
- Parameters
recording (SpikeInterfaceRecording) – A recording extractor from spikeinterface
nwbfile (NWBFile) – nwb file to which the recording information is to be added
metadata (dict, optional) – metadata info for constructing the nwb file. Should be of the format
- metadata[‘Ecephys’][‘ElectricalSeries’] = dict(
name=my_name, description=my_description
)
segment_index (int, default: 0) – The recording segment to add to the NWBFile.
starting_time (float, optional) – Sets the starting time of the ElectricalSeries to a manually set value.
write_as ({‘raw’, ‘processed’, ‘lfp’}) – How to save the traces data in the nwb file. Options: - ‘raw’: save it in acquisition - ‘processed’: save it as FilteredEphys, in a processing module - ‘lfp’: save it as LFP, in a processing module
es_key (str, optional) – Key in metadata dictionary containing metadata info for the specific electrical series
write_scaled (bool, default: False) – If True, writes the traces in uV with the right conversion. If False , the data is stored as it is and the right conversions factors are added to the nwbfile.
compression ({None, ‘gzip’, ‘lzf’}, default: ‘gzip’) – Type of compression to use. Set to None to disable all compression. To use the configure_backend function, you should set this to None.
compression_opts (int, default: 4) – Only applies to compression=”gzip”. Controls the level of the GZIP.
iterator_type ({“v2”, “v1”, None}, default: ‘v2’) – The type of DataChunkIterator to use. ‘v1’ is the original DataChunkIterator of the hdmf data_utils. ‘v2’ is the locally developed SpikeInterfaceRecordingDataChunkIterator, which offers full control over chunking. None: write the TimeSeries with no memory chunking.
iterator_opts (dict, optional) – Dictionary of options for the iterator. See https://hdmf.readthedocs.io/en/stable/hdmf.data_utils.html#hdmf.data_utils.GenericDataChunkIterator for the full list of options.
Missing keys in an element of metadata[‘Ecephys’][‘ElectrodeGroup’] will be auto-populated with defaults
whenever possible.
- add_electrodes_info(recording: BaseRecording, nwbfile: NWBFile, metadata: Optional[dict] = None)[source]#
Add device, electrode_groups, and electrodes info to the nwbfile.
- Parameters
recording (SpikeInterfaceRecording)
nwbfile (NWBFile) – NWB file to which the recording information is to be added
metadata (dict, optional) – metadata info for constructing the nwb file. Should be of the format
- metadata[‘Ecephys’][‘Electrodes’] = [
- {
‘name’: my_name, ‘description’: my_description
]
Note that data intended to be added to the electrodes table of the NWBFile should be set as channel properties in the RecordingExtractor object. Missing keys in an element of metadata[‘Ecephys’][‘ElectrodeGroup’] will be auto-populated with defaults whenever possible. If ‘my_name’ is set to one of the required fields for nwbfile electrodes (id, x, y, z, imp, location, filtering, group_name), then the metadata will override their default values. Setting ‘my_name’ to metadata field ‘group’ is not supported as the linking to nwbfile.electrode_groups is handled automatically; please specify the string ‘group_name’ in this case. If no group information is passed via metadata, automatic linking to existing electrode groups, possibly including the default, will occur.
- write_recording(recording: BaseRecording, nwbfile_path: Optional[FilePathType] = None, nwbfile: Optional[NWBFile] = None, metadata: Optional[dict] = None, overwrite: bool = False, verbose: bool = True, starting_time: Optional[float] = None, write_as: Optional[str] = 'raw', es_key: Optional[str] = None, write_electrical_series: bool = True, write_scaled: bool = False, compression: Optional[str] = 'gzip', compression_opts: Optional[int] = None, iterator_type: Optional[str] = 'v2', iterator_opts: Optional[dict] = None) NWBFile[source]#
Primary method for writing a RecordingExtractor object to an NWBFile.
- Parameters
recording (spikeinterface.BaseRecording)
nwbfile_path (FilePathType, optional) – Path for where to write or load (if overwrite=False) the NWBFile. If specified, the context will always write to this location.
nwbfile (NWBFile, optional) – If passed, this function will fill the relevant fields within the NWBFile object. E.g., calling
write_recording(recording=my_recording_extractor, nwbfile=my_nwbfile)
will result in the appropriate changes to the my_nwbfile object. If neither ‘nwbfile_path’ nor ‘nwbfile’ are specified, an NWBFile object will be automatically generated and returned by the function.
metadata (dict, optional) – metadata info for constructing the nwb file (optional). Should be of the format
- metadata[‘Ecephys’] = {
- ‘Device’: [
- {
‘name’: my_name, ‘description’: my_description
] ‘ElectrodeGroup’: [
- {
‘name’: my_name, ‘description’: my_description, ‘location’: electrode_location, ‘device’: my_device_name
] ‘Electrodes’: [
- {
‘name’: my_name, ‘description’: my_description
] ‘ElectricalSeries’ = {
‘name’: my_name, ‘description’: my_description
}
Note that data intended to be added to the electrodes table of the NWBFile should be set as channel properties in the RecordingExtractor object.
overwrite (bool, default: False) – Whether to overwrite the NWBFile if one exists at the nwbfile_path.
verbose (bool, default: True) – If ‘nwbfile_path’ is specified, informs user after a successful write operation.
starting_time (float, optional) – Sets the starting time of the ElectricalSeries to a manually set value.
write_as ({‘raw’, ‘processed’, ‘lfp’}, optional) – How to save the traces data in the nwb file. - ‘raw’ will save it in acquisition - ‘processed’ will save it as FilteredEphys, in a processing module - ‘lfp’ will save it as LFP, in a processing module
es_key (str, optional) – Key in metadata dictionary containing metadata info for the specific electrical series
write_electrical_series (bool, default: True) – If True, electrical series are written in acquisition. If False, only device, electrode_groups, and electrodes are written to NWB.
write_scaled (bool, default: True) – If True, writes the scaled traces (return_scaled=True)
compression ({None, ‘gzip’, ‘lzp’}, default: ‘gzip’) – Type of compression to use. Set to None to disable all compression. To use the configure_backend function, you should set this to None.
compression_opts (int, optional, default: 4) – Only applies to compression=”gzip”. Controls the level of the GZIP.
iterator_type ({“v2”, “v1”, None}) – The type of DataChunkIterator to use. ‘v1’ is the original DataChunkIterator of the hdmf data_utils. ‘v2’ is the locally developed SpikeInterfaceRecordingDataChunkIterator, which offers full control over chunking. None: write the TimeSeries with no memory chunking.
iterator_opts (dict, optional) – Dictionary of options for the RecordingExtractorDataChunkIterator (iterator_type=’v2’). Valid options are:
- buffer_gbfloat, default: 1.0
In units of GB. Recommended to be as much free RAM as available. Automatically calculates suitable buffer shape.
- buffer_shapetuple, optional
Manual specification of buffer shape to return on each iteration. Must be a multiple of chunk_shape along each axis. Cannot be set if buffer_gb is specified.
- chunk_mbfloat. default: 1.0
Should be below 1 MB. Automatically calculates suitable chunk shape.
- chunk_shapetuple, optional
Manual specification of the internal chunk shape for the HDF5 dataset. Cannot be set if chunk_mb is also specified.
- display_progressbool, default: False
Display a progress bar with iteration rate and estimated completion time.
- progress_bar_optionsdict, optional
Dictionary of keyword arguments to be passed directly to tqdm. See tqdm/tqdm for options.
- get_nspikes(units_table: Units, unit_id: int) int[source]#
Return the number of spikes for chosen unit.
- add_units_table(sorting: BaseSorting, nwbfile: NWBFile, unit_ids: Optional[List[Union[str, int]]] = None, property_descriptions: Optional[dict] = None, skip_properties: Optional[List[str]] = None, skip_features: Optional[List[str]] = None, units_table_name: str = 'units', unit_table_description: str = 'Autogenerated by neuroconv.', write_in_processing_module: bool = False, write_waveforms: bool = False, waveform_means: Optional[ndarray] = None, waveform_sds: Optional[ndarray] = None, unit_electrode_indices=None)[source]#
Primary method for writing a SortingExtractor object to an NWBFile.
- Parameters
sorting (spikeinterface.BaseSorting)
nwbfile (NWBFile)
unit_ids (list of int or list of str, optional) – Controls the unit_ids that will be written to the nwb file. If None, all units are written.
property_descriptions (dict, optional) – For each key in this dictionary which matches the name of a unit property in sorting, adds the value as a description to that custom unit column.
skip_properties (list of str, optional) – Each string in this list that matches a unit property will not be written to the NWBFile.
skip_features (list of str, optional) – Each string in this list that matches a spike feature will not be written to the NWBFile.
write_in_processing_module (bool, default: False) – How to save the units table in the nwb file. - True will save it to the processing module to serve as a historical provenance for the official table. - False will save it to the official NWBFile.Units position; recommended only for the final form of the data.
units_table_name (str, default: ‘units’) – The name of the units table. If write_as==’units’, then units_table_name must also be ‘units’.
unit_table_description (str, optional) – Text description of the units table; it is recommended to include information such as the sorting method, curation steps, etc.
write_waveforms (bool, default: False) – if True and either sorting is a spikeextractors SortingExtractor object with “template” property or waveform_means (and optionally waveform_sd) are given, then waveforms are added to the units table after writing.
waveform_means (np.ndarray, optional) – Waveform mean (template) for each unit (num_units, num_samples, num_channels)
waveform_sds (np.ndarray, optional) – Waveform standard deviation for each unit (num_units, num_samples, num_channels)
unit_electrode_indices (list of lists or arrays, optional) – For each unit, the indices of electrodes that each waveform_mean/sd correspond to.
- write_sorting(sorting: BaseSorting, nwbfile_path: Optional[FilePathType] = None, nwbfile: Optional[NWBFile] = None, metadata: Optional[dict] = None, overwrite: bool = False, verbose: bool = True, unit_ids: Optional[List[Union[str, int]]] = None, property_descriptions: Optional[dict] = None, skip_properties: Optional[List[str]] = None, skip_features: Optional[List[str]] = None, write_as: Literal['units', 'processing'] = 'units', units_name: str = 'units', units_description: str = 'Autogenerated by neuroconv.')[source]#
Primary method for writing a SortingExtractor object to an NWBFile.
- Parameters
sorting (spikeinterface.BaseSorting)
nwbfile_path (FilePathType, optional) – Path for where to write or load (if overwrite=False) the NWBFile. If specified, the context will always write to this location.
nwbfile (NWBFile, optional) – If passed, this function will fill the relevant fields within the NWBFile object. E.g., calling
write_recording(recording=my_recording_extractor, nwbfile=my_nwbfile)
will result in the appropriate changes to the my_nwbfile object. If neither ‘nwbfile_path’ nor ‘nwbfile’ are specified, an NWBFile object will be automatically generated and returned by the function.
metadata (dict, optional) – Metadata dictionary with information used to create the NWBFile when one does not exist or overwrite=True.
overwrite (bool, default: False) – Whether to overwrite the NWBFile if one exists at the nwbfile_path. The default is False (append mode).
verbose (bool, default: True) – If ‘nwbfile_path’ is specified, informs user after a successful write operation.
unit_ids (list, optional) – Controls the unit_ids that will be written to the nwb file. If None (default), all units are written.
property_descriptions (dict, optional) – For each key in this dictionary which matches the name of a unit property in sorting, adds the value as a description to that custom unit column.
skip_properties (list of str, optional) – Each string in this list that matches a unit property will not be written to the NWBFile.
skip_features (list of str) – Each string in this list that matches a spike feature will not be written to the NWBFile.
write_as ({‘units’, ‘processing’}) – How to save the units table in the nwb file. Options: - ‘units’ will save it to the official NWBFile.Units position; recommended only for the final form of the data. - ‘processing’ will save it to the processing module to serve as a historical provenance for the official table.
units_name (str, default: ‘units’) – The name of the units table. If write_as==’units’, then units_name must also be ‘units’.
units_description (str, default: ‘Autogenerated by neuroconv.’)
- add_waveforms(waveform_extractor: WaveformExtractor, nwbfile: Optional[NWBFile] = None, metadata: Optional[dict] = None, recording: Optional[BaseRecording] = None, unit_ids: Optional[List[Union[str, int]]] = None, skip_properties: Optional[List[str]] = None, property_descriptions: Optional[dict] = None, write_as: Literal['units', 'processing'] = 'units', units_name: str = 'units', units_description: str = 'Autogenerated by neuroconv.')[source]#
Primary method for writing a WaveformExtractor object to an NWBFile.
- Parameters
waveform_extractor (WaveformExtractor)
nwbfile (NWBFile, optional) – If passed, this function will fill the relevant fields within the NWBFile object. E.g., calling
write_recording(recording=my_recording_extractor, nwbfile=my_nwbfile)
will result in the appropriate changes to the my_nwbfile object. If neither ‘nwbfile_path’ nor ‘nwbfile’ are specified, an NWBFile object will be automatically generated and returned by the function.
metadata (dict, optional) – Metadata dictionary with information used to create the NWBFile when one does not exist or overwrite=True. The “Ecephys” section of metadata is also used to create electrodes and electrical series fields.
recording (BaseRecording, optional) – If the waveform_extractor is ‘recordingless’, this argument needs to be passed to save electrode info. Otherwise, electrodes info is not added to the nwb file.
unit_ids (list, optional) – Controls the unit_ids that will be written to the nwb file. If None (default), all units are written.
property_descriptions (dict, optional) – For each key in this dictionary which matches the name of a unit property in sorting, adds the value as a description to that custom unit column.
skip_properties (list of str, optional) – Each string in this list that matches a unit property will not be written to the NWBFile.
write_as ({‘units’, ‘processing’}) – How to save the units table in the nwb file. Options: - ‘units’ will save it to the official NWBFile.Units position; recommended only for the final form of the data. - ‘processing’ will save it to the processing module to serve as a historical provenance for the official table.
units_name (str, optional, default: ‘units’) – The name of the units table. If write_as==’units’, then units_name must also be ‘units’.
units_description (str, default: ‘Autogenerated by neuroconv.’)
- write_waveforms(waveform_extractor: WaveformExtractor, nwbfile_path: Optional[FilePathType] = None, nwbfile: Optional[NWBFile] = None, metadata: Optional[dict] = None, overwrite: bool = False, recording: Optional[BaseRecording] = None, verbose: bool = True, unit_ids: Optional[List[Union[str, int]]] = None, write_electrical_series: bool = False, add_electrical_series_kwargs: Optional[dict] = None, skip_properties: Optional[List[str]] = None, property_descriptions: Optional[dict] = None, write_as: Literal['units', 'processing'] = 'units', units_name: str = 'units', units_description: str = 'Autogenerated by neuroconv.')[source]#
Primary method for writing a WaveformExtractor object to an NWBFile.
- Parameters
waveform_extractor (WaveformExtractor)
nwbfile_path (FilePathType) – Path for where to write or load (if overwrite=False) the NWBFile. If specified, the context will always write to this location.
nwbfile (NWBFile, optional) – If passed, this function will fill the relevant fields within the NWBFile object. E.g., calling
write_recording(recording=my_recording_extractor, nwbfile=my_nwbfile)
will result in the appropriate changes to the my_nwbfile object. If neither ‘nwbfile_path’ nor ‘nwbfile’ are specified, an NWBFile object will be automatically generated and returned by the function.
metadata (dict, optional) – Metadata dictionary with information used to create the NWBFile when one does not exist or overwrite=True. The “Ecephys” section of metadata is also used to create electrodes and electrical series fields.
overwrite (bool, default: False) – Whether to overwrite the NWBFile if one exists at the nwbfile_path.
recording (BaseRecording, optional) – If the waveform_extractor is ‘recordingless’, this argument needs to be passed to save electrode info. Otherwise, electrodes info is not added to the nwb file.
verbose (bool, default: True) – If ‘nwbfile_path’ is specified, informs user after a successful write operation.
unit_ids (list, optional) – Controls the unit_ids that will be written to the nwb file. If None (default), all units are written.
write_electrical_series (bool, default: False) – If True, the recording object associated to the WaveformExtractor is written as an electrical series.
add_electrical_series_kwargs (dict, optional) – Keyword arguments to control the add_electrical_series() function in case write_electrical_series=True
property_descriptions (dict, optional) – For each key in this dictionary which matches the name of a unit property in sorting, adds the value as a description to that custom unit column.
skip_properties (list of str, optional) – Each string in this list that matches a unit property will not be written to the NWBFile.
write_as ({‘units’, ‘processing’}) – How to save the units table in the nwb file. Options: - ‘units’ will save it to the official NWBFile.Units position; recommended only for the final form of the data. - ‘processing’ will save it to the processing module to serve as a historical provenance for the official table.
units_name (str, default: ‘units’) – The name of the units table. If write_as==’units’, then units_name must also be ‘units’.
units_description (str, default: ‘Autogenerated by neuroconv.’)
- waveform_extractor_has_recording(waveform_extractor) bool[source]#
Temporary helper function to substitute unreleased built-in waveform_extractor.has_recording().
- Parameters
waveform_extractor (si.WaveformExtractor) – The waveform extractor
- Returns
True if the waveform_extractor has an attached recording, False otherwise
- Return type
bool
Data chunk iterator#
- class SpikeInterfaceRecordingDataChunkIterator(recording: spikeinterface.core.baserecording.BaseRecording, segment_index: int = 0, return_scaled: bool = False, buffer_gb: Optional[float] = None, buffer_shape: Optional[tuple] = None, chunk_mb: Optional[float] = None, chunk_shape: Optional[tuple] = None, display_progress: bool = False, progress_bar_options: Optional[dict] = None)[source]#
Bases:
GenericDataChunkIteratorDataChunkIterator specifically for use on RecordingExtractor objects.
Initialize an Iterable object which returns DataChunks with data and their selections on each iteration.
- Parameters
recording (SpikeInterfaceRecording) – The SpikeInterfaceRecording object (RecordingExtractor or BaseRecording) which handles the data access.
segment_index (int, optional) – The recording segment to iterate on. Defaults to 0.
return_scaled (bool, optional) – Whether to return the trace data in scaled units (uV, if True) or in the raw data type (if False). Defaults to False.
buffer_gb (float, optional) – The upper bound on size in gigabytes (GB) of each selection from the iteration. The buffer_shape will be set implicitly by this argument. Cannot be set if buffer_shape is also specified. The default is 1GB.
buffer_shape (tuple, optional) – Manual specification of buffer shape to return on each iteration. Must be a multiple of chunk_shape along each axis. Cannot be set if buffer_gb is also specified. The default is None.
chunk_mb (float, optional) – The upper bound on size in megabytes (MB) of the internal chunk for the HDF5 dataset. The chunk_shape will be set implicitly by this argument. Cannot be set if chunk_shape is also specified. The default is 1MB, as recommended by the HDF5 group. For more details, see https://support.hdfgroup.org/HDF5/doc/TechNotes/TechNote-HDF5-ImprovingIOPerformanceCompressedDatasets.pdf
chunk_shape (tuple, optional) – Manual specification of the internal chunk shape for the HDF5 dataset. Cannot be set if chunk_mb is also specified. The default is None.
display_progress (bool, optional) – Display a progress bar with iteration rate and estimated completion time.
progress_bar_options (dict, optional) – Dictionary of keyword arguments to be passed directly to tqdm. See tqdm/tqdm for options.
- _get_default_chunk_shape(chunk_mb=None)[source]#
Select chunk shape with size in MB less than the threshold of chunk_mb.
Keeps the dimensional ratios of the original data.
- Args:
chunk_mb (
floatorint): Size of the HDF5 chunk in megabytes.
- _get_data(selection: Tuple[slice]) Iterable[source]#
Retrieve the data specified by the selection using minimal I/O.
The developer of a new implementation of the GenericDataChunkIterator must ensure the data is actually loaded into memory, and not simply mapped.
- Parameters
selection (Tuple[slice]) – tuple of slices, each indicating the selection indexed with respect to maxshape for that axis. Each axis of tuple is a slice of the full shape from which to pull data into the buffer.
- Returns
Array of data specified by selection
- Return type
numpy.ndarray