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

[Bug]: regression in 2.3.0 leading to IndexError #1650

Closed
3 tasks done
yarikoptic opened this issue Feb 24, 2023 · 1 comment · Fixed by #1651
Closed
3 tasks done

[Bug]: regression in 2.3.0 leading to IndexError #1650

yarikoptic opened this issue Feb 24, 2023 · 1 comment · Fixed by #1651

Comments

@yarikoptic
Copy link
Contributor

What happened?

original report dandi/dandi-cli#1223 for test failing while working on data from https://github.com/dandisets/nwb_test_data/tree/master/v2.0.1

Steps to Reproduce

see below in traceback demo

Traceback

python -c 'from dandi.metadata import get_metadata; print(get_metadata("/home/yoh/proj/dandi/nwb-datasets/nwb_test_data/v2.0.1/test_Subject.nwb"))'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/yoh/proj/dandi/dandi-cli-master/venvs/dev3.11/lib/python3.11/site-packages/fscacher/cache.py", line 152, in fingerprinter
    ret = fingerprinted(*args, **kwargs_)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yoh/proj/dandi/dandi-cli-master/venvs/dev3.11/lib/python3.11/site-packages/joblib/memory.py", line 594, in __call__
    return self._cached_call(args, kwargs)[0]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yoh/proj/dandi/dandi-cli-master/venvs/dev3.11/lib/python3.11/site-packages/joblib/memory.py", line 537, in _cached_call
    out, metadata = self.call(*args, **kwargs)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yoh/proj/dandi/dandi-cli-master/venvs/dev3.11/lib/python3.11/site-packages/joblib/memory.py", line 779, in call
    output = self.func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yoh/proj/dandi/dandi-cli-master/venvs/dev3.11/lib/python3.11/site-packages/fscacher/cache.py", line 98, in fingerprinted
    return f(path, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yoh/proj/dandi/dandi-cli-master/dandi/metadata.py", line 131, in get_metadata
    meta.update(_get_pynwb_metadata(path))
                ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yoh/proj/dandi/dandi-cli-master/dandi/pynwb_utils.py", line 193, in _get_pynwb_metadata
    nwb = io.read()
          ^^^^^^^^^
  File "/home/yoh/proj/dandi/dandi-cli-master/venvs/dev3.11/lib/python3.11/site-packages/hdmf/utils.py", line 645, in func_call
    return func(args[0], **pargs)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yoh/proj/dandi/dandi-cli-master/venvs/dev3.11/lib/python3.11/site-packages/pynwb/__init__.py", line 287, in read
    return super().read(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yoh/proj/dandi/dandi-cli-master/venvs/dev3.11/lib/python3.11/site-packages/hdmf/backends/hdf5/h5tools.py", line 453, in read
    return super().read(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yoh/proj/dandi/dandi-cli-master/venvs/dev3.11/lib/python3.11/site-packages/hdmf/utils.py", line 645, in func_call
    return func(args[0], **pargs)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yoh/proj/dandi/dandi-cli-master/venvs/dev3.11/lib/python3.11/site-packages/hdmf/backends/io.py", line 42, in read
    container = self.__manager.construct(f_builder)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yoh/proj/dandi/dandi-cli-master/venvs/dev3.11/lib/python3.11/site-packages/hdmf/utils.py", line 645, in func_call
    return func(args[0], **pargs)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yoh/proj/dandi/dandi-cli-master/venvs/dev3.11/lib/python3.11/site-packages/hdmf/build/manager.py", line 280, in construct
    result = self.__type_map.construct(builder, self, None)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yoh/proj/dandi/dandi-cli-master/venvs/dev3.11/lib/python3.11/site-packages/hdmf/utils.py", line 645, in func_call
    return func(args[0], **pargs)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yoh/proj/dandi/dandi-cli-master/venvs/dev3.11/lib/python3.11/site-packages/hdmf/build/manager.py", line 789, in construct
    return obj_mapper.construct(builder, build_manager, parent)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yoh/proj/dandi/dandi-cli-master/venvs/dev3.11/lib/python3.11/site-packages/hdmf/utils.py", line 645, in func_call
    return func(args[0], **pargs)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yoh/proj/dandi/dandi-cli-master/venvs/dev3.11/lib/python3.11/site-packages/hdmf/build/objectmapper.py", line 1218, in construct
    subspecs = self.__get_subspec_values(builder, self.spec, manager)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yoh/proj/dandi/dandi-cli-master/venvs/dev3.11/lib/python3.11/site-packages/hdmf/build/objectmapper.py", line 1147, in __get_subspec_values
    self.__get_sub_builders(groups, spec.groups, manager, ret)
  File "/home/yoh/proj/dandi/dandi-cli-master/venvs/dev3.11/lib/python3.11/site-packages/hdmf/build/objectmapper.py", line 1198, in __get_sub_builders
    ret.update(self.__get_subspec_values(sub_builder, subspec, manager))
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yoh/proj/dandi/dandi-cli-master/venvs/dev3.11/lib/python3.11/site-packages/hdmf/build/objectmapper.py", line 1147, in __get_subspec_values
    self.__get_sub_builders(groups, spec.groups, manager, ret)
  File "/home/yoh/proj/dandi/dandi-cli-master/venvs/dev3.11/lib/python3.11/site-packages/hdmf/build/objectmapper.py", line 1200, in __get_sub_builders
    ret[subspec] = manager.construct(sub_builder)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yoh/proj/dandi/dandi-cli-master/venvs/dev3.11/lib/python3.11/site-packages/hdmf/utils.py", line 645, in func_call
    return func(args[0], **pargs)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yoh/proj/dandi/dandi-cli-master/venvs/dev3.11/lib/python3.11/site-packages/hdmf/build/manager.py", line 276, in construct
    result = self.__type_map.construct(builder, self, parent)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yoh/proj/dandi/dandi-cli-master/venvs/dev3.11/lib/python3.11/site-packages/hdmf/utils.py", line 645, in func_call
    return func(args[0], **pargs)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yoh/proj/dandi/dandi-cli-master/venvs/dev3.11/lib/python3.11/site-packages/hdmf/build/manager.py", line 789, in construct
    return obj_mapper.construct(builder, build_manager, parent)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yoh/proj/dandi/dandi-cli-master/venvs/dev3.11/lib/python3.11/site-packages/hdmf/utils.py", line 645, in func_call
    return func(args[0], **pargs)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yoh/proj/dandi/dandi-cli-master/venvs/dev3.11/lib/python3.11/site-packages/hdmf/build/objectmapper.py", line 1239, in construct
    override = self.__get_override_carg(argname, builder, manager)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yoh/proj/dandi/dandi-cli-master/venvs/dev3.11/lib/python3.11/site-packages/hdmf/build/objectmapper.py", line 524, in __get_override_carg
    return func(self, *remaining_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yoh/proj/dandi/dandi-cli-master/venvs/dev3.11/lib/python3.11/site-packages/pynwb/io/file.py", line 232, in age_reference_none
    if get_nwb_version(builder) < (2, 6, 0):
       ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yoh/proj/dandi/dandi-cli-master/venvs/dev3.11/lib/python3.11/site-packages/pynwb/io/utils.py", line 31, in get_nwb_version
    nwb_version_match = re.match(r"(\d+\.\d+\.\d+)", nwb_version)[0]  # trim off any non-numeric symbols at end
                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^

you can see at the bottom of the traceback -- assumption is that version matches semver but it does not:

❯ python -c 'from dandi.pynwb_utils import get_nwb_version;print(get_nwb_version("/home/yoh/proj/dandi/nwb-datasets/nwb_test_data/v2.0.1/test_Subject.nwb"))'
2.0b


below please add 3.11 as a choice of Python version

Operating System

Linux

Python Executable

Conda

Python Version

3.10

Package Versions

No response

Code of Conduct

@rly
Copy link
Contributor

rly commented Feb 24, 2023

Thanks for the report. I'll look at this today.

@rly rly mentioned this issue Feb 24, 2023
6 tasks
yarikoptic added a commit to dandi/dandi-cli that referenced this issue Feb 24, 2023
@rly rly closed this as completed in #1651 Feb 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants