From 1a9f20634cc64bd61cd483f3ce1f557b040a7078 Mon Sep 17 00:00:00 2001 From: "Jens H. Nielsen" Date: Wed, 11 Jan 2023 18:35:12 +0100 Subject: [PATCH 1/3] Add public interface for galil --- qcodes/instrument_drivers/Galil/__init__.py | 13 +++++ qcodes/instrument_drivers/Galil/dmc_41x3.py | 54 ++++++++++++++++----- 2 files changed, 54 insertions(+), 13 deletions(-) diff --git a/qcodes/instrument_drivers/Galil/__init__.py b/qcodes/instrument_drivers/Galil/__init__.py index e69de29bb2d1..270096df9b30 100644 --- a/qcodes/instrument_drivers/Galil/__init__.py +++ b/qcodes/instrument_drivers/Galil/__init__.py @@ -0,0 +1,13 @@ +from .dmc_41x3 import ( + GalilDMC4133Arm, + GalilDMC4133Controller, + GalilDMC4133Motor, + GalilDMC4133VectorMode, +) + +__all__ = [ + "GalilDMC4133Arm", + "GalilDMC4133Controller", + "GalilDMC4133Motor", + "GalilDMC4133VectorMode", +] diff --git a/qcodes/instrument_drivers/Galil/dmc_41x3.py b/qcodes/instrument_drivers/Galil/dmc_41x3.py index ba3742eb4f12..4bcf9555bed1 100644 --- a/qcodes/instrument_drivers/Galil/dmc_41x3.py +++ b/qcodes/instrument_drivers/Galil/dmc_41x3.py @@ -106,12 +106,14 @@ def motion_complete(self, axes: str) -> None: self.g.GMotionComplete(axes) -class VectorMode(InstrumentChannel): +class GalilDMC4133VectorMode(InstrumentChannel): """ Class to control motors in vector mode """ - def __init__(self, parent: "DMC4133Controller", name: str, **kwargs: Any) -> None: + def __init__( + self, parent: "GalilDMC4133Controller", name: str, **kwargs: Any + ) -> None: """ Initializes the vector mode submodule for the controller @@ -226,12 +228,20 @@ def clear_sequence(self, coord_sys: str) -> None: self.write(f"CS {coord_sys}") -class Motor(InstrumentChannel): +VectorMode = GalilDMC4133VectorMode +""" +Alias for backwards compatibility +""" + + +class GalilDMC4133Motor(InstrumentChannel): """ Class to control a single motor (independent of possible other motors) """ - def __init__(self, parent: "DMC4133Controller", name: str, **kwargs: Any) -> None: + def __init__( + self, parent: "GalilDMC4133Controller", name: str, **kwargs: Any + ) -> None: """ Initializes individual motor submodules @@ -428,7 +438,13 @@ def error_magnitude(self) -> float: return float(self.ask(f"QS{self._axis}=?")) -class DMC4133Controller(GalilMotionController): +Motor = GalilDMC4133Motor +""" +Alias for backwards compatibility +""" + + +class GalilDMC4133Controller(GalilMotionController): """ Driver for Galil DMC-4133 Controller """ @@ -471,12 +487,12 @@ def __init__(self, name: str, address: str, **kwargs: Any) -> None: ) self._set_default_update_time() - self.add_submodule("motor_a", Motor(self, "A")) - self.add_submodule("motor_b", Motor(self, "B")) - self.add_submodule("motor_c", Motor(self, "C")) - self.add_submodule("plane_ab", VectorMode(self, "AB")) - self.add_submodule("plane_bc", VectorMode(self, "BC")) - self.add_submodule("plane_ac", VectorMode(self, "AC")) + self.add_submodule("motor_a", GalilDMC4133Motor(self, "A")) + self.add_submodule("motor_b", GalilDMC4133Motor(self, "B")) + self.add_submodule("motor_c", GalilDMC4133Motor(self, "C")) + self.add_submodule("plane_ab", GalilDMC4133VectorMode(self, "AB")) + self.add_submodule("plane_bc", GalilDMC4133VectorMode(self, "BC")) + self.add_submodule("plane_ac", GalilDMC4133VectorMode(self, "AC")) def _set_default_update_time(self) -> None: """ @@ -556,7 +572,13 @@ def wait_till_motion_complete(self) -> None: self.motors_off() -class Arm: +DMC4133Controller = GalilDMC4133Controller +""" +Alias for backwards compatibility +""" + + +class GalilDMC4133Arm: """ Module to control probe arm. It is assumed that the chip to be probed has one or more rows with each row having one or more pads. Design of the @@ -574,7 +596,7 @@ class Arm: of the chip. """ - def __init__(self, controller: DMC4133Controller) -> None: + def __init__(self, controller: GalilDMC4133Controller) -> None: """ Initializes the arm class @@ -1080,3 +1102,9 @@ def _calculate_vector_component(vec: float, val: int) -> int: assert return_val % 1024 == 0 return return_val + + +Arm = GalilDMC4133Arm +""" +Alias for backwards compatibility +""" From 6bca502c676905015b6ed129f98548f08e0987d6 Mon Sep 17 00:00:00 2001 From: "Jens H. Nielsen" Date: Wed, 11 Jan 2023 18:36:30 +0100 Subject: [PATCH 2/3] Add public api docs for Galil --- docs/drivers_api/Galil.rst | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 docs/drivers_api/Galil.rst diff --git a/docs/drivers_api/Galil.rst b/docs/drivers_api/Galil.rst new file mode 100644 index 000000000000..580a78a23b82 --- /dev/null +++ b/docs/drivers_api/Galil.rst @@ -0,0 +1,7 @@ +.. _Galil_api : + +Galil Drivers +============= + +.. automodule:: qcodes.instrument_drivers.Galil + :autosummary: From 6a933ee4902a3ba4f909360e67aaedea2931c6a8 Mon Sep 17 00:00:00 2001 From: "Jens H. Nielsen" Date: Wed, 11 Jan 2023 18:37:51 +0100 Subject: [PATCH 3/3] exclude Galil from old api docs --- docs/Makefile | 1 + docs/make.bat | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/Makefile b/docs/Makefile index 0169e6c65ce7..7be6e86f9c76 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -31,6 +31,7 @@ genapi: ../qcodes/instrument_drivers/AimTTi \ ../qcodes/instrument_drivers/AlazarTech \ ../qcodes/instrument_drivers/basel \ + ../qcodes/instrument_drivers/Galil \ ../qcodes/instrument_drivers/HP \ ../qcodes/instrument_drivers/ithaco \ ../qcodes/instrument_drivers/Keithley \ diff --git a/docs/make.bat b/docs/make.bat index f2274177086e..948f181765ba 100644 --- a/docs/make.bat +++ b/docs/make.bat @@ -42,6 +42,7 @@ sphinx-apidoc -o _auto -d 10 ..\qcodes ^ ..\qcodes\instrument_drivers\AlazarTech ^ ..\qcodes\instrument_drivers\american_magnetics\* ^ ..\qcodes\instrument_drivers\basel ^ + ..\qcodes\instrument_drivers\Galil ^ ..\qcodes\instrument_drivers\HP ^ ..\qcodes\instrument_drivers\ithaco ^ ..\qcodes\instrument_drivers\Keithley ^