Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
version: 2
build:
os: ubuntu-20.04
os: ubuntu-24.04
tools:
python: "3.9"
python: "3.13"

sphinx:
builder: html
configuration: doc/source/conf.py
fail_on_warning: false

python:
install:
- method: pip
path: .
install:
- method: pip
path: .
extra_requirements:
- docs
9 changes: 4 additions & 5 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion doc/source/devguide/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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():
"""
Expand Down
2 changes: 1 addition & 1 deletion license/AUTHOR.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ Steven Casagrande
stevencasagrande@gmail.com
twitter.com/stevecasagrande

2012-2022
2012-2025
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ dev = [
"pyvisa-sim",
"six",
]
docs = [
"sphinx~=8.2.0",
"sphinx_rtd_theme"
]

[tool.setuptools]
include-package-data = true
Expand Down
4 changes: 2 additions & 2 deletions src/instruments/abstract_instruments/instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/instruments/holzworth/holzworth_hs9000.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
12 changes: 6 additions & 6 deletions src/instruments/minghe/mhs5200a.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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`]
"""
Expand Down
25 changes: 13 additions & 12 deletions src/instruments/newport/agilis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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
"""
Expand All @@ -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
Expand Down
55 changes: 28 additions & 27 deletions src/instruments/newport/newport_pmc8742.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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)

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion src/instruments/pfeiffer/tpg36x.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
[<EthernetMode.STATIC: 0>, "192.168.1.42", "255.255.255.0", "192.168.1.1"]
"""
return_list = self.query("ETH").split(",")
Expand Down
2 changes: 1 addition & 1 deletion src/instruments/qubitekk/mc1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`
""",
Expand Down
2 changes: 1 addition & 1 deletion src/instruments/sunpower/cryotel_gt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand Down
4 changes: 2 additions & 2 deletions src/instruments/tektronix/tekawg2000.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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.
"""
Expand Down
18 changes: 9 additions & 9 deletions src/instruments/teledyne/maui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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):
Expand Down Expand Up @@ -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.

Expand Down
Loading
Loading