Skip to content

Commit

Permalink
Merge pull request #573 from t-b/move-device-into-separate-file
Browse files Browse the repository at this point in the history
Create a separate file for the Device object
  • Loading branch information
bendichter authored Jul 30, 2018
2 parents 162ec7b + 881e4f8 commit 9cfdacc
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 18 deletions.
2 changes: 1 addition & 1 deletion docs/gallery/domain/ecephys.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
device = nwbfile.create_device(name='trodes_rig123', source="a source")

#######################
# Once you have created the :py:class:`~pynwb.ecephys.Device`, you can create an
# Once you have created the :py:class:`~pynwb.device.Device`, you can create an
# :py:class:`~pynwb.ecephys.ElectrodeGroup`.

electrode_name = 'tetrode1'
Expand Down
4 changes: 2 additions & 2 deletions docs/gallery/domain/icephys.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
# Device metadata
# ^^^^^^^^^^^^^^^
#
# Device metadata is represented by :py:class:`~pynwb.ecephys.Device` objects.
# To create a device, you can use the :py:class:`~pynwb.ecephys.Device` instance method
# Device metadata is represented by :py:class:`~pynwb.device.Device` objects.
# To create a device, you can use the :py:class:`~pynwb.device.Device` instance method
# :py:meth:`~pynwb.file.NWBFile.create_device`.

device = nwbfile.create_device(name='Heka ITC-1600', source='a source')
Expand Down
1 change: 1 addition & 0 deletions src/pynwb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ def __init__(self, **kwargs):
from .file import NWBFile # noqa: E402, F401

from . import behavior # noqa: F401,E402
from . import device # noqa: F401,E402
from . import ecephys # noqa: F401,E402
from . import epoch # noqa: F401,E402
from . import icephys # noqa: F401,E402
Expand Down
18 changes: 18 additions & 0 deletions src/pynwb/device.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from .form.utils import docval, call_docval_func
from . import register_class, CORE_NAMESPACE
from .core import NWBContainer


@register_class('Device', CORE_NAMESPACE)
class Device(NWBContainer):
"""
"""

__nwbfields__ = ('name',)

@docval({'name': 'name', 'type': str, 'doc': 'the name of this device'},
{'name': 'source', 'type': str, 'doc': 'the source of the data'},
{'name': 'parent', 'type': 'NWBContainer',
'doc': 'The parent NWBContainer for this NWBContainer', 'default': None})
def __init__(self, **kwargs):
call_docval_func(super(Device, self).__init__, kwargs)
16 changes: 1 addition & 15 deletions src/pynwb/ecephys.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,7 @@
from . import register_class, CORE_NAMESPACE
from .base import TimeSeries, _default_resolution, _default_conversion
from .core import NWBContainer, NWBTable, NWBTableRegion, NWBDataInterface, MultiContainerInterface


@register_class('Device', CORE_NAMESPACE)
class Device(NWBContainer):
"""
"""

__nwbfields__ = ('name',)

@docval({'name': 'name', 'type': str, 'doc': 'the name of this device'},
{'name': 'source', 'type': str, 'doc': 'the source of the data'},
{'name': 'parent', 'type': 'NWBContainer',
'doc': 'The parent NWBContainer for this NWBContainer', 'default': None})
def __init__(self, **kwargs):
call_docval_func(super(Device, self).__init__, kwargs)
from .device import Device


@register_class('ElectrodeGroup', CORE_NAMESPACE)
Expand Down

0 comments on commit 9cfdacc

Please sign in to comment.