Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use HDMF 2.5.0 #1354

Merged
merged 11 commits into from
Apr 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Legal.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
“pynwb” Copyright (c) 2017-2020, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved.
“pynwb” Copyright (c) 2017-2021, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved.

If you have questions about your rights to use or distribute this software, please contact Berkeley Lab's Innovation & Partnerships Office at [email protected].

Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ For details on how to contribute to PyNWB see our `contribution guidelines <docs
LICENSE
=======

"pynwb" Copyright (c) 2017-2019, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved.
"pynwb" Copyright (c) 2017-2021, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

(1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Expand All @@ -93,7 +93,7 @@ You are under no obligation whatsoever to provide any bug fixes, patches, or upg
COPYRIGHT
=========

"pynwb" Copyright (c) 2017-2020, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved.
"pynwb" Copyright (c) 2017-2021, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved.
If you have questions about your rights to use or distribute this software, please contact Berkeley Lab's Innovation & Partnerships Office at [email protected].

NOTICE. This Software was developed under funding from the U.S. Department of Energy and the U.S. Government consequently retains certain rights. As such, the U.S. Government has been granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, distribute copies to the public, prepare derivative works, and perform publicly and display publicly, and to permit other to do so.
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@

# General information about the project.
project = u'PyNWB'
copyright = u'2017-2020, Neurodata Without Borders'
copyright = u'2017-2021, Neurodata Without Borders'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down
2 changes: 1 addition & 1 deletion license.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
“pynwb” Copyright (c) 2017-2020, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved.
“pynwb” Copyright (c) 2017-2021, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Expand Down
2 changes: 1 addition & 1 deletion requirements-min.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# these minimum requirements specify '==' for testing; setup.py replaces '==' with '>='
h5py==2.9 # support for setting attrs to lists of utf-8 added in 2.9
hdmf==2.4
hdmf==2.5
numpy==1.16
pandas==0.23
python-dateutil==2.7
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
h5py==2.10.0
hdmf==2.4.0
hdmf==2.5.0
numpy==1.18.5
pandas==0.25.3
python-dateutil==2.8.1
6 changes: 2 additions & 4 deletions src/pynwb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@ def _get_resources():
__NS_CATALOG = NamespaceCatalog(NWBGroupSpec, NWBDatasetSpec, NWBNamespace)

hdmf_typemap = hdmf.common.get_type_map()
__NS_CATALOG.merge(hdmf_typemap.namespace_catalog)

__TYPE_MAP = TypeMap(__NS_CATALOG)
__TYPE_MAP.merge(hdmf_typemap)
__TYPE_MAP.merge(hdmf_typemap, ns_catalog=True)


@docval({'name': 'extensions', 'type': (str, TypeMap, list),
Expand Down Expand Up @@ -185,7 +183,7 @@ def get_sum(self, a, b):

"""
neurodata_type, namespace = getargs('neurodata_type', 'namespace', kwargs)
return __TYPE_MAP.get_container_cls(namespace, neurodata_type)
return __TYPE_MAP.get_container_cls(neurodata_type, namespace)


@docval({'name': 'io', 'type': HDMFIO, 'doc': 'the HDMFIO object to read from'},
Expand Down
Binary file removed test.h5
Binary file not shown.
3 changes: 1 addition & 2 deletions tests/integration/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,7 @@ def test_append(self):
self.assertIs(nwb.processing['test_proc_mod']['LFP'].electrical_series['test_es'].electrodes,
nwb.acquisition['timeseries2'].electrodes)
errors = validate(io)
for e in errors:
print('ERROR', e)
self.assertTrue(len(errors) == 0)


class TestH5DataIO(TestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ def test_print_file(self):

class TestAvailableNamespaces(TestCase):
def test_available_namespaces(self):
self.assertEqual(available_namespaces(), ('hdmf-common', 'core'))
self.assertEqual(available_namespaces(), ('hdmf-common', 'hdmf-experimental', 'core'))
29 changes: 2 additions & 27 deletions tests/unit/test_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def test_load_namespace(self):
def test_get_class(self):
self.test_export()
type_map = get_type_map(extensions=os.path.join(self.tempdir, self.ns_path))
type_map.get_container_cls(self.prefix, 'TetrodeSeries')
type_map.get_container_cls('TetrodeSeries', self.prefix)

def test_load_namespace_with_reftype_attribute(self):
ns_builder = NWBNamespaceBuilder('Extension for use in my Lab', self.prefix, version='0.1.0')
Expand All @@ -74,7 +74,7 @@ def test_load_namespace_with_reftype_attribute_check_autoclass_const(self):
ns_builder.add_spec(self.ext_source, test_ds_ext)
ns_builder.export(self.ns_path, outdir=self.tempdir)
type_map = get_type_map(extensions=os.path.join(self.tempdir, self.ns_path))
my_new_type = type_map.get_container_cls(self.prefix, 'my_new_type')
my_new_type = type_map.get_container_cls('my_new_type', self.prefix)
docval = None
for tmp in get_docval(my_new_type.__init__):
if tmp['name'] == 'target_ds':
Expand Down Expand Up @@ -169,28 +169,3 @@ def test_catch_dup_name(self):
ns_builder2.export(self.ns_path2, outdir=self.tempdir)
type_map = get_type_map(extensions=os.path.join(self.tempdir, self.ns_path1))
type_map.load_namespaces(os.path.join(self.tempdir, self.ns_path2))


class TestCatchDuplicateSpec(TestCase):

def setUp(self):
self.prefix = id_generator()
self.ext_source = '%s_extension3.yaml' % self.prefix

def tearDown(self):
pass

def test_catch_duplicate_spec(self):
spec1 = NWBGroupSpec("This is my new group 1",
"Group1",
neurodata_type_inc="NWBDataInterface",
neurodata_type_def="Group1")
spec2 = NWBGroupSpec("This is my new group 2",
"Group2",
groups=[spec1],
neurodata_type_inc="NWBDataInterface",
neurodata_type_def="Group2")
ns_builder = NWBNamespaceBuilder("Example namespace", "pynwb_test_ext", version='0.1.0')
ns_builder.add_spec(self.ext_source, spec1)
with self.assertRaises(ValueError):
ns_builder.add_spec(self.ext_source, spec2)
10 changes: 8 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -136,22 +136,28 @@ basepython = python3.9
deps = {[testenv:gallery]deps}
commands = {[testenv:gallery]commands}


# Test with python 3.8, pinned dev and doc reqs, and upgraded run requirements
[testenv:gallery-py38-upgrade-dev]
basepython = python3.8
install_command =
pip install -U -e . {opts} {packages}
deps =
-rrequirements-dev.txt
-rrequirements-doc.txt
commands = {[testenv:gallery]commands}

# Test with python 3.8, pinned dev and doc reqs, and pre-release run requirements
[testenv:gallery-py38-upgrade-dev-pre]
basepython = python3.8
install_command =
pip install -U --pre -e . {opts} {packages}
deps =
-rrequirements-dev.txt
-rrequirements-doc.txt
commands = {[testenv:gallery]commands}

# Test with python 3.6, pinned dev reqs, and minimum run requirements
[testenv:gallery-py36-min-req]
basepython = python3.6
deps =
Expand All @@ -160,8 +166,8 @@ deps =
-rrequirements-doc.txt
commands = {[testenv:gallery]commands}

[testenv:validation-py37]
basepython = python3.7
[testenv:validation-py38]
basepython = python3.8
install_command =
pip install -U {opts} {packages}
deps =
Expand Down