Skip to content

Commit dcfe799

Browse files
authored
Add ORCID to DocMaps (#287)
* edited typing to add ORCID * added ORCID to actor * updated regression test data by adding orcid
1 parent 4279626 commit dcfe799

File tree

9 files changed

+24
-7
lines changed

9 files changed

+24
-7
lines changed

data/docmaps/regression_test/docmap_by_manuscript_id/104779.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@
202202
{
203203
"actor": {
204204
"type": "person",
205+
"id": "https://orcid.org/0000-0001-7119-9350",
205206
"name": "Kristine Krug",
206207
"firstName": "Kristine",
207208
"surname": "Krug",

data/docmaps/regression_test/docmap_by_manuscript_id/87198.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@
142142
{
143143
"actor": {
144144
"type": "person",
145+
"id": "https://orcid.org/0000-0002-1228-5221",
145146
"name": "David Paz-Garcia",
146147
"firstName": "David",
147148
"_middleName": "A.",
@@ -158,6 +159,7 @@
158159
{
159160
"actor": {
160161
"type": "person",
162+
"id": "https://orcid.org/0000-0002-5369-9009",
161163
"name": "Molly Przeworski",
162164
"firstName": "Molly",
163165
"surname": "Przeworski",
@@ -431,6 +433,7 @@
431433
{
432434
"actor": {
433435
"type": "person",
436+
"id": "https://orcid.org/0000-0002-1228-5221",
434437
"name": "David Paz-Garcia",
435438
"firstName": "David",
436439
"_middleName": "A.",

data/docmaps/regression_test/docmap_by_manuscript_id/88266.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@
142142
{
143143
"actor": {
144144
"type": "person",
145+
"id": "https://orcid.org/0000-0001-6699-259X",
145146
"name": "Arya Mani",
146147
"firstName": "Arya",
147148
"surname": "Mani",
@@ -437,6 +438,7 @@
437438
{
438439
"actor": {
439440
"type": "person",
441+
"id": "https://orcid.org/0000-0001-6699-259X",
440442
"name": "Arya Mani",
441443
"firstName": "Arya",
442444
"surname": "Mani",

data/docmaps/regression_test/docmap_by_manuscript_id/95285.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@
142142
{
143143
"actor": {
144144
"type": "person",
145+
"id": "https://orcid.org/0000-0002-9570-2544",
145146
"name": "Jungsan Sohn",
146147
"firstName": "Jungsan",
147148
"surname": "Sohn",
@@ -388,6 +389,7 @@
388389
{
389390
"actor": {
390391
"type": "person",
392+
"id": "https://orcid.org/0000-0002-9570-2544",
391393
"name": "Jungsan Sohn",
392394
"firstName": "Jungsan",
393395
"surname": "Sohn",
@@ -686,6 +688,7 @@
686688
{
687689
"actor": {
688690
"type": "person",
691+
"id": "https://orcid.org/0000-0002-9570-2544",
689692
"name": "Jungsan Sohn",
690693
"firstName": "Jungsan",
691694
"surname": "Sohn",

data_hub_api/docmaps/v2/api_input_typing.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
'first_name': str,
2525
'middle_name': Optional[str],
2626
'last_name': str,
27-
'city': Optional[str]
27+
'city': Optional[str],
28+
'ORCID': Optional[str]
2829
}
2930
)
3031

data_hub_api/docmaps/v2/codecs/evaluation.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ def get_docmap_actor_for_evaluation_summary_type(
201201
) -> DocmapEditorActor:
202202
return {
203203
'type': 'person',
204+
'id': ('https://orcid.org/' + editor_detail['ORCID'] if editor_detail['ORCID'] else None),
204205
'name': editor_detail['name'],
205206
'firstName': editor_detail['first_name'],
206207
'_middleName': (editor_detail['middle_name'] if editor_detail['middle_name'] else None),

data_hub_api/docmaps/v2/docmap_typing.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@
119119
'DocmapEditorActor',
120120
{
121121
'type': str,
122+
'id': Optional[str],
122123
'name': str,
123124
'firstName': str,
124125
'_middleName': Optional[str],

tests/unit_tests/docmaps/v2/codecs/evaluation_test.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,9 @@ def test_should_populate_participants_with_and_given_reviewing_editor_detail_(se
312312
)
313313
assert result == {
314314
'actor': {
315-
'name': 'editor_name_1',
316315
'type': 'person',
316+
'id': 'https://orcid.org/orcid_1',
317+
'name': 'editor_name_1',
317318
'firstName': 'editor_first_name_1',
318319
'_middleName': 'editor_middle_name_1',
319320
'surname': 'editor_last_name_1',
@@ -323,10 +324,11 @@ def test_should_populate_participants_with_and_given_reviewing_editor_detail_(se
323324
'role': 'editor'
324325
}
325326

326-
def test_should_return_none_for_middle_name_if_not_defined(self):
327+
def test_should_return_none_for_middle_name_or_id_if_they_not_defined(self):
327328
editor_detail_dict = {
328329
**EDITOR_DETAIL_1,
329-
'middle_name': None
330+
'middle_name': None,
331+
'ORCID': None
330332
}
331333
role = 'editor'
332334
result = get_docmap_evaluation_participants_for_evaluation_summary_type(
@@ -335,8 +337,9 @@ def test_should_return_none_for_middle_name_if_not_defined(self):
335337
)
336338
assert result == {
337339
'actor': {
338-
'name': 'editor_name_1',
339340
'type': 'person',
341+
'id': None,
342+
'name': 'editor_name_1',
340343
'firstName': 'editor_first_name_1',
341344
'_middleName': None,
342345
'surname': 'editor_last_name_1',

tests/unit_tests/docmaps/v2/test_data.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,8 @@
294294
'first_name': 'editor_first_name_1',
295295
'middle_name': 'editor_middle_name_1',
296296
'last_name': 'editor_last_name_1',
297-
'city': 'editor_city_1'
297+
'city': 'editor_city_1',
298+
'ORCID': 'orcid_1'
298299
}
299300

300301
SENIOR_EDITOR_DETAIL_1: ApiEditorDetailInput = {
@@ -305,5 +306,6 @@
305306
'first_name': 'senior_editor_first_name_1',
306307
'middle_name': 'senior_editor_middle_name_1',
307308
'last_name': 'senior_editor_last_name_1',
308-
'city': 'senior_editor_city_1'
309+
'city': 'senior_editor_city_1',
310+
'ORCID': 'orcid_1'
309311
}

0 commit comments

Comments
 (0)