qiita
qiita copied to clipboard
example for publication
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? https://github.com/qiita-spots/qiita/blob/58e15a470919b1183c6caf5af5f36f990f37f9ce/qiita_db/software.py#L1185-L1191
invalid
PUBLICATIONS = [("doi", "pid"])
valid
PUBLICATIONS = [["doi", "pid"]]
i.e. the term "tuple" / the parenthesis were confusing me
The "publications" string seems to be read as json: https://github.com/qiita-spots/qiita/blob/57d1b146729223da9daa286a1cc75db6f2923746/qiita_db/software.py#L883-L884
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.
@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.
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 https://github.com/qiita-spots/qiita/blob/57d1b146729223da9daa286a1cc75db6f2923746/qiita_db/software.py#L1006-L1008
Note that correct syntax for publications in plugin configuration files is [[str, str]], not [(str, str)], for example [["10.1093/nar/gkad527", "37326027"]]