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

example for publication #3360

Open
sjanssen2 opened this issue Feb 15, 2024 · 5 comments
Open

example for publication #3360

sjanssen2 opened this issue Feb 15, 2024 · 5 comments

Comments

@sjanssen2
Copy link
Contributor

sjanssen2 commented Feb 15, 2024

I am struggling with coming up with the correct syntax to encode a "publication" in the configuration file for a plugin. I unfortunately couldn't find an example in the plugin configs. Could you give an example here in the code?

qiita/qiita_db/software.py

Lines 1185 to 1191 in 58e15a4

"""The publications attached to the software
Returns
-------
list of (str, str)
The list of DOI and pubmed_id attached to the publication
"""

@sjanssen2
Copy link
Contributor Author

invalid
PUBLICATIONS = [("doi", "pid"])
valid
PUBLICATIONS = [["doi", "pid"]]
i.e. the term "tuple" / the parenthesis were confusing me

@sjanssen2
Copy link
Contributor Author

The "publications" string seems to be read as json:

qiita/qiita_db/software.py

Lines 883 to 884 in 57d1b14

publications = config.get('main', 'PUBLICATIONS')
publications = loads(publications) if publications else []

@antgonza
Copy link
Member

This is a good question cause I haven't use it in a really long time. Note that this is the publication of a software and not the publication of a study; two different objects/uses. Anyway, looking at the code I think the expectation is to have a list of two-element tuples: [(doi, pubmed-id), ...]. Hope this helps.

@antgonza
Copy link
Member

@sjanssen2, how should we solve this issue? Maybe another way to ask this is, how should we improve the information on how to add publications? Thank you.

@sjanssen2
Copy link
Contributor Author

From the code, I agree, one would expect [(doi, pubmed-id), ...]. The correct syntax in the config file however is e.g. PUBLICATIONS = [["10.1093/nar/gkad527", "37326027"]] i.e. list of lists, not list of tuples! Unfortunately, there are no plugins with defined publications, i.e. no examples available.
Not sure what the best place for documenting this is?! Maybe extend

qiita/qiita_db/software.py

Lines 1006 to 1008 in 57d1b14

publications : list of (str, str), optional
A list with the (DOI, pubmed_id) of the publications attached to
the software

Note that correct syntax for publications in plugin configuration files is [[str, str]], not [(str, str)], for example [["10.1093/nar/gkad527", "37326027"]]

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

No branches or pull requests

2 participants