Skip to content

Commit 71a1fcd

Browse files
committed
Rename orcid to orcid_id
1 parent 9eddd8a commit 71a1fcd

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/scippneutron/io/cif.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
... .with_beamline(metadata.Beamline(name='fake', facility='made up'))
3333
... .with_authors(metadata.Person(
3434
... name='Jane Doe',
35-
... orcid='0000-0000-0000-0001',
35+
... orcid_id='0000-0000-0000-0001',
3636
... corresponding=True
3737
... ))
3838
... .with_reduced_powder_data(da)
@@ -971,11 +971,11 @@ def _serialize_authors(
971971
) -> tuple[Chunk | Loop, dict[str, str]]:
972972
fields = {
973973
f'{category}.{key}': f
974-
for key in ('name', 'email', 'address', 'orcid')
974+
for key in ('name', 'email', 'address', 'orcid_id')
975975
if any(f := [getattr(a, key) or '' for a in authors])
976976
}
977-
# Map between our name (Person.orcid) and CIF's (id_orcid)
978-
if orcid_id := fields.pop(f'{category}.orcid', None):
977+
# Map between our name (Person.orcid_id) and CIF's (id_orcid)
978+
if orcid_id := fields.pop(f'{category}.orcid_id', None):
979979
fields[f'{category}.id_orcid'] = orcid_id
980980

981981
roles = {next(id_generator): a.role for a in authors}

src/scippneutron/metadata/_model.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ class Person(BaseModel):
166166

167167
name: str
168168
"""Free form name of the person."""
169-
orcid: ORCIDiD | None = None
169+
orcid_id: ORCIDiD | None = None
170170
"""ORCID iD of the person."""
171171

172172
corresponding: bool = False

tests/io/cif_test.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,7 @@ def test_builder_single_contact_author() -> None:
10741074
name='Jane Doe',
10751075
10761076
address='Partikelgatan, Lund',
1077-
orcid='https://orcid.org/0000-0000-0000-0001',
1077+
orcid_id='https://orcid.org/0000-0000-0000-0001',
10781078
corresponding=True,
10791079
)
10801080
cif_ = cif.CIF().with_authors(author)
@@ -1091,7 +1091,7 @@ def test_builder_regular_author() -> None:
10911091
name='Jane Doe',
10921092
10931093
address='Partikelgatan, Lund',
1094-
orcid='https://orcid.org/0000-0000-0000-0001',
1094+
orcid_id='https://orcid.org/0000-0000-0000-0001',
10951095
corresponding=False,
10961096
)
10971097
cif_ = cif.CIF().with_authors(author)
@@ -1109,13 +1109,13 @@ def test_builder_multiple_regular_authors() -> None:
11091109
name='Jane Doe',
11101110
11111111
address='Partikelgatan, Lund',
1112-
orcid='https://orcid.org/0000-0000-0000-0001',
1112+
orcid_id='https://orcid.org/0000-0000-0000-0001',
11131113
corresponding=False,
11141114
),
11151115
metadata.Person(
11161116
name='Max Mustermann',
11171117
1118-
orcid='https://orcid.org/0000-0000-0001-0082',
1118+
orcid_id='https://orcid.org/0000-0000-0001-0082',
11191119
corresponding=False,
11201120
),
11211121
]

0 commit comments

Comments
 (0)