From b5811ea8fae6514529b8ccb156613770a7bf0834 Mon Sep 17 00:00:00 2001 From: Dan Birman Date: Thu, 9 Jan 2025 09:28:19 -0800 Subject: [PATCH] refactor: use registry/registry_id pattern --- examples/aibs_smartspim_procedures.json | 48 +++++++++++++++---- examples/bergamo_ophys_session.json | 6 ++- examples/ephys_session.json | 6 ++- examples/exaspim_acquisition.json | 6 ++- examples/mri_session.json | 6 ++- examples/multiplane_ophys_session.json | 6 ++- examples/ophys_procedures.json | 24 ++++++++-- examples/ophys_session.json | 6 ++- examples/procedures.json | 12 ++++- .../components/identifiers.py | 4 +- 10 files changed, 103 insertions(+), 21 deletions(-) diff --git a/examples/aibs_smartspim_procedures.json b/examples/aibs_smartspim_procedures.json index d98425876..1dff25ab8 100644 --- a/examples/aibs_smartspim_procedures.json +++ b/examples/aibs_smartspim_procedures.json @@ -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" } ], @@ -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 } ], @@ -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 } ], @@ -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 } ], @@ -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 } ], @@ -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 } ], @@ -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 } ], @@ -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 } ], diff --git a/examples/bergamo_ophys_session.json b/examples/bergamo_ophys_session.json index 55c4929ca..7e04eb1fe 100644 --- a/examples/bergamo_ophys_session.json +++ b/examples/bergamo_ophys_session.json @@ -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 } ], diff --git a/examples/ephys_session.json b/examples/ephys_session.json index 82cf6724f..57d939e92 100644 --- a/examples/ephys_session.json +++ b/examples/ephys_session.json @@ -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 } ], diff --git a/examples/exaspim_acquisition.json b/examples/exaspim_acquisition.json index e73027bbb..53fc0e383 100644 --- a/examples/exaspim_acquisition.json +++ b/examples/exaspim_acquisition.json @@ -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 } ], diff --git a/examples/mri_session.json b/examples/mri_session.json index 9028fa365..0fc67557a 100644 --- a/examples/mri_session.json +++ b/examples/mri_session.json @@ -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 } ], diff --git a/examples/multiplane_ophys_session.json b/examples/multiplane_ophys_session.json index 195245a38..ce0339739 100644 --- a/examples/multiplane_ophys_session.json +++ b/examples/multiplane_ophys_session.json @@ -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 } ], diff --git a/examples/ophys_procedures.json b/examples/ophys_procedures.json index 6345f2bc7..6b8cddb28 100644 --- a/examples/ophys_procedures.json +++ b/examples/ophys_procedures.json @@ -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 } ], @@ -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 } ], @@ -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 } ], @@ -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 } ], diff --git a/examples/ophys_session.json b/examples/ophys_session.json index 0c55453b6..81fd27000 100644 --- a/examples/ophys_session.json +++ b/examples/ophys_session.json @@ -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 } ], diff --git a/examples/procedures.json b/examples/procedures.json index e7d9a4125..c18add781 100644 --- a/examples/procedures.json +++ b/examples/procedures.json @@ -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 } ], @@ -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 } ], diff --git a/src/aind_data_schema/components/identifiers.py b/src/aind_data_schema/components/identifiers.py index 6a4dd4fb3..21878a55a 100644 --- a/src/aind_data_schema/components/identifiers.py +++ b/src/aind_data_schema/components/identifiers.py @@ -2,6 +2,7 @@ from typing import Optional from pydantic import BaseModel, Field, model_validator +from aind_data_schema_models.registries import Registry, _RegistryModel class Experimenter(BaseModel): @@ -9,7 +10,8 @@ class Experimenter(BaseModel): 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")