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

Save spyglass version in analysis nwb #894

Closed
samuelbray32 opened this issue Mar 25, 2024 · 3 comments · Fixed by #897
Closed

Save spyglass version in analysis nwb #894

samuelbray32 opened this issue Mar 25, 2024 · 3 comments · Fixed by #897
Assignees

Comments

@samuelbray32
Copy link
Collaborator

          Unrelated to the immediate conversation above, but one thought from a conversation with @samuelbray32 is that we maybe should be recording the `spyglass.__version__` somewhere in the analysis NWB file so that we know when that was created. This would store the version, git hash and date which is nice. This wouldn't work retroactively, but certainly would help with forensics in a data analysis later if someone were trying to reproduce an analysis.

Originally posted by @edeno in #861 (comment)

@samuelbray32
Copy link
Collaborator Author

Was looking at this today. I think the best way to make sure this info goes in is to implement within AnalysisNwbfile.create() since it should be used universally when making an analysis nwb file. OPtions I see are:

  1. Append the information onto the session_description key during AnalysisNwbfile.create() (easiest and most consistent across analysis types)
  2. Create a new extension object in ndx_franklab_novela for the spyglass version info. Put this in during AnalysisNwbfile.create().
  3. Add the spyglass version in the datatable description inserted during AnalysisNwbfile.add_nwb_object(). This may be stylistically better, but will have to search through the codebase for pipelines that don't use this function to insert their results (e.g. LFPV1() writes to the file using FirFilterParameters().filter_data_nwb() and already uses it's description entry for other information)

@edeno
Copy link
Collaborator

edeno commented Mar 26, 2024

@rly any recommendations on where something like this might go in an NWB file?

@rly
Copy link
Collaborator

rly commented Mar 26, 2024

NWB has limited support for storing software versions right now. You can use NWBFile.source_script. It's a freeform text field. I would recommend storing either the version string or the github commit hash of spyglass there, the name of the function used, with either the name Spyglass or a URL to spyglass.

You could also create an extension as Sam suggested - that would be more structured than the above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants