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

Naming Discrepancy: 'general' Prefix in MATLAB vs Python NWB File Format #1841

Closed
3 tasks done
lnett99 opened this issue Feb 5, 2024 · 3 comments
Closed
3 tasks done
Labels
category: question questions about code or code behavior

Comments

@lnett99
Copy link

lnett99 commented Feb 5, 2024

What would you like changed or added to the documentation and why?

Hello,
I am currently exploring the NWB file format using the pynwb library in Python and noticed a naming difference compared to the MATLAB version.

In Python, names such as experiment_description do not include the "general" prefix, whereas in MATLAB, the corresponding fields are named with the prefix, such as general_experiment_description. I'm curious about the reasoning behind this distinction and whether it reflects a design choice or if there is a specific rationale behind it.

Do you have any interest in helping write or edit the documentation?

No.

Code of Conduct

@ehennestad
Copy link

ehennestad commented Feb 14, 2024

Hi,

This is a difference in the API and I don't know the rationale behind it, but the experiment description is part of the general root group of the NWB file. In MATLAB, the hierarchical organisation of groups in the NWB file is presented as a flattened list of properties in the NwbFile object, with the group- and subgroup-names joined with an underscore, so general_experiment_description just indicates the the experiment_description is part of the general group. This should have no practical difference when the NWB file is created/written to. Perhaps @lawrence-mbf could elaborate on why the matnwb package has a different implementation.

@lawrence-mbf
Copy link

The flattening of the MatNWB structure was so that users did not also need to handle generic HDF5 "group" object types which would make configuration even more complicated. Instead, the necessary groups are identified and generated on export. The reason for the property prefixes is partially for the user but also for other file generation tasks that require searching through the schema's group hierarchy without actually having knowledge of the full schema. You can see a simplified version of this in the io.resolvePath function which is also used by NwbFile's resolve method.

@stephprince stephprince added the category: question questions about code or code behavior label Apr 16, 2024
@stephprince
Copy link
Contributor

I believe this question was answered and will close this issue for now. Please reopen if you have any further questions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: question questions about code or code behavior
Projects
None yet
Development

No branches or pull requests

4 participants