Skip to content

Commit

Permalink
placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
mavaylon1 committed Sep 11, 2023
1 parent afe5dd5 commit 92bf180
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/hdmf/backends/hdf5/h5tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@

H5PY_3 = h5py.__version__.startswith('3')

def create_herd():
from ...common.resources import HERD # Circular import fix
return HERD()

class HDF5IO(HDMFIO):

Expand Down Expand Up @@ -357,8 +354,6 @@ def copy_file(self, **kwargs):
source_file.close()
dest_file.close()



@docval({'name': 'container', 'type': Container, 'doc': 'the Container object to write'},
{'name': 'cache_spec', 'type': bool,
'doc': ('If True (default), cache specification to file (highly recommended). If False, do not cache '
Expand All @@ -384,19 +379,21 @@ def write(self, **kwargs):
"Please use mode 'r+', 'w', 'w-', 'x', or 'a'")
% (self.source, self.__mode))

# import HERD
herd = create_herd()
try:
herd = HERD()
except NameError:
from ...common.resources import HERD # Circular import fix

cache_spec = popargs('cache_spec', kwargs)
write_herd = popargs('write_herd', kwargs)
herd_path = popargs('herd_path', kwargs)

Check failure on line 389 in src/hdmf/backends/hdf5/h5tools.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (F821)

src/hdmf/backends/hdf5/h5tools.py:389:39: F821 Undefined name `container`
if write_herd:
if herd_path is not None:
# herd = HERD().from_zip(path=herd_path)
herd = HERD().from_zip(path=herd_path)
# populate HERD instance with all instances of TermSetWrapper
herd.add_ref_term_set(container) # container would be the NWBFile
else:
# herd = HERD()
herd = HERD()
# populate HERD instance with all instances of TermSetWrapper
herd.add_ref_term_set(kwargs['container']) # container would be the NWBFile

Check failure on line 398 in src/hdmf/backends/hdf5/h5tools.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (T100)

src/hdmf/backends/hdf5/h5tools.py:398:9: T100 Trace found: `breakpoint` used
if herd_path is not None:
Expand Down

0 comments on commit 92bf180

Please sign in to comment.