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

error opening neuropixel data #1180

Open
bendichter opened this issue Feb 7, 2020 · 5 comments
Open

error opening neuropixel data #1180

bendichter opened this issue Feb 7, 2020 · 5 comments
Assignees
Labels

Comments

@bendichter
Copy link
Contributor

@bendichter bendichter commented Feb 7, 2020

Description

Trying to read http://api.brain-map.org//api/v2/well_known_file_download/953132529 in pynwb

Steps to Reproduce

from pynwb import NWBHDF5IO
fpath = '/Volumes/easystore5T/data/Allen/neuropixel/ecephys_session_715093703.nwb'
nwb = NWBHDF5IO(fpath,'r').read()
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/objectmapper.py in construct(self, **kwargs)
    967                               object_id=builder.attributes.get(self.__spec.id_key()))
--> 968             obj.__init__(**kwargs)
    969         except Exception as ex:

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/utils.py in func_call(*args, **kwargs)
    452             if is_method:
--> 453                 return func(args[0], **parsed['args'])
    454             else:

~/opt/anaconda3/lib/python3.7/site-packages/pynwb/epoch.py in __init__(self, **kwargs)
     30     def __init__(self, **kwargs):
---> 31         call_docval_func(super(TimeIntervals, self).__init__, kwargs)
     32 

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/utils.py in call_docval_func(func, kwargs)
    342     fargs, fkwargs = fmt_docval_args(func, kwargs)
--> 343     return func(*fargs, **fkwargs)
    344 

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/utils.py in func_call(*args, **kwargs)
    452             if is_method:
--> 453                 return func(args[0], **parsed['args'])
    454             else:

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/common/table.py in __init__(self, **kwargs)
    273             if hasattr(self, col.name):
--> 274                 raise ValueError("Column name '%s' is not allowed because it is already an attribute" % col.name)
    275             setattr(self, col.name, col)

ValueError: Column name 'name' is not allowed because it is already an attribute

The above exception was the direct cause of the following exception:

Exception                                 Traceback (most recent call last)
<ipython-input-1-4745dc79544c> in <module>
      2 
      3 fpath = '/Volumes/easystore5T/data/Allen/neuropixel/ecephys_session_715093703.nwb'
----> 4 nwb = NWBHDF5IO(fpath,'r').read()

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/backends/hdf5/h5tools.py in read(self, **kwargs)
    294                                        % (self.__path, self.__mode))
    295         try:
--> 296             return call_docval_func(super().read, kwargs)
    297         except UnsupportedOperation as e:
    298             if str(e) == 'Cannot build data. There are no values.':

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/utils.py in call_docval_func(func, kwargs)
    341 def call_docval_func(func, kwargs):
    342     fargs, fkwargs = fmt_docval_args(func, kwargs)
--> 343     return func(*fargs, **fkwargs)
    344 
    345 

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/utils.py in func_call(*args, **kwargs)
    451 
    452             if is_method:
--> 453                 return func(args[0], **parsed['args'])
    454             else:
    455                 return func(**parsed['args'])

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/backends/io.py in read(self, **kwargs)
     33             # TODO also check that the keys are appropriate. print a better error message
     34             raise UnsupportedOperation('Cannot build data. There are no values.')
---> 35         container = self.__manager.construct(f_builder)
     36         return container
     37 

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/utils.py in func_call(*args, **kwargs)
    451 
    452             if is_method:
--> 453                 return func(args[0], **parsed['args'])
    454             else:
    455                 return func(**parsed['args'])

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/manager.py in construct(self, **kwargs)
    195                 # we are at the top of the hierarchy,
    196                 # so it must be time to resolve parents
--> 197                 result = self.__type_map.construct(builder, self, None)
    198                 self.__resolve_parents(result)
    199             self.prebuilt(result, builder)

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/utils.py in func_call(*args, **kwargs)
    451 
    452             if is_method:
--> 453                 return func(args[0], **parsed['args'])
    454             else:
    455                 return func(**parsed['args'])

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/manager.py in construct(self, **kwargs)
    766             raise ValueError('No ObjectMapper found for builder of type %s' % dt)
    767         else:
--> 768             return obj_mapper.construct(builder, build_manager, parent)
    769 
    770     @docval({"name": "container", "type": AbstractContainer, "doc": "the container to convert to a Builder"},

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/utils.py in func_call(*args, **kwargs)
    451 
    452             if is_method:
--> 453                 return func(args[0], **parsed['args'])
    454             else:
    455                 return func(**parsed['args'])

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/objectmapper.py in construct(self, **kwargs)
    934         cls = manager.get_cls(builder)
    935         # gather all subspecs
--> 936         subspecs = self.__get_subspec_values(builder, self.spec, manager)
    937         # get the constructor argument that each specification corresponds to
    938         const_args = dict()

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/objectmapper.py in __get_subspec_values(self, builder, spec, manager)
    864                         ret[subspec] = self.__flatten(sub_builder, subspec, manager)
    865             # now process groups and datasets
--> 866             self.__get_sub_builders(groups, spec.groups, manager, ret)
    867             self.__get_sub_builders(datasets, spec.datasets, manager, ret)
    868         elif isinstance(spec, DatasetSpec):

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/objectmapper.py in __get_sub_builders(self, sub_builders, subspecs, manager, ret)
    914                 if dt is None:
    915                     # recurse
--> 916                     ret.update(self.__get_subspec_values(sub_builder, subspec, manager))
    917                 else:
    918                     ret[subspec] = manager.construct(sub_builder)

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/objectmapper.py in __get_subspec_values(self, builder, spec, manager)
    864                         ret[subspec] = self.__flatten(sub_builder, subspec, manager)
    865             # now process groups and datasets
--> 866             self.__get_sub_builders(groups, spec.groups, manager, ret)
    867             self.__get_sub_builders(datasets, spec.datasets, manager, ret)
    868         elif isinstance(spec, DatasetSpec):

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/objectmapper.py in __get_sub_builders(self, sub_builders, subspecs, manager, ret)
    906                 sub_builder = builder_dt.get(dt)
    907                 if sub_builder is not None:
--> 908                     sub_builder = self.__flatten(sub_builder, subspec, manager)
    909                     ret[subspec] = sub_builder
    910             else:

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/objectmapper.py in __flatten(self, sub_builder, subspec, manager)
    919 
    920     def __flatten(self, sub_builder, subspec, manager):
--> 921         tmp = [manager.construct(b) for b in sub_builder]
    922         if len(tmp) == 1 and not subspec.is_many():
    923             tmp = tmp[0]

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/objectmapper.py in <listcomp>(.0)
    919 
    920     def __flatten(self, sub_builder, subspec, manager):
--> 921         tmp = [manager.construct(b) for b in sub_builder]
    922         if len(tmp) == 1 and not subspec.is_many():
    923             tmp = tmp[0]

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/utils.py in func_call(*args, **kwargs)
    451 
    452             if is_method:
--> 453                 return func(args[0], **parsed['args'])
    454             else:
    455                 return func(**parsed['args'])

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/manager.py in construct(self, **kwargs)
    191             if parent_builder is not None:
    192                 parent = self.__get_proxy_builder(parent_builder)
--> 193                 result = self.__type_map.construct(builder, self, parent)
    194             else:
    195                 # we are at the top of the hierarchy,

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/utils.py in func_call(*args, **kwargs)
    451 
    452             if is_method:
--> 453                 return func(args[0], **parsed['args'])
    454             else:
    455                 return func(**parsed['args'])

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/manager.py in construct(self, **kwargs)
    766             raise ValueError('No ObjectMapper found for builder of type %s' % dt)
    767         else:
--> 768             return obj_mapper.construct(builder, build_manager, parent)
    769 
    770     @docval({"name": "container", "type": AbstractContainer, "doc": "the container to convert to a Builder"},

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/utils.py in func_call(*args, **kwargs)
    451 
    452             if is_method:
--> 453                 return func(args[0], **parsed['args'])
    454             else:
    455                 return func(**parsed['args'])

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/objectmapper.py in construct(self, **kwargs)
    934         cls = manager.get_cls(builder)
    935         # gather all subspecs
--> 936         subspecs = self.__get_subspec_values(builder, self.spec, manager)
    937         # get the constructor argument that each specification corresponds to
    938         const_args = dict()

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/objectmapper.py in __get_subspec_values(self, builder, spec, manager)
    864                         ret[subspec] = self.__flatten(sub_builder, subspec, manager)
    865             # now process groups and datasets
--> 866             self.__get_sub_builders(groups, spec.groups, manager, ret)
    867             self.__get_sub_builders(datasets, spec.datasets, manager, ret)
    868         elif isinstance(spec, DatasetSpec):

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/objectmapper.py in __get_sub_builders(self, sub_builders, subspecs, manager, ret)
    906                 sub_builder = builder_dt.get(dt)
    907                 if sub_builder is not None:
--> 908                     sub_builder = self.__flatten(sub_builder, subspec, manager)
    909                     ret[subspec] = sub_builder
    910             else:

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/objectmapper.py in __flatten(self, sub_builder, subspec, manager)
    919 
    920     def __flatten(self, sub_builder, subspec, manager):
--> 921         tmp = [manager.construct(b) for b in sub_builder]
    922         if len(tmp) == 1 and not subspec.is_many():
    923             tmp = tmp[0]

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/objectmapper.py in <listcomp>(.0)
    919 
    920     def __flatten(self, sub_builder, subspec, manager):
--> 921         tmp = [manager.construct(b) for b in sub_builder]
    922         if len(tmp) == 1 and not subspec.is_many():
    923             tmp = tmp[0]

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/utils.py in func_call(*args, **kwargs)
    451 
    452             if is_method:
--> 453                 return func(args[0], **parsed['args'])
    454             else:
    455                 return func(**parsed['args'])

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/manager.py in construct(self, **kwargs)
    191             if parent_builder is not None:
    192                 parent = self.__get_proxy_builder(parent_builder)
--> 193                 result = self.__type_map.construct(builder, self, parent)
    194             else:
    195                 # we are at the top of the hierarchy,

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/utils.py in func_call(*args, **kwargs)
    451 
    452             if is_method:
--> 453                 return func(args[0], **parsed['args'])
    454             else:
    455                 return func(**parsed['args'])

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/manager.py in construct(self, **kwargs)
    766             raise ValueError('No ObjectMapper found for builder of type %s' % dt)
    767         else:
--> 768             return obj_mapper.construct(builder, build_manager, parent)
    769 
    770     @docval({"name": "container", "type": AbstractContainer, "doc": "the container to convert to a Builder"},

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/utils.py in func_call(*args, **kwargs)
    451 
    452             if is_method:
--> 453                 return func(args[0], **parsed['args'])
    454             else:
    455                 return func(**parsed['args'])

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/objectmapper.py in construct(self, **kwargs)
    969         except Exception as ex:
    970             msg = 'Could not construct %s object due to %s' % (cls.__name__, ex)
--> 971             raise Exception(msg) from ex
    972         return obj
    973 

Exception: Could not construct TimeIntervals object due to Column name 'name' is not allowed because it is already an attribute

Environment

conda hdmf-1.6.0 pynwb-1.2.1

Checklist

  • Have you ensured the feature or change was not already reported?
  • Have you included a brief and descriptive title?
  • Have you included a clear description of the problem you are trying to solve?
  • Have you included a minimal code snippet that reproduces the issue you are encountering?
  • Have you checked our Contributing document?
@rly rly self-assigned this Feb 7, 2020
@rly

This comment has been minimized.

Copy link
Contributor

@rly rly commented Feb 7, 2020

The error Could not construct TimeIntervals object due to Column name 'name' is not allowed because it is already an attribute is because the /processing/optotagging/optogenetic_stimuluation DynamicTable has a column named 'name' and the table already has an attribute table.name that is the table name, not the column 'name'. I guess this was not checked in an earlier version of PyNWB/HDMF.

We could:

  1. report this as a bug in their encoding and ask Allen to regenerate the files without the table column "name"
  2. allow naming a column to the name of an existing attribute, and when the table is initialized, table.attr will refer to the original attribute - not the column - and table['attr'] and table.get('attr') are the only ways to get the column. Also, raise a warning in __init__ if this happens.
@oruebel

This comment has been minimized.

Copy link
Contributor

@oruebel oruebel commented Feb 7, 2020

I think we should probably do both. I.e., fix the issue so that the files are usable as well as encourage Allen to change the column name in future releases. We probably should also add at least a warning in DynamicTable when such collisions happen.

@t-b

This comment has been minimized.

Copy link
Collaborator

@t-b t-b commented Feb 8, 2020

And also tell them to cache the specification:

  warnings.warn(msg)
The file 953132529 has no cached namespace information. Falling back to pynwb namespace information.
Validating 953132529 against pynwb namespace information using namespace core.
 - found the following errors:
TimeSeries/data/unit (processing/optotagging/optotagging/data): argument missing
TimeSeries/timestamps (processing/running/running_speed/timestamps): incorrect shape - expected '[None]', got '(2, 366036)'
TimeSeries/timestamps (processing/running/running_speed/timestamps): incorrect shape - expected '[None]', got '(2, 366036)'

using cb5527b (Fix copying files with Subject (#1171), 2020-02-04).

@bendichter

This comment has been minimized.

Copy link
Contributor Author

@bendichter bendichter commented Feb 8, 2020

Good point, @t-b. Those validation errors need to be addressed as well, but do not appear to be the error that is preventing this from being opened.

@bendichter

This comment has been minimized.

Copy link
Contributor Author

@bendichter bendichter commented Mar 8, 2020

@t-b I take it back. When I delete the "names" column using h5py, the timestamps shape now prevents this file from being opened as well:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/objectmapper.py in construct(self, **kwargs)
    967                               object_id=builder.attributes.get(self.__spec.id_key()))
--> 968             obj.__init__(**kwargs)
    969         except Exception as ex:

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/utils.py in func_call(*args, **kwargs)
    449                     msg = '%s: %s' % (func.__qualname__, ', '.join(parse_err))
--> 450                     raise ExceptionType(msg)
    451 

ValueError: TimeSeries.__init__: incorrect shape for 'timestamps' (got '(2, 366036)', expected '(None,)')

The above exception was the direct cause of the following exception:

Exception                                 Traceback (most recent call last)
<ipython-input-2-e797e382c7ea> in <module>
      1 fpath = '/Volumes/easystore5T/data/Allen/neuropixel/ecephys_session_715093703 copy.nwb'
----> 2 nwbfile = NWBHDF5IO(fpath, 'r', load_namespaces=True).read()
      3 
      4 #nwb2widget(nwbfile)
      5 raster_grid_widget(nwbfile.units)

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/backends/hdf5/h5tools.py in read(self, **kwargs)
    294                                        % (self.__path, self.__mode))
    295         try:
--> 296             return call_docval_func(super().read, kwargs)
    297         except UnsupportedOperation as e:
    298             if str(e) == 'Cannot build data. There are no values.':

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/utils.py in call_docval_func(func, kwargs)
    341 def call_docval_func(func, kwargs):
    342     fargs, fkwargs = fmt_docval_args(func, kwargs)
--> 343     return func(*fargs, **fkwargs)
    344 
    345 

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/utils.py in func_call(*args, **kwargs)
    451 
    452             if is_method:
--> 453                 return func(args[0], **parsed['args'])
    454             else:
    455                 return func(**parsed['args'])

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/backends/io.py in read(self, **kwargs)
     33             # TODO also check that the keys are appropriate. print a better error message
     34             raise UnsupportedOperation('Cannot build data. There are no values.')
---> 35         container = self.__manager.construct(f_builder)
     36         return container
     37 

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/utils.py in func_call(*args, **kwargs)
    451 
    452             if is_method:
--> 453                 return func(args[0], **parsed['args'])
    454             else:
    455                 return func(**parsed['args'])

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/manager.py in construct(self, **kwargs)
    195                 # we are at the top of the hierarchy,
    196                 # so it must be time to resolve parents
--> 197                 result = self.__type_map.construct(builder, self, None)
    198                 self.__resolve_parents(result)
    199             self.prebuilt(result, builder)

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/utils.py in func_call(*args, **kwargs)
    451 
    452             if is_method:
--> 453                 return func(args[0], **parsed['args'])
    454             else:
    455                 return func(**parsed['args'])

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/manager.py in construct(self, **kwargs)
    766             raise ValueError('No ObjectMapper found for builder of type %s' % dt)
    767         else:
--> 768             return obj_mapper.construct(builder, build_manager, parent)
    769 
    770     @docval({"name": "container", "type": AbstractContainer, "doc": "the container to convert to a Builder"},

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/utils.py in func_call(*args, **kwargs)
    451 
    452             if is_method:
--> 453                 return func(args[0], **parsed['args'])
    454             else:
    455                 return func(**parsed['args'])

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/objectmapper.py in construct(self, **kwargs)
    934         cls = manager.get_cls(builder)
    935         # gather all subspecs
--> 936         subspecs = self.__get_subspec_values(builder, self.spec, manager)
    937         # get the constructor argument that each specification corresponds to
    938         const_args = dict()

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/objectmapper.py in __get_subspec_values(self, builder, spec, manager)
    864                         ret[subspec] = self.__flatten(sub_builder, subspec, manager)
    865             # now process groups and datasets
--> 866             self.__get_sub_builders(groups, spec.groups, manager, ret)
    867             self.__get_sub_builders(datasets, spec.datasets, manager, ret)
    868         elif isinstance(spec, DatasetSpec):

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/objectmapper.py in __get_sub_builders(self, sub_builders, subspecs, manager, ret)
    914                 if dt is None:
    915                     # recurse
--> 916                     ret.update(self.__get_subspec_values(sub_builder, subspec, manager))
    917                 else:
    918                     ret[subspec] = manager.construct(sub_builder)

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/objectmapper.py in __get_subspec_values(self, builder, spec, manager)
    864                         ret[subspec] = self.__flatten(sub_builder, subspec, manager)
    865             # now process groups and datasets
--> 866             self.__get_sub_builders(groups, spec.groups, manager, ret)
    867             self.__get_sub_builders(datasets, spec.datasets, manager, ret)
    868         elif isinstance(spec, DatasetSpec):

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/objectmapper.py in __get_sub_builders(self, sub_builders, subspecs, manager, ret)
    906                 sub_builder = builder_dt.get(dt)
    907                 if sub_builder is not None:
--> 908                     sub_builder = self.__flatten(sub_builder, subspec, manager)
    909                     ret[subspec] = sub_builder
    910             else:

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/objectmapper.py in __flatten(self, sub_builder, subspec, manager)
    919 
    920     def __flatten(self, sub_builder, subspec, manager):
--> 921         tmp = [manager.construct(b) for b in sub_builder]
    922         if len(tmp) == 1 and not subspec.is_many():
    923             tmp = tmp[0]

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/objectmapper.py in <listcomp>(.0)
    919 
    920     def __flatten(self, sub_builder, subspec, manager):
--> 921         tmp = [manager.construct(b) for b in sub_builder]
    922         if len(tmp) == 1 and not subspec.is_many():
    923             tmp = tmp[0]

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/utils.py in func_call(*args, **kwargs)
    451 
    452             if is_method:
--> 453                 return func(args[0], **parsed['args'])
    454             else:
    455                 return func(**parsed['args'])

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/manager.py in construct(self, **kwargs)
    191             if parent_builder is not None:
    192                 parent = self.__get_proxy_builder(parent_builder)
--> 193                 result = self.__type_map.construct(builder, self, parent)
    194             else:
    195                 # we are at the top of the hierarchy,

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/utils.py in func_call(*args, **kwargs)
    451 
    452             if is_method:
--> 453                 return func(args[0], **parsed['args'])
    454             else:
    455                 return func(**parsed['args'])

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/manager.py in construct(self, **kwargs)
    766             raise ValueError('No ObjectMapper found for builder of type %s' % dt)
    767         else:
--> 768             return obj_mapper.construct(builder, build_manager, parent)
    769 
    770     @docval({"name": "container", "type": AbstractContainer, "doc": "the container to convert to a Builder"},

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/utils.py in func_call(*args, **kwargs)
    451 
    452             if is_method:
--> 453                 return func(args[0], **parsed['args'])
    454             else:
    455                 return func(**parsed['args'])

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/objectmapper.py in construct(self, **kwargs)
    934         cls = manager.get_cls(builder)
    935         # gather all subspecs
--> 936         subspecs = self.__get_subspec_values(builder, self.spec, manager)
    937         # get the constructor argument that each specification corresponds to
    938         const_args = dict()

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/objectmapper.py in __get_subspec_values(self, builder, spec, manager)
    864                         ret[subspec] = self.__flatten(sub_builder, subspec, manager)
    865             # now process groups and datasets
--> 866             self.__get_sub_builders(groups, spec.groups, manager, ret)
    867             self.__get_sub_builders(datasets, spec.datasets, manager, ret)
    868         elif isinstance(spec, DatasetSpec):

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/objectmapper.py in __get_sub_builders(self, sub_builders, subspecs, manager, ret)
    906                 sub_builder = builder_dt.get(dt)
    907                 if sub_builder is not None:
--> 908                     sub_builder = self.__flatten(sub_builder, subspec, manager)
    909                     ret[subspec] = sub_builder
    910             else:

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/objectmapper.py in __flatten(self, sub_builder, subspec, manager)
    919 
    920     def __flatten(self, sub_builder, subspec, manager):
--> 921         tmp = [manager.construct(b) for b in sub_builder]
    922         if len(tmp) == 1 and not subspec.is_many():
    923             tmp = tmp[0]

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/objectmapper.py in <listcomp>(.0)
    919 
    920     def __flatten(self, sub_builder, subspec, manager):
--> 921         tmp = [manager.construct(b) for b in sub_builder]
    922         if len(tmp) == 1 and not subspec.is_many():
    923             tmp = tmp[0]

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/utils.py in func_call(*args, **kwargs)
    451 
    452             if is_method:
--> 453                 return func(args[0], **parsed['args'])
    454             else:
    455                 return func(**parsed['args'])

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/manager.py in construct(self, **kwargs)
    191             if parent_builder is not None:
    192                 parent = self.__get_proxy_builder(parent_builder)
--> 193                 result = self.__type_map.construct(builder, self, parent)
    194             else:
    195                 # we are at the top of the hierarchy,

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/utils.py in func_call(*args, **kwargs)
    451 
    452             if is_method:
--> 453                 return func(args[0], **parsed['args'])
    454             else:
    455                 return func(**parsed['args'])

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/manager.py in construct(self, **kwargs)
    766             raise ValueError('No ObjectMapper found for builder of type %s' % dt)
    767         else:
--> 768             return obj_mapper.construct(builder, build_manager, parent)
    769 
    770     @docval({"name": "container", "type": AbstractContainer, "doc": "the container to convert to a Builder"},

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/utils.py in func_call(*args, **kwargs)
    451 
    452             if is_method:
--> 453                 return func(args[0], **parsed['args'])
    454             else:
    455                 return func(**parsed['args'])

~/opt/anaconda3/lib/python3.7/site-packages/hdmf/build/objectmapper.py in construct(self, **kwargs)
    969         except Exception as ex:
    970             msg = 'Could not construct %s object due to %s' % (cls.__name__, ex)
--> 971             raise Exception(msg) from ex
    972         return obj
    973 

Exception: Could not construct TimeSeries object due to TimeSeries.__init__: incorrect shape for 'timestamps' (got '(2, 366036)', expected '(None,)')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.