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 when trying to write new data to existing file #114

Closed
luiztauffer opened this issue Jul 25, 2019 · 1 comment · Fixed by #115
Closed

Error when trying to write new data to existing file #114

luiztauffer opened this issue Jul 25, 2019 · 1 comment · Fixed by #115
Assignees
Labels
category: bug errors in the code or code behavior

Comments

@luiztauffer
Copy link

luiztauffer commented Jul 25, 2019

I'm getting this error when adding new data to an existing file and trying to write it. I'm not sure if it's relevant, but this happens just the same to file with or without external links.
It happens on both hdmf==1.1.0 and hdmf=1.0.5.post0.dev14.
The error goes away and writing works fine on hdmf==1.0.5.

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-10-90c1f5fb09a5> in <module>
     45 
     46     #print(nwb)
---> 47     io.write(nwb)

~\Anaconda3\envs\ecog_vis\lib\site-packages\hdmf\utils.py in func_call(*args, **kwargs)
    412                         raise_from(ExceptionType(msg), None)
    413 
--> 414                 return func(self, **parsed['args'])
    415         else:
    416             def func_call(*args, **kwargs):

~\Anaconda3\envs\ecog_vis\lib\site-packages\hdmf\backends\hdf5\h5tools.py in write(self, **kwargs)
    217 
    218         cache_spec = popargs('cache_spec', kwargs)
--> 219         call_docval_func(super(HDF5IO, self).write, kwargs)
    220         if cache_spec:
    221             ref = self.__file.attrs.get(SPEC_LOC_ATTR)

~\Anaconda3\envs\ecog_vis\lib\site-packages\hdmf\utils.py in call_docval_func(func, kwargs)
    305 def call_docval_func(func, kwargs):
    306     fargs, fkwargs = fmt_docval_args(func, kwargs)
--> 307     return func(*fargs, **fkwargs)
    308 
    309 

~\Anaconda3\envs\ecog_vis\lib\site-packages\hdmf\utils.py in func_call(*args, **kwargs)
    412                         raise_from(ExceptionType(msg), None)
    413 
--> 414                 return func(self, **parsed['args'])
    415         else:
    416             def func_call(*args, **kwargs):

~\Anaconda3\envs\ecog_vis\lib\site-packages\hdmf\backends\io.py in write(self, **kwargs)
     39     def write(self, **kwargs):
     40         container = popargs('container', kwargs)
---> 41         f_builder = self.__manager.build(container, source=self.__source)
     42         self.write_builder(f_builder, **kwargs)
     43 

~\Anaconda3\envs\ecog_vis\lib\site-packages\hdmf\utils.py in func_call(*args, **kwargs)
    412                         raise_from(ExceptionType(msg), None)
    413 
--> 414                 return func(self, **parsed['args'])
    415         else:
    416             def func_call(*args, **kwargs):

~\Anaconda3\envs\ecog_vis\lib\site-packages\hdmf\build\map.py in build(self, **kwargs)
    168                 # TODO: if Datasets attributes are allowed to be modified, we need to
    169                 # figure out how to handle that starting here.
--> 170                 result = self.__type_map.build(container, self, builder=result, source=source, spec_ext=spec_ext)
    171         return result
    172 

~\Anaconda3\envs\ecog_vis\lib\site-packages\hdmf\utils.py in func_call(*args, **kwargs)
    412                         raise_from(ExceptionType(msg), None)
    413 
--> 414                 return func(self, **parsed['args'])
    415         else:
    416             def func_call(*args, **kwargs):

~\Anaconda3\envs\ecog_vis\lib\site-packages\hdmf\build\map.py in build(self, **kwargs)
   1658         builder.set_attribute('namespace', namespace)
   1659         builder.set_attribute(attr_map.spec.type_key(), data_type)
-> 1660         builder.set_attribute(attr_map.spec.id_key(), container.object_id)
   1661         return builder
   1662 

~\Anaconda3\envs\ecog_vis\lib\site-packages\hdmf\utils.py in func_call(*args, **kwargs)
    410                     if parse_err:
    411                         msg = ', '.join(parse_err)
--> 412                         raise_from(ExceptionType(msg), None)
    413 
    414                 return func(self, **parsed['args'])

~\AppData\Roaming\Python\Python37\site-packages\six.py in raise_from(value, from_value)

TypeError: incorrect type for 'value' (got 'NoneType', expected 'NoneType')
@luiztauffer luiztauffer added the category: bug errors in the code or code behavior label Jul 25, 2019
@rly rly self-assigned this Jul 25, 2019
@luiztauffer
Copy link
Author

I installed #115, the error is gone and the data gets written alright!
It seems to be working fine now, thanks! (leaving this open until it get's merged)

@rly rly closed this as completed in #115 Jul 30, 2019
rly added a commit that referenced this issue Jul 30, 2019
* Use raw strings to remove warning on \_ in docstring

* Add test for creating linkbuilder when container parent already set

* Set object ID on get_object_id if not set

* Improve docval error msg when no type is enforced, rename tests

* Add basic backwards compatibility test for reading 1.0.5 files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: bug errors in the code or code behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants