Skip to content

Commit

Permalink
tests: fixing small issues with investigators in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dbirman committed Jan 21, 2025
1 parent 969752a commit c219b2b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
16 changes: 8 additions & 8 deletions examples/aibs_smartspim_procedures.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from aind_data_schema.components.identifiers import Investigator
from aind_data_schema.core import procedures

experimenters = [Investigator(name="John Smith")]
investigators = [Investigator(name="John Smith")]
# subject and specimen id can be the same?
specimen_id = "651286"

Expand Down Expand Up @@ -56,7 +56,7 @@
procedure_type="Fixation",
start_date=date(2023, 1, 13),
end_date=date(2023, 1, 17),
investigators=experimenters,
investigators=investigators,
protocol_id=["unknown"],
reagents=[shield_buffer, shield_epoxy],
)
Expand All @@ -68,7 +68,7 @@
procedure_type="Fixation",
start_date=date(2023, 1, 17),
end_date=date(2023, 1, 18),
investigators=experimenters,
investigators=investigators,
protocol_id=["unknown"],
reagents=[
shield_on,
Expand All @@ -82,7 +82,7 @@
procedure_type="Soak",
start_date=date(2023, 1, 18),
end_date=date(2023, 1, 19),
investigators=experimenters,
investigators=investigators,
protocol_id=["unknown"],
reagents=[
delipidation_buffer,
Expand All @@ -96,7 +96,7 @@
procedure_name="Active Delipidation",
start_date=date(2023, 1, 19),
end_date=date(2023, 1, 20),
investigators=experimenters,
investigators=investigators,
protocol_id=["unknown"],
reagents=[delipidation_buffer, conductivity_buffer],
)
Expand All @@ -108,7 +108,7 @@
procedure_name="EasyIndex 50%",
start_date=date(2023, 1, 30),
end_date=date(2023, 1, 31),
investigators=experimenters,
investigators=investigators,
protocol_id=["unknown"],
reagents=[
easy_index,
Expand All @@ -123,7 +123,7 @@
procedure_name="EasyIndex 100%",
start_date=date(2023, 1, 31),
end_date=date(2023, 2, 2),
investigators=experimenters,
investigators=investigators,
protocol_id=["unknown"],
reagents=[
easy_index,
Expand All @@ -136,7 +136,7 @@
procedure_type="Embedding",
start_date=date(2023, 1, 31),
end_date=date(2023, 2, 2),
investigators=experimenters,
investigators=investigators,
protocol_id=["unknown"],
reagents=[
easy_index,
Expand Down
4 changes: 2 additions & 2 deletions src/aind_data_schema/core/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ class Model(DataCoreModel):
"""Description of an analysis model"""

_DESCRIBED_BY_URL = DataCoreModel._DESCRIBED_BY_BASE_URL.default + "aind_data_schema/core/model.py"
describedBy: str = Field(_DESCRIBED_BY_URL, json_schema_extra={"const": _DESCRIBED_BY_URL})
schema_version: Literal["0.0.1"] = Field("0.0.1")
describedBy: str = Field(default=_DESCRIBED_BY_URL, json_schema_extra={"const": _DESCRIBED_BY_URL})
schema_version: Literal["0.0.1"] = Field(default="0.0.1")

name: str = Field(..., title="Name")
license: str = Field(..., title="License")
Expand Down
3 changes: 2 additions & 1 deletion tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from aind_data_schema_models.system_architecture import ModelBackbone

from aind_data_schema.components.devices import Software
from aind_data_schema.components.identifiers import Investigator
from aind_data_schema.core.model import Model, ModelArchitecture, ModelEvaluation, ModelTraining, PerformanceMetric


Expand All @@ -26,7 +27,7 @@ def test_constructors(self):
m = Model(
name="2024_01_01_ResNet18_SmartSPIM.h5",
license="CC-BY-4.0",
investigators=["Joe Schmoe"],
investigators=[Investigator(name="Dr. Dan")],
developer_institution=Organization.AIND,
modality=[Modality.SPIM],
pretrained_source_url="url pretrained weights are from",
Expand Down
3 changes: 2 additions & 1 deletion tests/test_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from aind_data_schema_models.system_architecture import CPUArchitecture, OperatingSystem
from aind_data_schema_models.units import MemoryUnit

from aind_data_schema.components.identifiers import Investigator
from aind_data_schema.core.processing import (
DataProcess,
PipelineProcess,
Expand All @@ -29,7 +30,7 @@ def test_constructors(self):
Processing()

p = Processing(
processing_pipeline=PipelineProcess(investigators="Processor", data_processes=[]),
processing_pipeline=PipelineProcess(investigators=[Investigator(name="Dr. Dan")], data_processes=[]),
)

with self.assertRaises(pydantic.ValidationError) as e:
Expand Down

0 comments on commit c219b2b

Please sign in to comment.