Skip to content

Commit 771e5d6

Browse files
committed
updating example to use an imaging example
1 parent d1d2699 commit 771e5d6

File tree

2 files changed

+41
-35
lines changed

2 files changed

+41
-35
lines changed

src/aind_data_schema/imaging/instrument.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,6 @@ def validate_device_names(cls, values): # noqa: C901
158158

159159
device_names = []
160160

161-
optical_tables = values.get("optical_tables")
162-
enclosure = values.get("enclosure")
163-
lenses = values.get("lenses")
164-
fluorescence_filters = values.get("fluorescence_filters")
165161
motorized_stages = values.get("motorized_stages")
166162
scanning_stages = values.get("scanning_stages")
167163
light_sources = values.get("light_sources")
@@ -177,10 +173,6 @@ def validate_device_names(cls, values): # noqa: C901
177173
light_sources,
178174
detectors,
179175
additional_devices,
180-
optical_tables,
181-
enclosure,
182-
lenses,
183-
fluorescence_filters,
184176
motorized_stages,
185177
scanning_stages,
186178
]:

tests/test_imaging.py

Lines changed: 41 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55

66
from pydantic import ValidationError
77

8-
from aind_data_schema.device import Calibration, DAQChannel
8+
from aind_data_schema.device import Calibration, DAQChannel, Detector, Filter, Laser, DAQDevice
99
from aind_data_schema.imaging import acquisition as acq
1010
from aind_data_schema.imaging import instrument as inst
1111
from aind_data_schema.imaging import mri_session as ms
1212
from aind_data_schema.imaging import tile
1313
from aind_data_schema.manufacturers import Manufacturer
1414
from aind_data_schema.processing import Registration
15-
from aind_data_schema.rig import NeuropixelsBasestation
1615
from aind_data_schema.utils.units import PowerValue
16+
from aind_data_schema.imaging import instrument
1717

1818

1919
class ImagingTests(unittest.TestCase):
@@ -192,44 +192,58 @@ def test_validators(self):
192192
"""test the validators"""
193193

194194
with self.assertRaises(ValidationError):
195-
inst.Instrument(
196-
instrument_type="diSPIM",
197-
modification_date=datetime.datetime.now(),
198-
manufacturer=Manufacturer.LIFECANVAS,
199-
objectives=[],
200-
detectors=[],
201-
light_sources=[],
195+
instrument.Instrument(
196+
instrument_id="exaSPIM1-1",
197+
instrument_type="exaSPIM",
198+
modification_date=datetime.date(2023, 10, 4),
199+
manufacturer=Manufacturer.CUSTOM,
202200
daqs=[
203-
NeuropixelsBasestation(
204-
basestation_firmware_version="1",
205-
bsc_firmware_version="2",
206-
slot=0,
207-
manufacturer=Manufacturer.IMEC,
208-
ports=[],
209-
computer_name="foo",
201+
DAQDevice(
202+
model="PCIe-6738",
203+
data_interface="USB",
204+
computer_name="Dev2",
205+
manufacturer=Manufacturer.NATIONAL_INSTRUMENTS,
206+
name="Dev2",
207+
serial_number="Unknown",
210208
channels=[
211209
DAQChannel(
212-
channel_name="123",
213-
device_name="Laser A",
210+
channel_name="3",
214211
channel_type="Analog Output",
212+
device_name="LAS-08308",
213+
sample_rate=10000,
215214
),
216215
DAQChannel(
217-
channel_name="321",
218-
device_name="Probe A",
216+
channel_name="5",
219217
channel_type="Analog Output",
218+
device_name="539251",
219+
sample_rate=10000,
220220
),
221221
DAQChannel(
222-
channel_name="234",
223-
device_name="Camera A",
224-
channel_type="Digital Output",
222+
channel_name="4",
223+
channel_type="Analog Output",
224+
device_name="LAS-08309",
225+
sample_rate=10000,
225226
),
226227
DAQChannel(
227-
channel_name="2354",
228-
device_name="Disc A",
229-
channel_type="Digital Output",
228+
channel_name="2",
229+
channel_type="Analog Output",
230+
device_name="stage-x",
231+
sample_rate=10000,
232+
),
233+
DAQChannel(
234+
channel_name="0",
235+
channel_type="Analog Output",
236+
device_name="TL-1",
237+
sample_rate=10000,
238+
),
239+
DAQChannel(
240+
channel_name="6",
241+
channel_type="Analog Output",
242+
device_name="LAS-08307",
243+
sample_rate=10000,
230244
),
231245
],
232-
),
246+
)
233247
],
234248
)
235249

0 commit comments

Comments
 (0)