Skip to content

Compatibility work to do with current PyMoDAQ (check_plugin report on 5.3.x) #12

Open

Description

@seb5g

I ran the check_plugin command (PyMoDAQ 5.3.10, check_plugin . -v) on the 5.3.x branch (commit c786430, the future default branch, created from 5.0.x). It reports four failures and some warnings, listed below with what to do. The command is described in the instrument plugin documentation (section "The check_plugin command"), where every PMQ code is explained. The old names and their replacements are also listed in Legacy to current. I did not change any code for this list and nothing was tested with NI hardware.

An earlier version of this report was written for the old main branch. Its DAQmx_ScannerControl, DAQmx_MultipleScannerControl, DAQmx_PLcounter and daq_1Dviewer_DAQmx plugins are not in 5.3.x, so the points about them (PMQ302, PMQ303, PMQ316, PMQ318) no longer apply here.

The acceptance test of tests/ (added by #14) fails on the first two points below: they are what to fix to get the CI green.

Failures

  • __version__ is missing in src/pymodaq_plugins_daqmx/__init__.py. The package __init__ of the plugin template shows how to define it:
    from pymodaq_utils.utils import get_version, PackageNotFoundError
    try:
        __version__ = get_version(__package__)
    except PackageNotFoundError:
        __version__ = '0.0.0dev'
    (and its set_logger import comes from pymodaq_utils.logger, while this __init__ still imports it from pymodaq.utils.logger).
  • The three modules cannot be imported without the NI driver (daq_move_NIDAQmx, daq_0Dviewer_NIDAQmx, daq_1Dviewer_NIDAQmx): nidaqmx raises DaqNotFoundError ("Could not find an installation of NI-DAQmx") at import time on a computer where the driver is missing, such as the CI runner. The documentation expects the import to work in that case ("The same checks as tests"). The call happens while the class is defined: NIDAQmx.get_NIDAQ_devices().device_names in hardware/national_instruments/NIDAQmx_Viewer.py (class attribute param_devices, then param_devices[0]) and the NIDAQmx.get_NIDAQ_channels(...) calls in the params of NIDAQmx_base.py. get_NIDAQ_devices in daqmxni.py only catches DaqError, not DaqNotFoundError. The class attributes should fall back to an empty list when the driver is absent, and be filled when the module is initialized.

Warnings

  • PMQ308 (the three modules): optional if __name__ == "__main__": main(__file__) block, to run and debug the plugin on its own.
  • PMQ201 / PMQ202 (15 todo): NIDAQmx_Move.py (six TODO: Reimplement in your daq_move with NIDAQmx library and four methods still raising NotImplementedError, lines 53 to 164), daq_NIDAQmx.py:858 ("TODO for your custom plugin") and four # todo in daqmxni.py (lines 618 to 630). They do not fail the tests unless fail_on = 'todo' is set before a release.

Packaging

Done in #13, brought in by #14 (dynamic classifiers, pymodaq_utils>=5.3.6 to build).

To check again after the changes: check_plugin . -v, or run the acceptance test of tests/ (pytest).

Activity

  1. changed the title [-]Compatibility work to do with current PyMoDAQ (check_plugin report)[/-] [+]Compatibility work to do with current PyMoDAQ (check_plugin report on 5.3.x)[/+] on Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions