Repository navigation
Make the acceptance tests pass without the NI-DAQmx driver - #15
Merged
Merged
Conversation
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before: on a computer without the NI-DAQmx driver (such as the CI runner), the three NIDAQmx modules fail to import (
DaqNotFoundErrorraised while the settings are built), the package has no__version__, and the actuator declares the unitVolts(unknown to pint) and has noclose(). The acceptance test added by #14 fails on all of these.After:
pytest testspasses locally without the driver (5 passed), andcheck_pluginreports no more failure.How:
__init__.pydefines__version__like the template and importsset_loggerfrompymodaq_utils.logger.NIDAQmx.get_NIDAQ_devices(daqmxni.py) catchesDaqNotFoundErrorand 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.pyno longer indexes the first device of an empty list.DAQ_NIDAQmx_Actuator(NIDAQmx_Move.py):_controller_units = 'V', andclose()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, whosemove_Abs,move_Relandmove_Homestill raiseNotImplementedError(see the issue #12 todo list). Follow-up of #12.Generated by Claude Code