diff --git a/.readthedocs.yml b/.readthedocs.yml index a08b5496..1fc493f4 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,8 +1,8 @@ version: 2 build: - os: ubuntu-20.04 + os: ubuntu-24.04 tools: - python: "3.9" + python: "3.13" sphinx: builder: html @@ -10,6 +10,8 @@ sphinx: fail_on_warning: false python: - install: - - method: pip - path: . + install: + - method: pip + path: . + extra_requirements: + - docs diff --git a/doc/source/conf.py b/doc/source/conf.py index 4fa33ded..42ee817a 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -39,7 +39,7 @@ templates_path = ["_templates"] # The suffix of source filenames. -source_suffix = ".rst" +source_suffix = {".rst": "restructuredtext"} # The encoding of source files. # source_encoding = 'utf-8-sig' @@ -49,7 +49,7 @@ # General information about the project. project = "InstrumentKit Library" -copyright = "2013-2022, Steven Casagrande" +copyright = "2013-2025, Steven Casagrande" # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -99,7 +99,7 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = "default" +html_theme = "sphinx_rtd_theme" # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the @@ -128,7 +128,7 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] +# html_static_path = ["_static"] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. @@ -266,7 +266,6 @@ # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = { - "http://docs.python.org/": None, "numpy": ("http://docs.scipy.org/doc/numpy", None), "serial": ("http://pyserial.sourceforge.net/", None), "pint": ("https://pint.readthedocs.io/en/stable/", None), diff --git a/doc/source/devguide/testing.rst b/doc/source/devguide/testing.rst index 6373785a..f6ec78fd 100644 --- a/doc/source/devguide/testing.rst +++ b/doc/source/devguide/testing.rst @@ -84,7 +84,7 @@ Expected Protocols ================== As an example of asserting correctness of implemented protocols, let's consider -a simple test case for :class:`instruments.srs.SRSDG645``:: +a simple test case for :class:`instruments.srs.SRSDG645`:: def test_srsdg645_output_level(): """ diff --git a/license/AUTHOR.TXT b/license/AUTHOR.TXT index 3fac3c1c..5456b6fd 100644 --- a/license/AUTHOR.TXT +++ b/license/AUTHOR.TXT @@ -4,4 +4,4 @@ Steven Casagrande stevencasagrande@gmail.com twitter.com/stevecasagrande -2012-2022 +2012-2025 diff --git a/pyproject.toml b/pyproject.toml index 15794c9d..53f7525f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,6 +56,10 @@ dev = [ "pyvisa-sim", "six", ] +docs = [ + "sphinx~=8.2.0", + "sphinx_rtd_theme" +] [tool.setuptools] include-package-data = true diff --git a/src/instruments/abstract_instruments/instrument.py b/src/instruments/abstract_instruments/instrument.py index 65b4e045..424f0c97 100644 --- a/src/instruments/abstract_instruments/instrument.py +++ b/src/instruments/abstract_instruments/instrument.py @@ -256,8 +256,8 @@ def write(self, msg): channel related work. .. seealso:: `Instrument.sendcmd` if you wish to send a string to the - instrument, while still having InstrumentKit handle termination - characters and other communication channel related work. + instrument, while still having InstrumentKit handle termination + characters and other communication channel related work. :param str msg: String that will be written to the filelike object (`Instrument._file`) attached to this instrument. diff --git a/src/instruments/holzworth/holzworth_hs9000.py b/src/instruments/holzworth/holzworth_hs9000.py index 8540f5af..beacd63b 100644 --- a/src/instruments/holzworth/holzworth_hs9000.py +++ b/src/instruments/holzworth/holzworth_hs9000.py @@ -34,7 +34,7 @@ class Channel(SGChannel): Class representing a physical channel on the Holzworth HS9000 .. warning:: This class should NOT be manually created by the user. It - is designed to be initialized by the `HS9000` class. + is designed to be initialized by the `HS9000` class. """ def __init__(self, hs, idx_chan): diff --git a/src/instruments/minghe/mhs5200a.py b/src/instruments/minghe/mhs5200a.py index a8497c02..909f878a 100644 --- a/src/instruments/minghe/mhs5200a.py +++ b/src/instruments/minghe/mhs5200a.py @@ -112,7 +112,7 @@ def frequency(self): Gets/Sets the frequency of this channel. :units: As specified (if a `~pint.Quantity`) or assumed to be - of units hertz. + of units hertz. :type: `~pint.Quantity` """ query = f":r{self._chan}f" @@ -152,7 +152,7 @@ def phase(self): Gets/Sets the phase of this channel. :units: As specified (if a `~pint.Quantity`) or assumed to be - of degrees. + of degrees. :type: `~pint.Quantity` """ # need to convert @@ -201,10 +201,10 @@ def channel(self): For instance, this would print the counts of the first channel:: - >>> import instruments as ik - >>> mhs = ik.minghe.MHS5200.open_serial(vid=1027, pid=24577, - baud=19200, timeout=1) - >>> print(mhs.channel[0].frequency) + >>> import instruments as ik + >>> mhs = ik.minghe.MHS5200.open_serial(vid=1027, pid=24577, + baud=19200, timeout=1) + >>> print(mhs.channel[0].frequency) :rtype: `list`[`MHS5200.Channel`] """ diff --git a/src/instruments/newport/agilis.py b/src/instruments/newport/agilis.py index 2d6d0784..a9ba116f 100644 --- a/src/instruments/newport/agilis.py +++ b/src/instruments/newport/agilis.py @@ -141,11 +141,11 @@ def jog(self): -3 — Negative direction, 1700 steps/s at max. step amplitude. -2 — Negative direction, 100 step/s at max. step amplitude. -1 — Negative direction, 5 steps/s at defined step amplitude. - 0 — No move, go to READY state. - 1 — Positive direction, 5 steps/s at defined step amplitude. - 2 — Positive direction, 100 steps/s at max. step amplitude. - 3 — Positive direction, 1700 steps/s at max. step amplitude. - 4 — Positive direction, 666 steps/s at defined step amplitude. + +0 — No move, go to READY state. + +1 — Positive direction, 5 steps/s at defined step amplitude. + +2 — Positive direction, 100 steps/s at max. step amplitude. + +3 — Positive direction, 1700 steps/s at max. step amplitude. + +4 — Positive direction, 666 steps/s at defined step amplitude. :return: Jog motion set :rtype: `int` @@ -427,12 +427,13 @@ def limit_status(self): Returns the limit switch status of the controller. Possible returns are: - - PH0: No limit switch is active - - PH1: Limit switch of axis #1 (X) is active, - limit switch of axis #2 (Y) is not active - - PH2: Limit switch of axis #2 (Y) is active, - limit switch of axis #1 (X) is not active - - PH3: Limit switches of axis #1 (X) and axis #2 (Y) are active + + - PH0: No limit switch is active + - PH1: Limit switch of axis #1 (X) is active, + limit switch of axis #2 (Y) is not active + - PH2: Limit switch of axis #2 (Y) is active, + limit switch of axis #1 (X) is not active + - PH3: Limit switches of axis #1 (X) and axis #2 (Y) are active If device has no limit switch, this routine always returns PH0 """ @@ -443,7 +444,7 @@ def limit_status(self): @property def sleep_time(self): """ - The device often times out. Therefore a sleep time can be set. The + The device often times out. Therefore, a sleep time can be set. The routine will wait for this amount (in seconds) every time after a command or a query are sent. Setting the sleep time: Give time in seconds diff --git a/src/instruments/newport/newport_pmc8742.py b/src/instruments/newport/newport_pmc8742.py index 91e5445f..09efcdc8 100644 --- a/src/instruments/newport/newport_pmc8742.py +++ b/src/instruments/newport/newport_pmc8742.py @@ -445,23 +445,23 @@ def controller_configuration(self): """Get / set configuration of some of the controller’s features. Configuration is given as a bit mask. If changed, please save - the settings afterwards if you would like to do so. See + the settings afterward if you would like to do so. See `save_settings`. The bitmask to be set can be either given as a number, or as a string of the mask itself. The following values are equivalent: 3, 0b11, "11" - Bit 0: - Value 0: Perform auto motor detection. Check and set motor - type automatically when commanded to move. - Value 1: Do not perform auto motor detection on move. - Bit 1: - Value 0: Do not scan for motors connected to controllers upon - reboot (Performs ‘MC’ command upon power-up, reset or - reboot). - Value 1: Scan for motors connected to controller upon power-up - or reset. + - Bit 0: + - Value 0: Perform auto motor detection. Check and set motor + type automatically when commanded to move. + - Value 1: Do not perform auto motor detection on move. + - Bit 1: + - Value 0: Do not scan for motors connected to controllers upon + reboot (Performs ‘MC’ command upon power-up, reset or + reboot). + - Value 1: Scan for motors connected to controller upon power-up + or reset. :return: Bitmask of the controller configuration. :rtype: str, binary configuration @@ -547,12 +547,12 @@ def recall_parameters(self, value=0): saved in its non-volatile memory. It is useful when, for example, the user has been exploring and changing parameters (e.g., velocity) but then chooses to reload from previously stored, qualified - settings. Note that “*RCL 0” command just restores the working + settings. Note that `*RCL 0` command just restores the working parameters to factory default settings. It does not change the settings saved in EEPROM. :param value: 0 -> Recall factory default, - 1 -> Recall last saved settings + 1 -> Recall last saved settings :type int: """ self.sendcmd(f"*RCL{1 if value else 0}", axs=False) @@ -564,7 +564,7 @@ def reset(self): hard reset, see the `purge` command. ..note:: It might take up to 30 seconds to re-establish - communications via TCP/IP + communications via TCP/IP """ self.sendcmd("*RST", axs=False) @@ -681,19 +681,19 @@ def controller_configuration(self): """Get / set configuration of some of the controller’s features. Configuration is given as a bit mask. If changed, please save - the settings afterwards if you would like to do so. See + the settings afterward if you would like to do so. See `save_settings`. - Bit 0: - Value 0: Perform auto motor detection. Check and set motor - type automatically when commanded to move. - Value 1: Do not perform auto motor detection on move. - Bit 1: - Value 0: Do not scan for motors connected to controllers upon - reboot (Performs ‘MC’ command upon power-up, reset or - reboot). - Value 1: Scan for motors connected to controller upon power-up - or reset. + - Bit 0: + - Value 0: Perform auto motor detection. Check and set motor + type automatically when commanded to move. + - Value 1: Do not perform auto motor detection on move. + - Bit 1: + - Value 0: Do not scan for motors connected to controllers upon + reboot (Performs ‘MC’ command upon power-up, reset or + reboot). + - Value 1: Scan for motors connected to controller upon power-up + or reset. :return: Bitmask of the controller configuration. :rtype: str @@ -944,7 +944,7 @@ def scan_controllers(self): Bit: Value: (True: 1, False: 0) 0 Address conflict? 1: Controller with address 1 exists? - ... + <...> 31: Controller with address 31 exists Bits 1—31 are one-to-one mapped to controller addresses 1—31. The @@ -1026,6 +1026,7 @@ def scan(self, value=2): Scans the RS-485 network for connected controllers and set the addresses automatically. Three possible scan modes can be selected: + Mode 0: Primary controller scans the network but does not resolve any address conflicts. @@ -1086,7 +1087,7 @@ def recall_parameters(self, value=0): saved in its non-volatile memory. It is useful when, for example, the user has been exploring and changing parameters (e.g., velocity) but then chooses to reload from previously stored, qualified - settings. Note that “*RCL 0” command just restores the working + settings. Note that `*RCL 0` command just restores the working parameters to factory default settings. It does not change the settings saved in EEPROM. diff --git a/src/instruments/pfeiffer/tpg36x.py b/src/instruments/pfeiffer/tpg36x.py index dc741097..31345e73 100644 --- a/src/instruments/pfeiffer/tpg36x.py +++ b/src/instruments/pfeiffer/tpg36x.py @@ -196,7 +196,7 @@ def ethernet_configuration(self): >>> import instruments as ik >>> inst = ik.pfeiffer.TPG36x.open_serial("/dev/ttyUSB0", 9600) >>> inst.ethernet_configuration = [inst.EthernetMode.STATIC, "192.168.1.42", "255.255.255.0", "192.168.1.1"] - >>> inst.ethernet_configuration + >>> inst.ethernet_configuration [, "192.168.1.42", "255.255.255.0", "192.168.1.1"] """ return_list = self.query("ETH").split(",") diff --git a/src/instruments/qubitekk/mc1.py b/src/instruments/qubitekk/mc1.py index c95fa56b..d2ea9ab2 100644 --- a/src/instruments/qubitekk/mc1.py +++ b/src/instruments/qubitekk/mc1.py @@ -149,7 +149,7 @@ def internal_position(self): doc=""" Gets/sets the output port of the optical switch. 0 means input 1 is directed to output 1, and input 2 is directed to output 2. 1 means that - input 1 is directed to output 2 and input 2 is directed to output 1. + input 1 is directed to output 2 and input 2 is directed to output 1. :type: `int` """, diff --git a/src/instruments/sunpower/cryotel_gt.py b/src/instruments/sunpower/cryotel_gt.py index f332062e..86223d14 100644 --- a/src/instruments/sunpower/cryotel_gt.py +++ b/src/instruments/sunpower/cryotel_gt.py @@ -113,7 +113,7 @@ def control_mode(self): Valid options are `ControlMode.POWER` and `ControlMode.TEMPERATURE`. .. note:: The set control mode will be reset after a power cycle unless you also - call the `save_control_mode()` method. + call the `save_control_mode()` method. :return: The current control mode. """ diff --git a/src/instruments/tektronix/tekawg2000.py b/src/instruments/tektronix/tekawg2000.py index af4075ee..332711ac 100644 --- a/src/instruments/tektronix/tekawg2000.py +++ b/src/instruments/tektronix/tekawg2000.py @@ -28,7 +28,7 @@ class Channel: Class representing a physical channel on the Tektronix AWG 2000 .. warning:: This class should NOT be manually created by the user. It - is designed to be initialized by the `TekAWG2000` class. + is designed to be initialized by the `TekAWG2000` class. """ def __init__(self, tek, idx): @@ -99,7 +99,7 @@ def frequency(self): Gets/sets the frequency of the specified channel when using the built-in function generator. - ::units: As specified (if a `~pint.Quantity`) or assumed to be + :units: As specified (if a `~pint.Quantity`) or assumed to be of units Hertz. :type: `~pint.Quantity` with units Hertz. """ diff --git a/src/instruments/teledyne/maui.py b/src/instruments/teledyne/maui.py index d2349c48..7eded2e3 100644 --- a/src/instruments/teledyne/maui.py +++ b/src/instruments/teledyne/maui.py @@ -443,7 +443,7 @@ class Operators: """ Sets the operator for a given channel. Most operators need a source `src`. If the source is given - as an integer, it is assume that the a signal channel is + as an integer, it is assumed that a signal channel is requested. If you want to select another math channel for example, you will need to specify the source as a tuple: Example: `src=('f', 0)` would represent the first function @@ -454,10 +454,10 @@ class Operators: possibilities. .. note:: Your oscilloscope might not have all functions - that are described here. Also: Not all possibilities are - currently implemented. However, extension of this - functionality should be simple when following the given - structure + that are described here. Also: Not all possibilities are + currently implemented. However, extension of this + functionality should be simple when following the given + structure """ def __init__(self, parent): @@ -1247,14 +1247,14 @@ def trigger_source(self): """Sets / Gets the trigger source. .. note:: The `TriggerSource` class is dynamically generated - when the number of channels is switched. The above shown class - is only the default! Channels are added and removed, as - required. + when the number of channels is switched. The above shown class + is only the default! Channels are added and removed, as + required. .. warning:: If a trigger type is currently set on the oscilloscope that is not implemented in this class, setting the source will fail. The oscilloscope is set up - such that the the trigger type and source are set at the + such that the trigger type and source are set at the same time. However, for convenience, these two properties are split apart here. diff --git a/src/instruments/thorlabs/thorlabsapt.py b/src/instruments/thorlabs/thorlabsapt.py index 3771f0f6..a4e57b19 100644 --- a/src/instruments/thorlabs/thorlabsapt.py +++ b/src/instruments/thorlabs/thorlabsapt.py @@ -497,7 +497,7 @@ def enabled_single(self): """Get / Set single axis enabled. .. note:: Enabling multi channels for KIM101 is defined in - the controller class. + the controller class. :return: Axis status enabled. :rtype: bool diff --git a/src/instruments/toptica/topmode.py b/src/instruments/toptica/topmode.py index 1f50e213..648300cf 100644 --- a/src/instruments/toptica/topmode.py +++ b/src/instruments/toptica/topmode.py @@ -63,7 +63,7 @@ class Laser: Class representing a laser on the Toptica Topmode. .. warning:: This class should NOT be manually created by the user. It - is designed to be initialized by the `Topmode` class. + is designed to be initialized by the `Topmode` class. """ def __init__(self, parent, idx): diff --git a/src/instruments/yokogawa/yokogawa6370.py b/src/instruments/yokogawa/yokogawa6370.py index d80c735f..f954808d 100644 --- a/src/instruments/yokogawa/yokogawa6370.py +++ b/src/instruments/yokogawa/yokogawa6370.py @@ -75,6 +75,7 @@ class Channel(OpticalSpectrumAnalyzer.Channel): """ Class representing the channels on the Yokogawa 6370. This class inherits from `OpticalSpectrumAnalyzer.Channel`. + .. warning:: This class should NOT be manually created by the user. It is designed to be initialized by the `Yokogawa6370` class. """