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

Add duecredit support #1322

Closed
yarikoptic opened this issue Nov 25, 2020 · 11 comments · Fixed by #1362
Closed

Add duecredit support #1322

yarikoptic opened this issue Nov 25, 2020 · 11 comments · Fixed by #1362
Labels
category: enhancement improvements of code or code behavior

Comments

@yarikoptic
Copy link
Contributor

To be able to track for citation and versioning purposes: https://github.com/duecredit/duecredit/

Ref: dandi/dandi-cli#57 (comment)

So what would be the canonical citation for pynwb?

@yarikoptic yarikoptic added the category: enhancement improvements of code or code behavior label Nov 25, 2020
@oruebel
Copy link
Contributor

oruebel commented Nov 25, 2020

Oliver Rübel, Andrew Tritt, Benjamin Dichter, Thomas Braun, Nicholas Cain, Nathan Clack, Thomas J. Davidson, Max Dougherty, Jean-Christophe Fillion-Robin, Nile Graddis, Michael Grauer, Justin T. Kiggins, Lawrence Niu, Doruk Ozturk, William Schroeder, Ivan Soltesz, Friedrich T. Sommer, Karel Svoboda, Ng Lydia, Loren M. Frank, Kristofer Bouchard, "NWB:N 2.0: An Accessible Data Standard for Neurophysiology", biorxiv, January 17, 2019, doi: https://doi.org/10.1101/523035

@oruebel
Copy link
Contributor

oruebel commented Nov 25, 2020

We don't really have a paper for PyNWB itself yet. I think it is probably most appropriate to cite the NWB preprint in this case.

oruebel added a commit that referenced this issue Nov 25, 2020
@yarikoptic
Copy link
Contributor Author

FWIW, here is the one I just sent for dandi-cli, so you would just need to change doi and path I guess ;-)
dandi/dandi-cli#285

@yarikoptic
Copy link
Contributor Author

FYI: overall idea is that you could annotate individual code pieces which could have dedicated citations (algorithms, extensions etc) so you can go "wild" if you have something like that in pynwb

@oruebel
Copy link
Contributor

oruebel commented Nov 26, 2020

Interesting approach to have the citations available in the code and tools to collect the relevant citations. For PyNWB and HDMF this currently mainly makes sense on the level of the package as a whole. However, as we have more working groups developing different parts of NWB, I think this is an interesting approach to provide credit.

@yarikoptic
Copy link
Contributor Author

... I think this is an interesting approach to provide credit.

thank you -- I think so too ;-)
If only I had more time/help to push its (duecredit) development forward. And I do like to use it occasionally to even just quickly figure out what versions of what I am actually using ;-) For PyNWB it would be in particular of interest for extensions especially if they are imported/used on demand: might be worth adding duecredit stub into extensions template: might make some extensions developers happier.

@oruebel
Copy link
Contributor

oruebel commented May 19, 2021

might be worth adding duecredit stub into extensions template:

Added issue nwb-extensions/ndx-template#55 for this

@anhknguyen96
Copy link

Hi, I'm interested in extracting the pynwb version that a dandiset/nwb file was created with, and my initial impression was that duecredit helps extracting this information. However, I tested 5 files that were created/uploaded on dandiarchive at different times (from March 2020 to April 2022, approximately), and the pynwb version was all 2.0.0, which I don't think quite reflect the pynwb release timeline.
If duecredit doesn't support this, is there any way I can retrieve the pynwb version, except for the metadata that not all users abide to adding to? If not, is it safe to interpolate the pynwb version from the nwb-schema version, as extracted from HDF5IO.get_namespaces()?

@yarikoptic
Copy link
Contributor Author

duecredit doesn't store anything in nwb files, and not even enabled by default. Indeed storing provenance of pynwb (or matnwb or any other library which produced that file) in nwb would be nice and relates to provenance issue (might link here later).

@anhknguyen96
Copy link

thanks for the reply. So as of now it's not possible to retrieve the information on provenance of pynwb? Also, to rephrase my other question, is there a way to know the the range of nwb-schema versions that a pynwb version support, or vice versa, interpolate a pynwb version that was used to create an nwb file from a nwb-schema version?

@oruebel
Copy link
Contributor

oruebel commented Jul 18, 2022

So as of now it's not possible to retrieve the information on provenance of pynwb?

Currently, only the schema version and schema are stored, but not the provenance of PyNWB, MatNWB, or other software that created the file.

Also, to rephrase my other question, is there a way to know the the range of nwb-schema versions that a pynwb version support,

All version of PyNWB support read of NWB >= 2.0 as minimal version. The latest schema version supported by a particular version of PyNWB is typically described as part of the changelog https://github.com/NeurodataWithoutBorders/pynwb/blob/dev/CHANGELOG.md For an installed version of PyNWB you can also look at the version of the schema that is installed with PyNWB. We don't have a listing that maps PyNWB versions to NWB schema versions, but that should not be too hard to create if that will be useful.

For MatNWB (since v2.2.4.0) the relationship is simpler, as the first three digits of the MatNWB version number correspond to the NWB-Schema version and the later digits to the fix version of MatNWB itself.

interpolate a pynwb version that was used to create an nwb file from a nwb-schema version?

I believe that assumes: a) that PyNWB was actually used to create the files, and not, e.g., MatNWB (or a combination of tools), b) that a file wasn't updated with different versions of PyNWB (or other tools). If that is the case, then you could make an educated guess. Each version of PyNWB installs with a particular version of the schema and PyNWB always creates files with the latest schema that it ships with. I.e., once you know the schema version you could make a reasonably educated guess of which PyNWB version was used.

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
Projects
None yet
3 participants