-
Notifications
You must be signed in to change notification settings - Fork 6
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]: export
fails to correctly save units after adding columns
#179
Comments
For a quick workaround, I think setting export_io.export(src_io=read_io, nwbfile=nwbfile, write_args={'link_data': False}) |
I'm surprised that creating links fails in this way. @mavaylon1 could you take a look at this? |
Code to more easily reproduce:
Working on this. |
Update: What I found is that during export, the columns in units that already existed are stored as links.
The new column is stored as a zarr array. I'll have a fix after talking with the team. |
If you want to make a full copy during export you could set 'write_args={'link_data': False}' to enforce that datasets are copied by default instead of linked to; see https://pynwb.readthedocs.io/en/stable/export.html#my-nwb-file-contains-links-to-datasets-in-other-hdf5-files-how-do-i-create-a-new-nwb-file-with-copies-of-the-datasets That being said, I believe that creating the links should work. One thing to check may be if have an external link to a dataset that then points to another dataset and that the lookup in turn uses the wrong file for the lookup? Just a hunch. |
Update: The link for the spike times is pointing to the wrong file. Next week is a NWB Developer Days, I will push a fix the week after. |
The issue is as follows: @oruebel take a gander at what I found. The biggest detail for you to note is that when we export, we are never supposed to create links. We are supposed to preserve them. Export is not supposed to create links to the prior file, rather it is just mean to have the option to preserve them. This means if File A has links to some File C, then when we export File A to File B, File B will also have links the File C. Problem 1: HDMF-Zarr is missing the logic in HDMF within Problem 2: When links are creating (let's say when they are supposed to be created), they are using absolute paths. They are supposed to use relative paths. Both can break when you move things, but absolute paths will always break. Problem 3: When we create a reference, the source path is shorthand with ".", to represent the file it is currently in. We need to add logic in What to do while this is being fixed:
I will divide the problem into stages: Stage 2 (PR 2:) Add logic into Stage 3 (PR 3:) Edge case Test Suite |
@alejoe91 Are you exporting within the same backend or across from hdf5<->zarr. |
Always same backend |
What happened?
When using the
io.export
after appending some unit columns, the resulting NWB-zarr file only has the newly added columns and it's missing the original ones (includingspike_times
). This makes the exported NWB invalid.Steps to Reproduce
Traceback
Operating System
Linux
Python Executable
Python
Python Version
3.9
Package Versions
pynwb==2.6.0
hdmf-zarr==0.6.0
Code of Conduct
The text was updated successfully, but these errors were encountered: