Skip to content

Make the acceptance tests pass without the NI-DAQmx driver - #15

Merged
seb5g merged 1 commit into
5.3.xfrom
fix/import-without-driver
Nov 4, 2026
Merged

seb5g merged 1 commit into
5.3.xfrom
fix/import-without-driver

Conversation

@seb5g

@seb5g seb5g commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Before: on a computer without the NI-DAQmx driver (such as the CI runner), the three NIDAQmx modules fail to import (DaqNotFoundError raised while the settings are built), the package has no __version__, and the actuator declares the unit Volts (unknown to pint) and has no close(). The acceptance test added by #14 fails on all of these.

After: pytest tests passes locally without the driver (5 passed), and check_plugin reports no more failure.

How:

  • __init__.py defines __version__ like the template and imports set_logger from pymodaq_utils.logger.
  • NIDAQmx.get_NIDAQ_devices (daqmxni.py) catches DaqNotFoundError and returns an empty stand-in (device_names == [], iterates empty), so the lists of devices and channels in the settings are empty instead of raising; NIDAQmx_Viewer.py no longer indexes the first device of an empty list.
  • DAQ_NIDAQmx_Actuator (NIDAQmx_Move.py): _controller_units = 'V', and close() closes the task of the controller.

Not tested with NI hardware: the change only touches what happens when no device or driver is found, plus the unit and close() of the actuator, whose move_Abs, move_Rel and move_Home still raise NotImplementedError (see the issue #12 todo list). Follow-up of #12.


Generated by Claude Code

- define __version__ (and import set_logger from pymodaq_utils.logger)
- NIDAQmx.get_NIDAQ_devices returns an empty collection when the driver is missing, so the settings built at import time do not fail
- DAQ_NIDAQmx_Actuator: unit 'V' (known by pint) and a close() method

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tdiso1u1ZhikSutj2Qs5Cg
@seb5g
seb5g merged commit 93d312b into 5.3.x Nov 4, 2026
9 checks passed
@seb5g
seb5g deleted the fix/import-without-driver branch November 4, 2026 16:28
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