Skip to content

Commit

Permalink
Add dataset as valid type
Browse files Browse the repository at this point in the history
  • Loading branch information
susilehtola committed Nov 17, 2024
1 parent b86097e commit ec3b367
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions basis_set_exchange/refconverters/endnote.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ def write_endnote(key, ref):
s += "%0 Thesis \n"
elif ref['_entry_type'] == 'techreport':
s += "%0 Report \n"
elif ref['_entry_type'] == 'dataset':
s += "%0 Data Set \n"
else:
s += "%0 Generic\n"

Expand Down
2 changes: 2 additions & 0 deletions basis_set_exchange/refconverters/ris.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ def write_ris(key, ref):
s += "TY Book \n"
elif ref['_entry_type'] == 'phdthesis':
s += "TY Thesis \n"
elif ref['_entry_type'] == 'dataset':
s += "TY Dataset \n"
elif ref['_entry_type'] == 'techreport':
s += "TY Report \n"
else:
Expand Down
6 changes: 6 additions & 0 deletions basis_set_exchange/references.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ def reference_text(key, ref):
s += '\n' + ref['year']
if 'doi' in ref:
s += '\n' + ref['doi']
elif ref['_entry_type'] == 'dataset':
s += ref_wrap.fill(', '.join(ref['authors'])) + '\n'
s += ref_wrap.fill(ref['title']) + '\n'
s += '{} ({})'.format(ref['publisher'], ref['year'])
if 'doi' in ref:
s += '\n' + ref['doi']
else:
raise RuntimeError('Cannot handle reference type {}'.format(ref['_entry_type']))
if 'note' in ref:
Expand Down
2 changes: 1 addition & 1 deletion basis_set_exchange/schema/references-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"properties": {
"_entry_type" : {
"type" : "string",
"enum": [ "article", "techreport", "misc", "unpublished", "phdthesis", "book", "incollection" ]
"enum": [ "article", "techreport", "misc", "unpublished", "phdthesis", "book", "incollection", "dataset" ]
},
"title" : { "type": "string" },
"doi" : { "type": "string" },
Expand Down

0 comments on commit ec3b367

Please sign in to comment.