-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare for version 2.5.0 release (#550)
- Loading branch information
Showing
13 changed files
with
244 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,6 @@ jobs: | |
vmImage: $(imageName) | ||
|
||
steps: | ||
|
||
- checkout: self | ||
submodules: true | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
# pinned dependencies to reproduce an entire development environment to use HDMF, run HDMF tests, check code style, | ||
# compute coverage, and create test environments | ||
codecov==2.1.10 | ||
coverage==5.3 | ||
flake8==3.8.4 | ||
codecov==2.1.11 | ||
coverage==5.5 | ||
flake8==3.9.1 | ||
flake8-debugger==4.0.0 | ||
flake8-print==4.0.0 | ||
importlib-metadata<2 | ||
importlib-metadata==4.0.1 | ||
python-dateutil==2.8.1 | ||
tox==3.20.1 | ||
tox==3.23.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule hdmf-common-schema
updated
5 files
+2 −3 | .github/PULL_REQUEST_TEMPLATE/release.md | |
+1 −1 | common/namespace.yaml | |
+1 −1 | docs/source/conf.py | |
+2 −2 | docs/source/format_release_notes.rst | |
+16 −17 | docs/source/software_process.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
from h5py import File | ||
|
||
from hdmf.backends.hdf5 import HDF5IO | ||
from hdmf.common import Container, get_manager | ||
from hdmf.spec import NamespaceCatalog | ||
from hdmf.testing import TestCase, remove_test_file | ||
|
||
from tests.unit.utils import get_temp_filepath | ||
|
||
|
||
class TestCacheSpec(TestCase): | ||
"""Test caching spec specifically with the namespaces provided by hdmf.common. | ||
See also TestCacheSpec in tests/unit/test_io_hdf5_h5tools.py. | ||
""" | ||
|
||
def setUp(self): | ||
self.manager = get_manager() | ||
self.path = get_temp_filepath() | ||
self.container = Container('dummy') | ||
|
||
def tearDown(self): | ||
remove_test_file(self.path) | ||
|
||
def test_write_no_cache_spec(self): | ||
"""Roundtrip test for not writing spec.""" | ||
with HDF5IO(self.path, manager=self.manager, mode="a") as io: | ||
io.write(self.container, cache_spec=False) | ||
with File(self.path, 'r') as f: | ||
self.assertNotIn('specifications', f) | ||
|
||
def test_write_cache_spec(self): | ||
"""Roundtrip test for writing spec and reading it back in.""" | ||
with HDF5IO(self.path, manager=self.manager, mode="a") as io: | ||
io.write(self.container) | ||
with File(self.path, 'r') as f: | ||
self.assertIn('specifications', f) | ||
self._check_spec() | ||
|
||
def test_write_cache_spec_injected(self): | ||
"""Roundtrip test for writing spec and reading it back in when HDF5IO is passed an open h5py.File.""" | ||
with File(self.path, 'w') as fil: | ||
with HDF5IO(self.path, manager=self.manager, file=fil, mode='a') as io: | ||
io.write(self.container) | ||
with File(self.path, 'r') as f: | ||
self.assertIn('specifications', f) | ||
self._check_spec() | ||
|
||
def _check_spec(self): | ||
ns_catalog = NamespaceCatalog() | ||
HDF5IO.load_namespaces(ns_catalog, self.path) | ||
self.maxDiff = None | ||
for namespace in self.manager.namespace_catalog.namespaces: | ||
with self.subTest(namespace=namespace): | ||
original_ns = self.manager.namespace_catalog.get_namespace(namespace) | ||
cached_ns = ns_catalog.get_namespace(namespace) | ||
ns_fields_to_check = list(original_ns.keys()) | ||
ns_fields_to_check.remove('schema') # schema fields will not match, so reset | ||
for ns_field in ns_fields_to_check: | ||
with self.subTest(namespace_field=ns_field): | ||
self.assertEqual(original_ns[ns_field], cached_ns[ns_field]) | ||
for dt in original_ns.get_registered_types(): | ||
with self.subTest(data_type=dt): | ||
original_spec = original_ns.get_spec(dt) | ||
cached_spec = cached_ns.get_spec(dt) | ||
with self.subTest('Data type spec is read back in'): | ||
self.assertIsNotNone(cached_spec) | ||
with self.subTest('Cached spec matches original spec'): | ||
self.assertDictEqual(original_spec, cached_spec) |
Oops, something went wrong.