Skip to content

Commit e58b6e9

Browse files
refactor: remove all Organization.X groups (#1835)
* refactor: remove all Organization.X groups * chore: lint * update docs * refactor: make sure manufacturer is REQUIRED for subclasses * chore: lint * update docs * fix: LED manufacturer got lost * fix: one more * update docs --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
1 parent e7068d8 commit e58b6e9

5 files changed

Lines changed: 31 additions & 33 deletions

File tree

docs/source/components/devices.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Camera Detector
5757
| Field | Type | Title (Description) |
5858
|-------|------|-------------|
5959
| `detector_type` | [DetectorType](../aind_data_schema_models/devices.md#detectortype) | |
60-
| `manufacturer` | [Organization](../aind_data_schema_models/organizations.md#organization) | |
60+
| `manufacturer` | [Organization](../aind_data_schema_models/organizations.md#organization) | Manufacturer |
6161
| `data_interface` | [DataInterface](../aind_data_schema_models/devices.md#datainterface) | Data interface |
6262
| `cooling` | [Cooling](../aind_data_schema_models/devices.md#cooling) | Cooling |
6363
| `frame_rate` | `Optional[decimal.Decimal]` | Frame rate (Hz) (Frame rate being used) |
@@ -192,7 +192,7 @@ Data acquisition device containing multiple I/O channels
192192
| Field | Type | Title (Description) |
193193
|-------|------|-------------|
194194
| `data_interface` | [DataInterface](../aind_data_schema_models/devices.md#datainterface) | Type of connection to PC |
195-
| `manufacturer` | [Organization](../aind_data_schema_models/organizations.md#organization) | |
195+
| `manufacturer` | [Organization](../aind_data_schema_models/organizations.md#organization) | Manufacturer |
196196
| `channels` | List[[DAQChannel](#daqchannel)] | DAQ channels |
197197
| `firmware_version` | `Optional[str]` | Firmware version |
198198
| `hardware_version` | `Optional[str]` | Hardware version |
@@ -210,7 +210,7 @@ Description of a generic detector
210210
| Field | Type | Title (Description) |
211211
|-------|------|-------------|
212212
| `detector_type` | [DetectorType](../aind_data_schema_models/devices.md#detectortype) | Detector Type |
213-
| `manufacturer` | [Organization](../aind_data_schema_models/organizations.md#organization) | |
213+
| `manufacturer` | [Organization](../aind_data_schema_models/organizations.md#organization) | Manufacturer |
214214
| `data_interface` | [DataInterface](../aind_data_schema_models/devices.md#datainterface) | Data interface |
215215
| `cooling` | [Cooling](../aind_data_schema_models/devices.md#cooling) | Cooling |
216216
| `frame_rate` | `Optional[decimal.Decimal]` | Frame rate (Hz) (Frame rate being used) |
@@ -417,7 +417,7 @@ Filter used in a light path
417417
| Field | Type | Title (Description) |
418418
|-------|------|-------------|
419419
| `filter_type` | [FilterType](../aind_data_schema_models/devices.md#filtertype) | Type of filter |
420-
| `manufacturer` | [Organization](../aind_data_schema_models/organizations.md#organization) | |
420+
| `manufacturer` | [Organization](../aind_data_schema_models/organizations.md#organization) | Manufacturer |
421421
| `cut_off_wavelength` | `Optional[int]` | Cut-off wavelength (nm) |
422422
| `cut_on_wavelength` | `Optional[int]` | Cut-on wavelength (nm) |
423423
| `center_wavelength` | `int or List[int] or NoneType` | Center wavelength (nm) (Single wavelength or list of wavelengths for MULTIBAND or MULTI_NOTCH filters) |
@@ -435,7 +435,7 @@ DAQ that uses the Harp protocol for synchronization and data transmission
435435

436436
| Field | Type | Title (Description) |
437437
|-------|------|-------------|
438-
| `manufacturer` | [Organization](../aind_data_schema_models/organizations.md#organization) | |
438+
| `manufacturer` | [Organization](../aind_data_schema_models/organizations.md#organization) | Manufacturer |
439439
| `harp_device_type` | [HarpDeviceType](../aind_data_schema_models/harp_types.md#harpdevicetype) | Type of Harp device |
440440
| `core_version` | `Optional[str]` | Core version |
441441
| `tag_version` | `Optional[str]` | Tag version |
@@ -476,7 +476,7 @@ Laser module with a specific wavelength (may be a sub-component of a larger asse
476476

477477
| Field | Type | Title (Description) |
478478
|-------|------|-------------|
479-
| `manufacturer` | [Organization](../aind_data_schema_models/organizations.md#organization) | |
479+
| `manufacturer` | [Organization](../aind_data_schema_models/organizations.md#organization) | Manufacturer |
480480
| `wavelength` | `int` | Wavelength (nm) |
481481
| `wavelength_unit` | [SizeUnit](../aind_data_schema_models/units.md#sizeunit) | Wavelength unit |
482482
| `coupling` | Optional[[Coupling](../aind_data_schema_models/devices.md#coupling)] | Coupling |
@@ -508,7 +508,7 @@ Lens
508508

509509
| Field | Type | Title (Description) |
510510
|-------|------|-------------|
511-
| `manufacturer` | [Organization](../aind_data_schema_models/organizations.md#organization) | |
511+
| `manufacturer` | [Organization](../aind_data_schema_models/organizations.md#organization) | Manufacturer |
512512
| `name` | `str` | Device name |
513513
| `serial_number` | `Optional[str]` | Serial number |
514514
| `model` | `Optional[str]` | Model |
@@ -564,7 +564,7 @@ Description of a Light Emitting Diode (LED) device
564564

565565
| Field | Type | Title (Description) |
566566
|-------|------|-------------|
567-
| `manufacturer` | [Organization](../aind_data_schema_models/organizations.md#organization) | |
567+
| `manufacturer` | [Organization](../aind_data_schema_models/organizations.md#organization) | Manufacturer |
568568
| `wavelength` | `int` | Wavelength (nm) |
569569
| `wavelength_unit` | [SizeUnit](../aind_data_schema_models/units.md#sizeunit) | Wavelength unit |
570570
| `bandwidth` | `Optional[int]` | Bandwidth (FWHM) |
@@ -582,7 +582,7 @@ Manipulator used on a dome module
582582

583583
| Field | Type | Title (Description) |
584584
|-------|------|-------------|
585-
| `manufacturer` | [Organization](../aind_data_schema_models/organizations.md#organization) | |
585+
| `manufacturer` | [Organization](../aind_data_schema_models/organizations.md#organization) | Manufacturer |
586586
| `name` | `str` | Device name |
587587
| `serial_number` | `Optional[str]` | Serial number |
588588
| `model` | `Optional[str]` | Model |
@@ -610,7 +610,7 @@ Description of visual display for visual stimuli
610610

611611
| Field | Type | Title (Description) |
612612
|-------|------|-------------|
613-
| `manufacturer` | [Organization](../aind_data_schema_models/organizations.md#organization) | |
613+
| `manufacturer` | [Organization](../aind_data_schema_models/organizations.md#organization) | Manufacturer |
614614
| `refresh_rate` | `int` | Refresh rate (Hz) |
615615
| `width` | `int` | Width (pixels) |
616616
| `height` | `int` | Height (pixels) |
@@ -732,7 +732,7 @@ Description of an olfactometer for odor stimuli
732732

733733
| Field | Type | Title (Description) |
734734
|-------|------|-------------|
735-
| `manufacturer` | [Organization](../aind_data_schema_models/organizations.md#organization) | |
735+
| `manufacturer` | [Organization](../aind_data_schema_models/organizations.md#organization) | Manufacturer |
736736
| `harp_device_type` | [HarpDeviceType](../aind_data_schema_models/harp_types.md#harpdevicetype) | Type of Harp device |
737737
| `channels` | List[[OlfactometerChannel](#olfactometerchannel)] | |
738738
| `core_version` | `Optional[str]` | Core version |
@@ -888,7 +888,7 @@ Description of a speaker for auditory stimuli
888888

889889
| Field | Type | Title (Description) |
890890
|-------|------|-------------|
891-
| `manufacturer` | [Organization](../aind_data_schema_models/organizations.md#organization) | |
891+
| `manufacturer` | [Organization](../aind_data_schema_models/organizations.md#organization) | Manufacturer |
892892
| `name` | `str` | Device name |
893893
| `serial_number` | `Optional[str]` | Serial number |
894894
| `model` | `Optional[str]` | Model |

src/aind_data_schema/components/devices.py

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class Detector(Device):
144144
"""Description of a generic detector"""
145145

146146
detector_type: DetectorType = Field(..., title="Detector Type")
147-
manufacturer: Organization.DETECTOR_MANUFACTURERS
147+
manufacturer: Organization.ONE_OF = Field(..., title="Manufacturer")
148148
data_interface: DataInterface = Field(..., title="Data interface")
149149
cooling: Cooling = Field(default=Cooling.NO_COOLING, title="Cooling")
150150
frame_rate: Optional[Decimal] = Field(default=None, title="Frame rate (Hz)", description="Frame rate being used")
@@ -206,7 +206,7 @@ class Filter(Device):
206206

207207
# required fields
208208
filter_type: FilterType = Field(..., title="Type of filter")
209-
manufacturer: Organization.FILTER_MANUFACTURERS
209+
manufacturer: Organization.ONE_OF = Field(..., title="Manufacturer")
210210

211211
# optional fields
212212
cut_off_wavelength: Optional[int] = Field(default=None, title="Cut-off wavelength (nm)")
@@ -239,8 +239,7 @@ def validate_multi_filters(self):
239239
class Lens(Device):
240240
"""Lens"""
241241

242-
# required fields
243-
manufacturer: Organization.LENS_MANUFACTURERS
242+
manufacturer: Organization.ONE_OF = Field(..., title="Manufacturer")
244243

245244

246245
class MotorizedStage(Device):
@@ -316,7 +315,7 @@ class DAQDevice(Device):
316315

317316
# required fields
318317
data_interface: DataInterface = Field(..., title="Type of connection to PC")
319-
manufacturer: Organization.DAQ_DEVICE_MANUFACTURERS
318+
manufacturer: Organization.ONE_OF = Field(..., title="Manufacturer")
320319

321320
# optional fields
322321
channels: List[DAQChannel] = Field(default=[], title="DAQ channels")
@@ -328,7 +327,7 @@ class HarpDevice(DAQDevice):
328327
"""DAQ that uses the Harp protocol for synchronization and data transmission"""
329328

330329
# required fields
331-
manufacturer: Organization.ONE_OF = Field(default=Organization.OEPS)
330+
manufacturer: Organization.ONE_OF = Field(default=Organization.OEPS, title="Manufacturer")
332331
harp_device_type: HarpDeviceType.ONE_OF = Field(..., title="Type of Harp device")
333332
core_version: Optional[str] = Field(default=None, title="Core version")
334333
tag_version: Optional[str] = Field(default=None, title="Tag version")
@@ -351,7 +350,7 @@ class Laser(Device):
351350
"""Laser module with a specific wavelength (may be a sub-component of a larger assembly)"""
352351

353352
# required fields
354-
manufacturer: Organization.LASER_MANUFACTURERS
353+
manufacturer: Organization.ONE_OF = Field(..., title="Manufacturer")
355354
wavelength: int = Field(..., title="Wavelength (nm)")
356355
wavelength_unit: SizeUnit = Field(default=SizeUnit.NM, title="Wavelength unit")
357356

@@ -369,7 +368,7 @@ class Laser(Device):
369368
class LightEmittingDiode(Device):
370369
"""Description of a Light Emitting Diode (LED) device"""
371370

372-
manufacturer: Organization.LED_MANUFACTURERS
371+
manufacturer: Organization.ONE_OF = Field(..., title="Manufacturer")
373372
wavelength: int = Field(..., title="Wavelength (nm)")
374373
wavelength_unit: SizeUnit = Field(default=SizeUnit.NM, title="Wavelength unit")
375374
bandwidth: Optional[int] = Field(default=None, title="Bandwidth (FWHM)")
@@ -416,7 +415,7 @@ class NeuropixelsBasestation(DAQDevice):
416415

417416
# fixed values
418417
data_interface: DataInterface = DataInterface.PXI
419-
manufacturer: Organization.DAQ_DEVICE_MANUFACTURERS = Organization.IMEC
418+
manufacturer: Organization.ONE_OF = Organization.IMEC
420419

421420

422421
class OpenEphysAcquisitionBoard(DAQDevice):
@@ -427,13 +426,13 @@ class OpenEphysAcquisitionBoard(DAQDevice):
427426

428427
# fixed values
429428
data_interface: Literal[DataInterface.USB] = DataInterface.USB
430-
manufacturer: Organization.DAQ_DEVICE_MANUFACTURERS = Field(default=Organization.OEPS)
429+
manufacturer: Organization.ONE_OF = Field(default=Organization.OEPS)
431430

432431

433432
class Manipulator(Device):
434433
"""Manipulator used on a dome module"""
435434

436-
manufacturer: Organization.MANIPULATOR_MANUFACTURERS
435+
manufacturer: Organization.ONE_OF = Field(..., title="Manufacturer")
437436

438437

439438
class FiberPatchCord(Device):
@@ -600,7 +599,7 @@ class Arena(Device):
600599
class Monitor(Device, DevicePosition):
601600
"""Description of visual display for visual stimuli"""
602601

603-
manufacturer: Organization.MONITOR_MANUFACTURERS
602+
manufacturer: Organization.ONE_OF = Field(..., title="Manufacturer")
604603
refresh_rate: int = Field(..., title="Refresh rate (Hz)", ge=60)
605604
width: int = Field(..., title="Width (pixels)")
606605
height: int = Field(..., title="Height (pixels)")
@@ -673,7 +672,7 @@ class AirPuffDevice(Device):
673672
class Speaker(Device, DevicePosition):
674673
"""Description of a speaker for auditory stimuli"""
675674

676-
manufacturer: Organization.SPEAKER_MANUFACTURERS
675+
manufacturer: Organization.ONE_OF = Field(..., title="Manufacturer")
677676

678677

679678
class OlfactometerChannelType(Enum):
@@ -695,8 +694,7 @@ class OlfactometerChannel(DataModel):
695694
class Olfactometer(HarpDevice):
696695
"""Description of an olfactometer for odor stimuli"""
697696

698-
manufacturer: Organization.DAQ_DEVICE_MANUFACTURERS = Field(default=Organization.CHAMPALIMAUD)
699-
697+
manufacturer: Organization.ONE_OF = Field(..., title="Manufacturer")
700698
harp_device_type: HarpDeviceType.ONE_OF = Field(
701699
HarpDeviceType.OLFACTOMETER, frozen=True, title="Type of Harp device"
702700
)

src/aind_data_schema/components/subjects.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class MouseSubject(DataModel):
117117
breeding_info: Optional[BreedingInfo] = Field(default=None, title="Breeding Info")
118118
wellness_reports: List[WellnessReport] = Field(default=[], title="Wellness Report")
119119
housing: Optional[Housing] = Field(default=None, title="Housing")
120-
source: Organization.SUBJECT_SOURCES = Field(
120+
source: Organization.ONE_OF = Field(
121121
...,
122122
description="Where the subject was acquired from. If bred in-house, use Allen Institute.",
123123
title="Source",
@@ -159,7 +159,7 @@ class HumanSubject(DataModel):
159159
species: SpeciesModel = Field(default=Species.HUMAN, title="Species")
160160
sex: Sex = Field(..., title="Sex")
161161
year_of_birth: int = Field(..., title="Year of birth")
162-
source: Organization.SUBJECT_SOURCES = Field(
162+
source: Organization.ONE_OF = Field(
163163
...,
164164
description="Where the subject was acquired from.",
165165
title="Source",
@@ -181,7 +181,7 @@ class NonHumanPrimateSubject(DataModel):
181181
date_of_birth: Optional[Annotated[date_type, TimeValidation.BEFORE]] = Field(default=None, title="Date of birth")
182182
year_of_birth: int = Field(..., title="Year of birth")
183183
mating_status: MatingStatus = Field(..., title="Mating status")
184-
source: Organization.SUBJECT_SOURCES = Field(
184+
source: Organization.ONE_OF = Field(
185185
...,
186186
description="Where the subject was acquired from.",
187187
title="Source",

src/aind_data_schema/components/surgery_procedures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class HeadframeMaterial(str, Enum):
6363
class CatheterImplant(DataModel):
6464
"""Description of a catheter implant procedure"""
6565

66-
where_performed: Organization.CATHETER_IMPLANT_INSTITUTIONS = Field(..., title="Where performed")
66+
where_performed: Organization.ONE_OF = Field(..., title="Where performed")
6767
implanted_device: Catheter = Field(
6868
...,
6969
title="Implanted device",

src/aind_data_schema/core/data_description.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
class Funding(DataModel):
2626
"""Description of funding sources"""
2727

28-
funder: Organization.FUNDERS = Field(..., title="Funder")
28+
funder: Organization.ONE_OF = Field(..., title="Funder")
2929
grant_number: Optional[str] = Field(default=None, title="Grant number")
3030
fundee: Optional[List[Person]] = Field(
3131
default=None, title="Fundee", description="Person(s) funded by this mechanism"
@@ -65,7 +65,7 @@ class DataDescription(DataCoreModel):
6565
title="Data asset name",
6666
validate_default=True,
6767
)
68-
institution: Organization.RESEARCH_INSTITUTIONS = Field(
68+
institution: Organization.ONE_OF = Field(
6969
...,
7070
description="An established society, corporation, foundation or other organization that collected this data",
7171
title="Institution",

0 commit comments

Comments
 (0)