diff --git a/pyproject.toml b/pyproject.toml index c342487..fb7df6c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,9 +18,9 @@ dynamic = ["version"] dependencies = [ 'boto3', - 'pydantic>=2.0', + 'pydantic>=2.0,<2.9', 'pydantic-settings>=2.0', - 'aind-data-transfer-models==0.6.2' + 'aind-data-transfer-models==0.7.0' ] [project.optional-dependencies] diff --git a/src/aind_data_transfer_service/configs/job_configs.py b/src/aind_data_transfer_service/configs/job_configs.py index a1f8ef1..9f8cf15 100644 --- a/src/aind_data_transfer_service/configs/job_configs.py +++ b/src/aind_data_transfer_service/configs/job_configs.py @@ -33,7 +33,7 @@ class ModalityConfigs(BaseSettings): # added to the Modality class _MODALITY_MAP: ClassVar = { m().abbreviation.upper().replace("-", "_"): m().abbreviation - for m in Modality._ALL + for m in Modality.ALL } # Optional number id to assign to modality config @@ -116,10 +116,10 @@ class BasicUploadJobConfigs(BaseSettings): extra="allow", ) - # Need some way to extract abbreviations. Maybe a public method can be - # added to the Platform class + # Legacy way required users to input platform in screaming snake case _PLATFORM_MAP: ClassVar = { - p().abbreviation.upper(): p().abbreviation for p in Platform._ALL + a.upper().replace("-", "_"): a + for a in Platform.abbreviation_map.keys() } _MODALITY_ENTRY_PATTERN: ClassVar = re.compile(r"^modality(\d*)$") _DATETIME_PATTERN1: ClassVar = re.compile( diff --git a/src/aind_data_transfer_service/configs/job_upload_template.py b/src/aind_data_transfer_service/configs/job_upload_template.py index 057132d..557be9a 100644 --- a/src/aind_data_transfer_service/configs/job_upload_template.py +++ b/src/aind_data_transfer_service/configs/job_upload_template.py @@ -84,13 +84,13 @@ def validators(self) -> List[Dict[str, Any]]: { "name": "platform", "type": "list", - "options": [p().abbreviation for p in Platform._ALL], + "options": list(Platform.abbreviation_map.keys()), "column_indexes": [self.HEADERS.index("platform")], }, { "name": "modality", "type": "list", - "options": [m().abbreviation for m in Modality._ALL], + "options": list(Modality.abbreviation_map.keys()), "column_indexes": [ self.HEADERS.index("modality0"), self.HEADERS.index("modality1"),