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

[Feature]: Validation should check for uniqueness of object IDs in file #1904

Open
3 tasks done
rly opened this issue May 18, 2024 · 1 comment
Open
3 tasks done

[Feature]: Validation should check for uniqueness of object IDs in file #1904

rly opened this issue May 18, 2024 · 1 comment
Assignees
Labels
category: enhancement improvements of code or code behavior priority: medium non-critical problem and/or affecting only a small set of NWB users
Milestone

Comments

@rly
Copy link
Contributor

rly commented May 18, 2024

What would you like to see added to PyNWB?

Object IDs are intended to be unique within a file. Spyglass and perhaps other data management systems rely on that. Sometimes object IDs may be the same for two different objects because an object was copied. See NeurodataWithoutBorders/nwb_benchmarks#60 for an example.

I think this should be an error on validation and probably before/on write too. However, we have to be careful because there already exists data with duplicate object IDs in a file.

Is your feature request related to a problem?

No response

What solution would you like?

In PyNWB, if there is a duplicate key in the file, calling nwbfile.objects will raise an error like: TypeError: Key 'f5bbf768-f39f-4139-b4dc-08f71abb157d' is already in this dict. Cannot reset items in a LabelledDict..

We could also write a check based on nwbfile.all_children: https://github.com/NeurodataWithoutBorders/pynwb/blob/dev/src/pynwb/file.py#L520-L535

Do you have any interest in helping implement the feature?

Yes.

Code of Conduct

@rly rly added category: enhancement improvements of code or code behavior priority: medium non-critical problem and/or affecting only a small set of NWB users labels May 18, 2024
@rly rly added this to the 2.8.0 milestone May 18, 2024
@rly rly self-assigned this May 18, 2024
@t-b
Copy link
Collaborator

t-b commented May 20, 2024

All for it!

@stephprince stephprince modified the milestones: 2.8.0, 2.9.0 Jul 23, 2024
@rly rly modified the milestones: 2.9.0, Next Major Release - 3.0 Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: enhancement improvements of code or code behavior priority: medium non-critical problem and/or affecting only a small set of NWB users
Projects
None yet
Development

No branches or pull requests

3 participants