Skip to content

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

@rly

Description

@rly

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    category: enhancementimprovements of code or code behaviorpriority: lowalternative solution already working and/or relevant to only specific user(s)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions