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]: Reading and exporting Zarr NWB fails to copy over table information #208

Open
3 tasks done
rcpeene opened this issue Jul 29, 2024 · 3 comments
Open
3 tasks done
Assignees
Labels
category: bug errors in the code or code behavior priority: medium non-critical problem and/or affecting only a small set of users

Comments

@rcpeene
Copy link

rcpeene commented Jul 29, 2024

What happened?

I am trying to modify an existing zarr nwb file in memory and export a copy with those modifications. Specifically, I am trying to append columns to the nwb.electrodes table. More details discussed here: NeurodataWithoutBorders/helpdesk#86

After running code similar to the snippet below, the resulting exported NWB does not contain any of the original columns from nwb.electrodes except 'group'. It also includes the columns I have added (x, y, and z). Printing the electrodes table in memory after reading, before exporting, does show all columns and their names.

I examined the nwb.intervals tables as well and they also are missing all columns in the exported nwb.

Steps to Reproduce

read_io = NWBZarrIO('my_file.nwb', mode='a')
    nwb = read_io.read()
    # placeholder information
    xs, ys, zs = [np.rand(len(nwb.electrodes)) for i in range(3)]

    nwb.electrodes.add_column('x', 'ccf x coordinate', data=xs)
    nwb.electrodes.add_column('y', 'ccf y coordinate', data=ys)
    nwb.electrodes.add_column('z', 'ccf z coordinate', data=zs)

    nwbfile_output_path = results_folder / f"{nwbfile_input_path.stem}.nwb"
    with io_class(str(nwbfile_output_path), "w") as export_io:
        export_io.export(src_io=read_io, nwbfile=nwb)

Traceback

There is no traceback. The code exports without runtime errors.

Operating System

Linux

Python Executable

Conda

Python Version

3.9

Package Versions

hdmf-zarr==0.8.0

Code of Conduct

@alejoe91
Copy link
Collaborator

@rcpeene see this issue: #179

@rcpeene
Copy link
Author

rcpeene commented Jul 29, 2024

The solution mentioned there seems to work. Namely, passing write_args={'link_data': False} to the export call. It is not clear to me if this is intended behavior or merely a temporary solution. The electrodes table and intervals table are not information that is supposed to belong in a separate file. In other words, I think they should be copied over with the default export behavior.

@mavaylon1
Copy link
Contributor

@rcpeene We are working on a fix #194. Ideally rolled out by the end of the week.

@mavaylon1 mavaylon1 self-assigned this Aug 8, 2024
@mavaylon1 mavaylon1 added category: bug errors in the code or code behavior priority: medium non-critical problem and/or affecting only a small set of users labels Aug 8, 2024
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 priority: medium non-critical problem and/or affecting only a small set of users
Projects
None yet
Development

No branches or pull requests

3 participants