Skip to content

Commit cec8971

Browse files
authored
Use HDMF 1.5.4 (#1154)
* Use HDMF 1.5.4 * Rename mixin classes to not start with Test* (#1153) * Rename mixin classes to not start with Test* * flake8 fix * Use hdmf 1.5.4 * Use hdmf 1.5.4 * Add version to NWBNamespaceBuilder tests * Add version to NWBNamespaceBuilder in extensions tutorial * Add version 1.1.2 files for backwards compatibility tests
1 parent 35e875a commit cec8971

20 files changed

+69
-72
lines changed

docs/gallery/general/extensions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
ns_path = "mylab.namespace.yaml"
3636
ext_source = "mylab.extensions.yaml"
3737

38-
ns_builder = NWBNamespaceBuilder('Extension for use in my Lab', "mylab")
38+
ns_builder = NWBNamespaceBuilder('Extension for use in my Lab', "mylab", version='0.1.0')
3939

4040
ns_builder.include_type('ElectricalSeries', namespace='core')
4141

@@ -252,7 +252,7 @@ def __init__(self, **kwargs):
252252
ns_path = name + ".namespace.yaml"
253253
ext_source = name + ".extensions.yaml"
254254

255-
ns_builder = NWBNamespaceBuilder(name + ' extensions', name)
255+
ns_builder = NWBNamespaceBuilder(name + ' extensions', name, version='0.1.0')
256256
ns_builder.include_type('NWBDataInterface', namespace='core')
257257

258258
potato = NWBGroupSpec(neurodata_type_def='Potato',
@@ -387,7 +387,7 @@ class PotatoSack(MultiContainerInterface):
387387

388388
# Now we set up the builder and add this object
389389

390-
ns_builder = NWBNamespaceBuilder(name + ' extensions', name)
390+
ns_builder = NWBNamespaceBuilder(name + ' extensions', name, version='0.1.0')
391391
ns_builder.add_spec(ext_source, surface)
392392
ns_builder.export(ns_path)
393393

docs/source/extensions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ Create a new namespace with extensions
166166
from pynwb.spec import NWBGroupSpec, NWBNamespaceBuilder
167167
168168
# create a builder for the namespace
169-
ns_builder = NWBNamespaceBuilder("Extension for use in my laboratory", "mylab", ...)
169+
ns_builder = NWBNamespaceBuilder("Extension for use in my laboratory", "mylab", version='0.1.0', ...)
170170
171171
# create extensions
172172
ext1 = NWBGroupSpec('A custom SpikeEventSeries interface',

requirements-min.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# these minimum requirements specify '==' for testing; setup.py replaces '==' with '>='
22
h5py==2.9 # support for setting attrs to lists of utf-8 added in 2.9
3-
hdmf==1.5.3,<2
3+
hdmf==1.5.4,<2
44
numpy==1.16
55
pandas==0.23
66
python-dateutil==2.7

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
h5py==2.10.0
2-
hdmf==1.5.3
2+
hdmf==1.5.4
33
numpy==1.18.1
44
pandas==0.25.3
55
python-dateutil==2.8.0

src/pynwb/testing/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from hdmf.testing import TestCase, TestH5RoundTripMixin
2-
from .testh5io import TestNWBH5IOMixin, TestAcquisitionH5IOMixin
1+
from hdmf.testing import TestCase, H5RoundTripMixin
2+
from .testh5io import NWBH5IOMixin, AcquisitionH5IOMixin
33
from .utils import remove_test_file
44

55
CORE_NAMESPACE = 'core'

src/pynwb/testing/testh5io.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from hdmf.build.warnings import MissingRequiredWarning, OrphanContainerWarning
1111

1212

13-
class TestNWBH5IOMixin(metaclass=ABCMeta):
13+
class NWBH5IOMixin(metaclass=ABCMeta):
1414
"""
1515
Mixin class for methods to run a roundtrip test writing an NWB file with an Container and reading the Container
1616
from the NWB file. The setUp, test_roundtrip, and tearDown methods will be run by unittest.
@@ -19,15 +19,15 @@ class TestNWBH5IOMixin(metaclass=ABCMeta):
1919
this mixin.
2020
2121
Example:
22-
class TestMyContainerIO(TestNWBH5IOMixin, TestCase):
22+
class TestMyContainerIO(NWBH5IOMixin, TestCase):
2323
def setUpContainer(self):
2424
# return a test Container to read/write
2525
def addContainer(self, nwbfile):
2626
# add the test Container to an NWB file
2727
def getContainer(self, nwbfile):
2828
# return the test Container from an NWB file
2929
30-
This code is adapted from hdmf.testing.TestH5RoundTripMixin.
30+
This code is adapted from hdmf.testing.H5RoundTripMixin.
3131
"""
3232

3333
def setUp(self):
@@ -120,7 +120,7 @@ def validate(self):
120120
raise Exception(err)
121121

122122

123-
class TestAcquisitionH5IOMixin(TestNWBH5IOMixin):
123+
class AcquisitionH5IOMixin(NWBH5IOMixin):
124124
"""
125125
Mixin class for methods to run a roundtrip test writing an NWB file with an Container as an acquisition and reading
126126
the Container as an acquisition from the NWB file. The setUp, test_roundtrip, and tearDown methods will be run by
@@ -129,11 +129,11 @@ class TestAcquisitionH5IOMixin(TestNWBH5IOMixin):
129129
The abstract method setUpContainer needs to be implemented by classes that include this mixin.
130130
131131
Example:
132-
class TestMyContainerIO(TestNWBH5IOMixin, TestCase):
132+
class TestMyContainerIO(NWBH5IOMixin, TestCase):
133133
def setUpContainer(self):
134134
# return a test Container to read/write
135135
136-
This code is adapted from hdmf.testing.TestH5RoundTripMixin.
136+
This code is adapted from hdmf.testing.H5RoundTripMixin.
137137
"""
138138

139139
def addContainer(self, nwbfile):
145 KB
Binary file not shown.
145 KB
Binary file not shown.
145 KB
Binary file not shown.

tests/integration/hdf5/test_base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
from dateutil.tz import tzlocal
44

55
from pynwb import TimeSeries, NWBFile, NWBHDF5IO
6-
from pynwb.testing import TestAcquisitionH5IOMixin, TestCase
6+
from pynwb.testing import AcquisitionH5IOMixin, TestCase
77

88

9-
class TestTimeSeriesIO(TestAcquisitionH5IOMixin, TestCase):
9+
class TestTimeSeriesIO(AcquisitionH5IOMixin, TestCase):
1010

1111
def setUpContainer(self):
1212
""" Return the test TimeSeries to read/write """

0 commit comments

Comments
 (0)