Skip to content

Compatibility work to do with current PyMoDAQ (check_plugin report) #37

Open

Description

@seb5g

I ran the check_plugin command (PyMoDAQ 5.3.x / dev, check_plugin . -v) on 5.0.x (commit 6d1e9bb, after #34 and #35), and again with #36 applied (it makes the Pll plugins importable when no camera or spectrometer is found; it is merged now): the findings are the same with and without it. It reports no failure but several 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. Nothing was tested with Andor hardware. The run was on Linux without pylablib nor pymodaq-plugins-utils installed, so the "cannot be imported" messages for the Pll plugins are only about my environment and are not listed here.

Platforms

Parts of the package only work on Windows: ctypes.windll in hardware/andor_sdk2/sdk2.py and hardware/shamrock_sdk.py, and the path C:\Program Files\Andor SDK3 in hardware/andor_sdk3/sdk3.py and in daq_2Dviewer_AndorSCMOS.py (PMQ317). Either import the SDK lazily, in the method that needs it, or declare it on the instrument plugin class (supported_platforms = ('win32',)): see the section "Plugins working on some systems only" of the documentation. daq_1Dviewer_ShamrockSCMOS and ShamrockSCMOSLegacy already declare it; daq_2Dviewer_AndorSCMOS does not.

Deprecated names

  • daq_move_ShamrockPll: PMQ302 _epsilon is deprecated, use _epsilons; PMQ313 current_position is deprecated (3 times), use current_value.
  • daq_2Dviewer_AndorSCMOS: PMQ318 ini_detector_init() is deprecated, write if self.is_master: self.controller = AWrapper() else: self.controller = controller.

Smaller points

  • PMQ315: invalid escape sequence '\P' in hardware/andor_sdk3/sdk3.py:32, use a raw string.
  • PMQ308 (ShamrockSCMOSLegacy, optional): add if __name__ == "__main__": main(__file__) to run and debug the plugin on its own.
  • PMQ201: three todo lines of the template left in pyproject.toml (dependencies, authors, maintainers) and one todo in daq_1Dviewer_ShamrockCCDPll.py:204.
  • README.rst still lists the plugins before feature/pylablib_andor_CCD #32 (for instance Shamrock, AndorCCD), which now are in src/pymodaq_plugins_andor/legacy (not loaded by PyMoDAQ).

Packaging

pyproject.toml still has static classifiers and "pymodaq_utils>=0.0.6" in the build requirements. Done in #38: the classifiers are computed when the package is built (dynamic = [..., "classifiers"], a [tool.pymodaq] table and pymodaq_utils>=5.3.6), as in the plugin template. The Operating System classifier follows the supported_platforms of the plugins: once daq_2Dviewer_AndorSCMOS and the other Windows-only plugins declare it (see "Platforms"), and provided no plugin of the package declares another system, the Windows classifier is added automatically; until then the package stays OS Independent.

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

Activity

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