Skip to content

Commit

Permalink
refactor: use registry/registry_id pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
dbirman committed Jan 9, 2025
1 parent 6be87e9 commit b5811ea
Show file tree
Hide file tree
Showing 10 changed files with 103 additions and 21 deletions.
48 changes: 40 additions & 8 deletions examples/aibs_smartspim_procedures.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
{
"first_name": null,
"last_name": null,
"orcid_id": null,
"registry": {
"name": "Open Researcher and Contributor ID",
"abbreviation": "ORCID"
},
"registry_identifier": null,
"anonymous_id": "LAS"
}
],
Expand Down Expand Up @@ -44,7 +48,11 @@
{
"first_name": "John",
"last_name": "Smith",
"orcid_id": null,
"registry": {
"name": "Open Researcher and Contributor ID",
"abbreviation": "ORCID"
},
"registry_identifier": null,
"anonymous_id": null
}
],
Expand Down Expand Up @@ -92,7 +100,11 @@
{
"first_name": "John",
"last_name": "Smith",
"orcid_id": null,
"registry": {
"name": "Open Researcher and Contributor ID",
"abbreviation": "ORCID"
},
"registry_identifier": null,
"anonymous_id": null
}
],
Expand Down Expand Up @@ -128,7 +140,11 @@
{
"first_name": "John",
"last_name": "Smith",
"orcid_id": null,
"registry": {
"name": "Open Researcher and Contributor ID",
"abbreviation": "ORCID"
},
"registry_identifier": null,
"anonymous_id": null
}
],
Expand Down Expand Up @@ -164,7 +180,11 @@
{
"first_name": "John",
"last_name": "Smith",
"orcid_id": null,
"registry": {
"name": "Open Researcher and Contributor ID",
"abbreviation": "ORCID"
},
"registry_identifier": null,
"anonymous_id": null
}
],
Expand Down Expand Up @@ -212,7 +232,11 @@
{
"first_name": "John",
"last_name": "Smith",
"orcid_id": null,
"registry": {
"name": "Open Researcher and Contributor ID",
"abbreviation": "ORCID"
},
"registry_identifier": null,
"anonymous_id": null
}
],
Expand Down Expand Up @@ -260,7 +284,11 @@
{
"first_name": "John",
"last_name": "Smith",
"orcid_id": null,
"registry": {
"name": "Open Researcher and Contributor ID",
"abbreviation": "ORCID"
},
"registry_identifier": null,
"anonymous_id": null
}
],
Expand Down Expand Up @@ -296,7 +324,11 @@
{
"first_name": "John",
"last_name": "Smith",
"orcid_id": null,
"registry": {
"name": "Open Researcher and Contributor ID",
"abbreviation": "ORCID"
},
"registry_identifier": null,
"anonymous_id": null
}
],
Expand Down
6 changes: 5 additions & 1 deletion examples/bergamo_ophys_session.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
{
"first_name": "John",
"last_name": "Smith",
"orcid_id": null,
"registry": {
"name": "Open Researcher and Contributor ID",
"abbreviation": "ORCID"
},
"registry_identifier": null,
"anonymous_id": null
}
],
Expand Down
6 changes: 5 additions & 1 deletion examples/ephys_session.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
{
"first_name": "John",
"last_name": "Smith",
"orcid_id": null,
"registry": {
"name": "Open Researcher and Contributor ID",
"abbreviation": "ORCID"
},
"registry_identifier": null,
"anonymous_id": null
}
],
Expand Down
6 changes: 5 additions & 1 deletion examples/exaspim_acquisition.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
{
"first_name": "John",
"last_name": "Smith",
"orcid_id": null,
"registry": {
"name": "Open Researcher and Contributor ID",
"abbreviation": "ORCID"
},
"registry_identifier": null,
"anonymous_id": null
}
],
Expand Down
6 changes: 5 additions & 1 deletion examples/mri_session.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
{
"first_name": "John",
"last_name": "Smith",
"orcid_id": null,
"registry": {
"name": "Open Researcher and Contributor ID",
"abbreviation": "ORCID"
},
"registry_identifier": null,
"anonymous_id": null
}
],
Expand Down
6 changes: 5 additions & 1 deletion examples/multiplane_ophys_session.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
{
"first_name": "John",
"last_name": "Smith",
"orcid_id": null,
"registry": {
"name": "Open Researcher and Contributor ID",
"abbreviation": "ORCID"
},
"registry_identifier": null,
"anonymous_id": null
}
],
Expand Down
24 changes: 20 additions & 4 deletions examples/ophys_procedures.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
{
"first_name": "Scientist",
"last_name": "Smith",
"orcid_id": null,
"registry": {
"name": "Open Researcher and Contributor ID",
"abbreviation": "ORCID"
},
"registry_identifier": null,
"anonymous_id": null
}
],
Expand Down Expand Up @@ -140,7 +144,11 @@
{
"first_name": "Scientist",
"last_name": "Smith",
"orcid_id": null,
"registry": {
"name": "Open Researcher and Contributor ID",
"abbreviation": "ORCID"
},
"registry_identifier": null,
"anonymous_id": null
}
],
Expand Down Expand Up @@ -178,7 +186,11 @@
{
"first_name": "Scientist",
"last_name": "Smith",
"orcid_id": null,
"registry": {
"name": "Open Researcher and Contributor ID",
"abbreviation": "ORCID"
},
"registry_identifier": null,
"anonymous_id": null
}
],
Expand Down Expand Up @@ -230,7 +242,11 @@
{
"first_name": "Scientist",
"last_name": "Smith",
"orcid_id": null,
"registry": {
"name": "Open Researcher and Contributor ID",
"abbreviation": "ORCID"
},
"registry_identifier": null,
"anonymous_id": null
}
],
Expand Down
6 changes: 5 additions & 1 deletion examples/ophys_session.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
{
"first_name": "Scientist",
"last_name": "Smith",
"orcid_id": null,
"registry": {
"name": "Open Researcher and Contributor ID",
"abbreviation": "ORCID"
},
"registry_identifier": null,
"anonymous_id": null
}
],
Expand Down
12 changes: 10 additions & 2 deletions examples/procedures.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
{
"first_name": "Scientist",
"last_name": "Smith",
"orcid_id": null,
"registry": {
"name": "Open Researcher and Contributor ID",
"abbreviation": "ORCID"
},
"registry_identifier": null,
"anonymous_id": null
}
],
Expand Down Expand Up @@ -94,7 +98,11 @@
{
"first_name": "Scientist",
"last_name": "Smith",
"orcid_id": null,
"registry": {
"name": "Open Researcher and Contributor ID",
"abbreviation": "ORCID"
},
"registry_identifier": null,
"anonymous_id": null
}
],
Expand Down
4 changes: 3 additions & 1 deletion src/aind_data_schema/components/identifiers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

from typing import Optional
from pydantic import BaseModel, Field, model_validator
from aind_data_schema_models.registries import Registry, _RegistryModel


class Experimenter(BaseModel):
"""Experimenter identifier"""

first_name: Optional[str] = Field(default=None, title="Experimenter first name")
last_name: Optional[str] = Field(default=None, title="Experimenter last name")
orcid_id: Optional[str] = Field(default=None, title="ORCID ID")
registry: _RegistryModel = Field(default=Registry.ORCID, title="Registry")
registry_identifier: Optional[str] = Field(default=None, title="ORCID ID")
anonymous_id: Optional[str] = Field(default=None, title="Anonymous ID")

@model_validator(mode="before")
Expand Down

0 comments on commit b5811ea

Please sign in to comment.