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

Store the git hash of the nwb-schema submodule in the NWBFile #1236

Open
rly opened this issue May 18, 2020 · 3 comments · May be fixed by #1238
Open

Store the git hash of the nwb-schema submodule in the NWBFile #1236

rly opened this issue May 18, 2020 · 3 comments · May be fixed by #1238
Labels
category: enhancement improvements of code or code behavior priority: low alternative solution already working and/or relevant to only specific user(s)

Comments

@rly
Copy link
Contributor

rly commented May 18, 2020

Description

In the event that the nwb-schema submodule of PyNWB is accidentally updated to a non-release version (the default git branches of nwb-schema and hdmf-common-schema contain the bleeding edge and not necessarily the latest release), then storing the git hash of the loaded submodule in the file would help decipher which unreleased version of the schema was used.

Note: the current workflow requires that all unreleased versions of the schema (the state of the default branches of those repos) have the suffix "-alpha" in the version string. This helps determine that an unreleased version of the schema was used, but does not differentiate between multiple commits that occur between schema releases. The suffix "-alpha" might also be accidentally forgotten. Storing the git hash will solve both issues.

It would also be nice to store the version of PyNWB (or git hash) in the NWBFile.

Proposed solution

Modify 'package_data' in setup.py to store the git hash of the nwb-schema submodule as a resource:

pynwb/setup.py

Line 36 in 9d73463

'package_data': {'pynwb': ["%s/*.yaml" % schema_dir, "%s/*.json" % schema_dir]},

Load the git hash and store it in the file. See as example:
https://github.com/NeurodataWithoutBorders/pynwb/blob/dev/src/pynwb/__init__.py#L24-L28

@rly rly added the category: enhancement improvements of code or code behavior label May 18, 2020
@ajtritt
Copy link
Member

ajtritt commented May 18, 2020

The NWBFile will need a place to store this information.

I think adding an attribute is a logical place to do that.

https://github.com/NeurodataWithoutBorders/nwb-schema/blob/7931e59ad1e97433ce4a450fa5bc2dab81af6f8d/core/nwb.file.yaml#L7-L12

@oruebel
Copy link
Contributor

oruebel commented May 18, 2020

I think adding an attribute is a logical place to do that.

Just for clarification do you envision this to be an attribute on the NWBFile (like nwb_version) or as an attribute on the group with the cached schema?

@ajtritt
Copy link
Member

ajtritt commented May 18, 2020

On the NWBFile

@ajtritt ajtritt linked a pull request May 18, 2020 that will close this issue
@stephprince stephprince added the priority: low alternative solution already working and/or relevant to only specific user(s) label Nov 4, 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: low alternative solution already working and/or relevant to only specific user(s)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants