From f7e9f4d05aa596227f2ec3dc1fd0f005d6eeec0f Mon Sep 17 00:00:00 2001 From: LabelFree Date: Tue, 5 Sep 2023 17:26:01 -0700 Subject: [PATCH 1/2] add equal exposures to channel sequencing test --- pycromanager/test/test_acquisition.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pycromanager/test/test_acquisition.py b/pycromanager/test/test_acquisition.py index 6f79bcc3..075c3224 100644 --- a/pycromanager/test/test_acquisition.py +++ b/pycromanager/test/test_acquisition.py @@ -152,11 +152,16 @@ def test_channel_seq_acq(launch_mm_headless, setup_data_folder): Test that channels can be sequenced """ + channels = ['DAPI', 'FITC', 'Rhodamine', 'Cy5'] + channel_exposures_ms = [10] * len(channels) # exposure times may be provided, but must be all equal + mmc = Core() + mmc.set_exposure(2) mmc.set_property('LED', 'Sequence', 'On') events = multi_d_acquisition_events(channel_group='Channel-Multiband', - channels=['DAPI', 'FITC', 'Rhodamine', 'Cy5']) + channels=channels, + channel_exposures_ms=channel_exposures_ms) def hook_fn(_events): assert check_acq_sequenced(_events, len(events)), 'Sequenced acquisition is not built correctly' From 07cc3583319adb5aa6e7f5f1bbb283052a599d0b Mon Sep 17 00:00:00 2001 From: talonchandler Date: Wed, 6 Sep 2023 14:18:40 -0700 Subject: [PATCH 2/2] update channel seq tests --- pycromanager/test/test_acquisition.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/pycromanager/test/test_acquisition.py b/pycromanager/test/test_acquisition.py index 075c3224..bad90cb1 100644 --- a/pycromanager/test/test_acquisition.py +++ b/pycromanager/test/test_acquisition.py @@ -151,6 +151,29 @@ def test_channel_seq_acq(launch_mm_headless, setup_data_folder): """ Test that channels can be sequenced + """ + channels = ['DAPI', 'FITC', 'Rhodamine', 'Cy5'] + + mmc = Core() + mmc.set_property('LED', 'Sequence', 'On') + + events = multi_d_acquisition_events(channel_group='Channel-Multiband', + channels=channels) + + def hook_fn(_events): + assert check_acq_sequenced(_events, len(events)), 'Sequenced acquisition is not built correctly' + return None # no need to actually acquire the data + + with Acquisition(setup_data_folder, 'acq', show_display=False, + pre_hardware_hook_fn=hook_fn) as acq: + acq.acquire(events) + + +def test_channel_exp_seq_acq(launch_mm_headless, setup_data_folder): + """ + Test that channels can be sequenced when equal exposure times for each + channel are provided + """ channels = ['DAPI', 'FITC', 'Rhodamine', 'Cy5'] channel_exposures_ms = [10] * len(channels) # exposure times may be provided, but must be all equal