pynwb.core module

pynwb.core.set_parents(container, parent)
class pynwb.core.LabelledDict(label)

Bases: dict

A dict wrapper class for aggregating Timeseries from the standard locations

Parameters:label (str) – the TimeSeries type (
label
__getitem__(args)
pynwb.core.prepend_string(string, prepend=' ')
pynwb.core.nwb_repr(nwb_object, verbose=True)
class pynwb.core.NWBBaseType(name, parent=None, container_source=None)

Bases: pynwb.form.container.Container

The base class to any NWB types.

The purpose of this class is to provide a mechanism for representing hierarchical relationships in neurodata.

Parameters:
  • name (str) – the name of this container
  • parent (Container) – the parent Container for this Container
  • container_source (object) – the source of this Container e.g. file name
fields
class pynwb.core.NWBContainer(source, name, parent=None, container_source=None)

Bases: pynwb.core.NWBBaseType, pynwb.form.container.Container

Parameters:
  • source (str) – a description of where this NWBContainer came from
  • name (str) – the name of this container
  • parent (NWBContainer) – the parent Container for this Container
  • container_source (object) – the source of this Container e.g. file name
source

a description of where this NWBContainer came from

help
namespace = 'core'
neurodata_type = 'NWBContainer'
class pynwb.core.NWBDataInterface(source, name, parent=None, container_source=None)

Bases: pynwb.core.NWBContainer

Parameters:
  • source (str) – a description of where this NWBContainer came from
  • name (str) – the name of this container
  • parent (NWBContainer) – the parent Container for this Container
  • container_source (object) – the source of this Container e.g. file name
namespace = 'core'
neurodata_type = 'NWBDataInterface'
class pynwb.core.NWBData(name, data, parent=None, container_source=None)

Bases: pynwb.core.NWBBaseType, pynwb.form.container.Data

Parameters:
  • name (str) – the name of this container
  • data (ndarray or list or tuple or Dataset or AbstractDataChunkIterator or DataIO or FORMDataset or Data) – the source of the data
  • parent (NWBContainer) – the parent Container for this Container
  • container_source (object) – the source of this Container e.g. file name
data
__getitem__(args)
append(arg)
extend(arg)
help
namespace = 'core'
neurodata_type = 'NWBData'
class pynwb.core.VectorData(name, data, parent=None, container_source=None)

Bases: pynwb.core.NWBData

Parameters:
  • name (str) – the name of this VectorData
  • data (ndarray or list or tuple or Dataset or AbstractDataChunkIterator or DataIO or FORMDataset) – a dataset where the first dimension is a concatenation of multiple vectors
  • parent (NWBContainer) – the parent Container for this Container
  • container_source (object) – the source of this Container e.g. file name
namespace = 'core'
neurodata_type = 'VectorData'
class pynwb.core.VectorIndex(name, data, parent=None, container_source=None)

Bases: pynwb.core.NWBData

Parameters:
  • name (str) – the name of this VectorIndex
  • data (ndarray or list or tuple or Dataset or AbstractDataChunkIterator or DataIO or FORMDataset) – a 1D dataset containing indexes that apply to VectorData object
  • parent (NWBContainer) – the parent Container for this Container
  • container_source (object) – the source of this Container e.g. file name
namespace = 'core'
neurodata_type = 'VectorIndex'
class pynwb.core.IndexedVector(data, index=None)

Bases: object

Parameters:
  • data (VectorData) – the VectorData to maintain
  • index (VectorIndex) – a VectorIndex object that indexes this VectorData
add_vector(arg)
get_vector(arg)
class pynwb.core.ElementIdentifiers(name, data, parent=None, container_source=None)

Bases: pynwb.core.NWBData

Parameters:
  • name (str) – the name of this ElementIdentifiers
  • data (ndarray or list or tuple or Dataset or AbstractDataChunkIterator or DataIO or FORMDataset) – a 1D dataset containing identifiers
  • parent (NWBContainer) – the parent Container for this Container
  • container_source (object) – the source of this Container e.g. file name
namespace = 'core'
neurodata_type = 'ElementIdentifiers'
class pynwb.core.NWBTable(columns, name, data=[], parent=None, container_source=None)

Bases: pynwb.core.NWBData

Subclasses should specify the class attribute __columns__.

This should be a list of dictionaries with the following keys: 'name' - the column name 'type' - the type of data in this column 'doc' - a brief description of what gets stored in this column

For reference, this list of dictionaries will be used with docval to autogenerate the add_row method for adding data to this table.

If __columns__ is not specified, no custom add_row method will be added.

The class attribute __defaultname__ can also be set to specify a default name for the table class. If __defaultname__ is not specified, then name will need to be specified when the class is instantiated.

Parameters:
  • columns (list or tuple) – a list of the columns in this table
  • name (str) – the name of this container
  • data (ndarray or list or tuple or Dataset or AbstractDataChunkIterator or DataIO or FORMDataset) – the source of the data
  • parent (NWBContainer) – the parent Container for this Container
  • container_source (object) – the source of this Container e.g. file name
columns
add_row(values)
Parameters:values (dict) – the values for each column
which(**kwargs)

Query a table

__getitem__(args)
class pynwb.core.NWBTableRegion(name, table, region)

Bases: pynwb.core.NWBData, pynwb.form.container.DataRegion

A class for representing regions i.e. slices or indices into an NWBTable

Parameters:
  • name (str) – the name of this container
  • table (NWBTable) – the ElectrodeTable this region applies to
  • region (slice or list or tuple or RegionReference) – the indices of the table
table

The ElectrodeTable this region applies to

region

The indices into table

__getitem__(idx)
class pynwb.core.MultiContainerInterface(source, name, parent=None, container_source=None)

Bases: pynwb.core.NWBDataInterface

A class for dynamically defining a API classes that represent NWBDataInterfaces that contain multiple Containers of the same type

To use, extend this class, and create a dictionary as a class attribute with the following keys:

  • ‘add’ to name the method for adding Container instances
  • ‘create’ to name the method fo creating Container instances
  • ‘get’ to name the method for getting Container instances
  • ‘attr’ to name the attribute that stores the Container instances
  • ‘type’ to provide the Container object type

See LFP or Position for an example of how to use this.

Parameters:
  • source (str) – a description of where this NWBContainer came from
  • name (str) – the name of this container
  • parent (NWBContainer) – the parent Container for this Container
  • container_source (object) – the source of this Container e.g. file name