Skip to content

Do not fail at import when no camera or spectrometer is found - #36

Merged
seb5g merged 1 commit into
5.0.xfrom
fix/andor-empty-device-lists
Nov 4, 2026
Merged

seb5g merged 1 commit into
5.0.xfrom
fix/andor-empty-device-lists

Conversation

@seb5g

@seb5g seb5g commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Before: daq_move_ShamrockPll, daq_2Dviewer_AndorCCDPll (and daq_1Dviewer_ShamrockCCDPll, which inherits from them) fail to import with IndexError: list index out of range when no spectrometer or camera is found, for instance on a CI runner: the class bodies take SPEC_NAMES[0] / CAM_NAMES[0]. This fails 3 tests of tests/test_plugin_package_structure.py.

After: the default value of the spectro_sn / serial_number lists is '' when the list of devices is empty. daq_2Dviewer_AndorSCMOSPll had the same line and gets the same change.

How: 'value': CAM_NAMES[0] if CAM_NAMES else '' (and the same with SPEC_NAMES) in the three files. This commit was pushed to #34 just after it was merged, so it is repeated here on 5.0.x.

Tested: the three files compile; the tests were not run (pylablib is not installed in my environment) and no hardware was used.


Generated by Claude Code

@seb5g
seb5g merged commit 70b0245 into 5.0.x Nov 4, 2026
7 checks passed
@seb5g
seb5g deleted the fix/andor-empty-device-lists branch November 4, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants