Skip to content

Commit

Permalink
rmv warning from load_namespaces (#926)
Browse files Browse the repository at this point in the history
Co-authored-by: Ryan Ly <[email protected]>
  • Loading branch information
bendichter and rly authored Sep 3, 2023
1 parent 9fe3f9d commit ddc842b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
8 changes: 5 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@

## HDMF 3.9.1 (Upcoming)

### Minor improvements
- Removed warning when namespaces are loaded and the attribute marking where the specs are cached is missing. @bendichter [#926](https://github.com/hdmf-dev/hdmf/pull/926)

### Bug fixes
- Fixed bug allowing `DynamicTable` to be constructed with empty `id` column when initializing all columns via `AbstractDataChunkIterator` objects. @oruebel [#953](https://github.com/hdmf-dev/hdmf/pull/953)


## HDMF 3.9.0 (August 25, 2023)

### New features and minor improvements
- Increase raw data chunk cache size for reading HDF5 files from 1 MiB to 32 MiB. @bendichter, @rly [#925](https://github.com/hdmf-dev/hdmf/pull/925)
- Increase default chunk size for `GenericDataChunkIterator` from 1 MB to 10 MB. @bendichter, @rly [#925](https://github.com/hdmf-dev/hdmf/pull/925)
- Increased raw data chunk cache size for reading HDF5 files from 1 MiB to 32 MiB. @bendichter, @rly [#925](https://github.com/hdmf-dev/hdmf/pull/925)
- Increased default chunk size for `GenericDataChunkIterator` from 1 MB to 10 MB. @bendichter, @rly [#925](https://github.com/hdmf-dev/hdmf/pull/925)
- Added the magic `__reduce__` method as well as two private semi-abstract helper methods to enable pickling of the `GenericDataChunkIterator`. @codycbakerphd [#924](https://github.com/hdmf-dev/hdmf/pull/924)
- Updated `add_ref_termset` to add all instances of `TermSet` within a given root container. @mavaylon1 [#935](https://github.com/hdmf-dev/hdmf/pull/935)
- Added Dynamic Enumerations and Schemasheets support to `TermSet`. @mavaylon1 [#923](https://github.com/hdmf-dev/hdmf/pull/923)
Expand Down
7 changes: 1 addition & 6 deletions src/hdmf/backends/hdf5/h5tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,12 +208,7 @@ def __load_namespaces(cls, namespace_catalog, namespaces, file_obj):

@classmethod
def __check_specloc(cls, file_obj):
if SPEC_LOC_ATTR not in file_obj.attrs:
# this occurs in legacy files
msg = "No cached namespaces found in %s" % file_obj.filename
warnings.warn(msg)
return False
return True
return SPEC_LOC_ATTR in file_obj.attrs

@classmethod
@docval({'name': 'path', 'type': (str, Path), 'doc': 'the path to the HDF5 file', 'default': None},
Expand Down
8 changes: 2 additions & 6 deletions tests/unit/test_io_hdf5_h5tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -2159,9 +2159,7 @@ def test_load_namespaces_no_specloc(self):

# load the namespace from file
ns_catalog = NamespaceCatalog()
msg = "No cached namespaces found in %s" % self.path
with self.assertWarnsWith(UserWarning, msg):
ret = HDF5IO.load_namespaces(ns_catalog, self.path)
ret = HDF5IO.load_namespaces(ns_catalog, self.path)
self.assertDictEqual(ret, {})

def test_load_namespaces_resolve_custom_deps(self):
Expand Down Expand Up @@ -2375,9 +2373,7 @@ def test_get_namespaces_no_specloc(self):
del f.attrs[SPEC_LOC_ATTR]

# load the namespace from file
msg = "No cached namespaces found in %s" % self.path
with self.assertWarnsWith(UserWarning, msg):
ret = HDF5IO.get_namespaces(path=self.path)
ret = HDF5IO.get_namespaces(path=self.path)
self.assertDictEqual(ret, {})


Expand Down

0 comments on commit ddc842b

Please sign in to comment.