Skip to content

Commit 2cc3288

Browse files
authored
Update docs build (#456)
- updates readthedocs runner to 24.04 and py313 - fixes for sphinx 8 - applies the readthedocs theme - fixes all but 1 warning which fixes a bunch of rendering errors - fixes some typos
1 parent 40bd115 commit 2cc3288

File tree

18 files changed

+84
-76
lines changed

18 files changed

+84
-76
lines changed

.readthedocs.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
version: 2
22
build:
3-
os: ubuntu-20.04
3+
os: ubuntu-24.04
44
tools:
5-
python: "3.9"
5+
python: "3.13"
66

77
sphinx:
88
builder: html
99
configuration: doc/source/conf.py
1010
fail_on_warning: false
1111

1212
python:
13-
install:
14-
- method: pip
15-
path: .
13+
install:
14+
- method: pip
15+
path: .
16+
extra_requirements:
17+
- docs

doc/source/conf.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
templates_path = ["_templates"]
4040

4141
# The suffix of source filenames.
42-
source_suffix = ".rst"
42+
source_suffix = {".rst": "restructuredtext"}
4343

4444
# The encoding of source files.
4545
# source_encoding = 'utf-8-sig'
@@ -49,7 +49,7 @@
4949

5050
# General information about the project.
5151
project = "InstrumentKit Library"
52-
copyright = "2013-2022, Steven Casagrande"
52+
copyright = "2013-2025, Steven Casagrande"
5353

5454
# The version info for the project you're documenting, acts as replacement for
5555
# |version| and |release|, also used in various other places throughout the
@@ -99,7 +99,7 @@
9999

100100
# The theme to use for HTML and HTML Help pages. See the documentation for
101101
# a list of builtin themes.
102-
html_theme = "default"
102+
html_theme = "sphinx_rtd_theme"
103103

104104
# Theme options are theme-specific and customize the look and feel of a theme
105105
# further. For a list of options available for each theme, see the
@@ -128,7 +128,7 @@
128128
# Add any paths that contain custom static files (such as style sheets) here,
129129
# relative to this directory. They are copied after the builtin static files,
130130
# so a file named "default.css" will overwrite the builtin "default.css".
131-
html_static_path = ["_static"]
131+
# html_static_path = ["_static"]
132132

133133
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
134134
# using the given strftime format.
@@ -266,7 +266,6 @@
266266

267267
# Example configuration for intersphinx: refer to the Python standard library.
268268
intersphinx_mapping = {
269-
"http://docs.python.org/": None,
270269
"numpy": ("http://docs.scipy.org/doc/numpy", None),
271270
"serial": ("http://pyserial.sourceforge.net/", None),
272271
"pint": ("https://pint.readthedocs.io/en/stable/", None),

doc/source/devguide/testing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Expected Protocols
8484
==================
8585

8686
As an example of asserting correctness of implemented protocols, let's consider
87-
a simple test case for :class:`instruments.srs.SRSDG645``::
87+
a simple test case for :class:`instruments.srs.SRSDG645`::
8888

8989
def test_srsdg645_output_level():
9090
"""

license/AUTHOR.TXT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ Steven Casagrande
44
55
twitter.com/stevecasagrande
66

7-
2012-2022
7+
2012-2025

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ dev = [
5656
"pyvisa-sim",
5757
"six",
5858
]
59+
docs = [
60+
"sphinx~=8.2.0",
61+
"sphinx_rtd_theme"
62+
]
5963

6064
[tool.setuptools]
6165
include-package-data = true

src/instruments/abstract_instruments/instrument.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,8 @@ def write(self, msg):
256256
channel related work.
257257
258258
.. seealso:: `Instrument.sendcmd` if you wish to send a string to the
259-
instrument, while still having InstrumentKit handle termination
260-
characters and other communication channel related work.
259+
instrument, while still having InstrumentKit handle termination
260+
characters and other communication channel related work.
261261
262262
:param str msg: String that will be written to the filelike object
263263
(`Instrument._file`) attached to this instrument.

src/instruments/holzworth/holzworth_hs9000.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Channel(SGChannel):
3434
Class representing a physical channel on the Holzworth HS9000
3535
3636
.. warning:: This class should NOT be manually created by the user. It
37-
is designed to be initialized by the `HS9000` class.
37+
is designed to be initialized by the `HS9000` class.
3838
"""
3939

4040
def __init__(self, hs, idx_chan):

src/instruments/minghe/mhs5200a.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def frequency(self):
112112
Gets/Sets the frequency of this channel.
113113
114114
:units: As specified (if a `~pint.Quantity`) or assumed to be
115-
of units hertz.
115+
of units hertz.
116116
:type: `~pint.Quantity`
117117
"""
118118
query = f":r{self._chan}f"
@@ -152,7 +152,7 @@ def phase(self):
152152
Gets/Sets the phase of this channel.
153153
154154
:units: As specified (if a `~pint.Quantity`) or assumed to be
155-
of degrees.
155+
of degrees.
156156
:type: `~pint.Quantity`
157157
"""
158158
# need to convert
@@ -201,10 +201,10 @@ def channel(self):
201201
202202
For instance, this would print the counts of the first channel::
203203
204-
>>> import instruments as ik
205-
>>> mhs = ik.minghe.MHS5200.open_serial(vid=1027, pid=24577,
206-
baud=19200, timeout=1)
207-
>>> print(mhs.channel[0].frequency)
204+
>>> import instruments as ik
205+
>>> mhs = ik.minghe.MHS5200.open_serial(vid=1027, pid=24577,
206+
baud=19200, timeout=1)
207+
>>> print(mhs.channel[0].frequency)
208208
209209
:rtype: `list`[`MHS5200.Channel`]
210210
"""

src/instruments/newport/agilis.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,11 @@ def jog(self):
141141
-3 — Negative direction, 1700 steps/s at max. step amplitude.
142142
-2 — Negative direction, 100 step/s at max. step amplitude.
143143
-1 — Negative direction, 5 steps/s at defined step amplitude.
144-
0 — No move, go to READY state.
145-
1 — Positive direction, 5 steps/s at defined step amplitude.
146-
2 — Positive direction, 100 steps/s at max. step amplitude.
147-
3 — Positive direction, 1700 steps/s at max. step amplitude.
148-
4 — Positive direction, 666 steps/s at defined step amplitude.
144+
+0 — No move, go to READY state.
145+
+1 — Positive direction, 5 steps/s at defined step amplitude.
146+
+2 — Positive direction, 100 steps/s at max. step amplitude.
147+
+3 — Positive direction, 1700 steps/s at max. step amplitude.
148+
+4 — Positive direction, 666 steps/s at defined step amplitude.
149149
150150
:return: Jog motion set
151151
:rtype: `int`
@@ -427,12 +427,13 @@ def limit_status(self):
427427
428428
Returns the limit switch status of the controller. Possible returns
429429
are:
430-
- PH0: No limit switch is active
431-
- PH1: Limit switch of axis #1 (X) is active,
432-
limit switch of axis #2 (Y) is not active
433-
- PH2: Limit switch of axis #2 (Y) is active,
434-
limit switch of axis #1 (X) is not active
435-
- PH3: Limit switches of axis #1 (X) and axis #2 (Y) are active
430+
431+
- PH0: No limit switch is active
432+
- PH1: Limit switch of axis #1 (X) is active,
433+
limit switch of axis #2 (Y) is not active
434+
- PH2: Limit switch of axis #2 (Y) is active,
435+
limit switch of axis #1 (X) is not active
436+
- PH3: Limit switches of axis #1 (X) and axis #2 (Y) are active
436437
437438
If device has no limit switch, this routine always returns PH0
438439
"""
@@ -443,7 +444,7 @@ def limit_status(self):
443444
@property
444445
def sleep_time(self):
445446
"""
446-
The device often times out. Therefore a sleep time can be set. The
447+
The device often times out. Therefore, a sleep time can be set. The
447448
routine will wait for this amount (in seconds) every time after a
448449
command or a query are sent.
449450
Setting the sleep time: Give time in seconds

src/instruments/newport/newport_pmc8742.py

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -445,23 +445,23 @@ def controller_configuration(self):
445445
"""Get / set configuration of some of the controller’s features.
446446
447447
Configuration is given as a bit mask. If changed, please save
448-
the settings afterwards if you would like to do so. See
448+
the settings afterward if you would like to do so. See
449449
`save_settings`.
450450
451451
The bitmask to be set can be either given as a number, or as a
452452
string of the mask itself. The following values are equivalent:
453453
3, 0b11, "11"
454454
455-
Bit 0:
456-
Value 0: Perform auto motor detection. Check and set motor
457-
type automatically when commanded to move.
458-
Value 1: Do not perform auto motor detection on move.
459-
Bit 1:
460-
Value 0: Do not scan for motors connected to controllers upon
461-
reboot (Performs ‘MC’ command upon power-up, reset or
462-
reboot).
463-
Value 1: Scan for motors connected to controller upon power-up
464-
or reset.
455+
- Bit 0:
456+
- Value 0: Perform auto motor detection. Check and set motor
457+
type automatically when commanded to move.
458+
- Value 1: Do not perform auto motor detection on move.
459+
- Bit 1:
460+
- Value 0: Do not scan for motors connected to controllers upon
461+
reboot (Performs ‘MC’ command upon power-up, reset or
462+
reboot).
463+
- Value 1: Scan for motors connected to controller upon power-up
464+
or reset.
465465
466466
:return: Bitmask of the controller configuration.
467467
:rtype: str, binary configuration
@@ -547,12 +547,12 @@ def recall_parameters(self, value=0):
547547
saved in its non-volatile memory. It is useful when, for example,
548548
the user has been exploring and changing parameters (e.g., velocity)
549549
but then chooses to reload from previously stored, qualified
550-
settings. Note that *RCL 0 command just restores the working
550+
settings. Note that `*RCL 0` command just restores the working
551551
parameters to factory default settings. It does not change the
552552
settings saved in EEPROM.
553553
554554
:param value: 0 -> Recall factory default,
555-
1 -> Recall last saved settings
555+
1 -> Recall last saved settings
556556
:type int:
557557
"""
558558
self.sendcmd(f"*RCL{1 if value else 0}", axs=False)
@@ -564,7 +564,7 @@ def reset(self):
564564
hard reset, see the `purge` command.
565565
566566
..note:: It might take up to 30 seconds to re-establish
567-
communications via TCP/IP
567+
communications via TCP/IP
568568
"""
569569
self.sendcmd("*RST", axs=False)
570570

@@ -681,19 +681,19 @@ def controller_configuration(self):
681681
"""Get / set configuration of some of the controller’s features.
682682
683683
Configuration is given as a bit mask. If changed, please save
684-
the settings afterwards if you would like to do so. See
684+
the settings afterward if you would like to do so. See
685685
`save_settings`.
686686
687-
Bit 0:
688-
Value 0: Perform auto motor detection. Check and set motor
689-
type automatically when commanded to move.
690-
Value 1: Do not perform auto motor detection on move.
691-
Bit 1:
692-
Value 0: Do not scan for motors connected to controllers upon
693-
reboot (Performs ‘MC’ command upon power-up, reset or
694-
reboot).
695-
Value 1: Scan for motors connected to controller upon power-up
696-
or reset.
687+
- Bit 0:
688+
- Value 0: Perform auto motor detection. Check and set motor
689+
type automatically when commanded to move.
690+
- Value 1: Do not perform auto motor detection on move.
691+
- Bit 1:
692+
- Value 0: Do not scan for motors connected to controllers upon
693+
reboot (Performs ‘MC’ command upon power-up, reset or
694+
reboot).
695+
- Value 1: Scan for motors connected to controller upon power-up
696+
or reset.
697697
698698
:return: Bitmask of the controller configuration.
699699
:rtype: str
@@ -944,7 +944,7 @@ def scan_controllers(self):
944944
Bit: Value: (True: 1, False: 0)
945945
0 Address conflict?
946946
1: Controller with address 1 exists?
947-
...
947+
<...>
948948
31: Controller with address 31 exists
949949
950950
Bits 1—31 are one-to-one mapped to controller addresses 1—31. The
@@ -1026,6 +1026,7 @@ def scan(self, value=2):
10261026
Scans the RS-485 network for connected controllers and set the
10271027
addresses automatically. Three possible scan modes can be
10281028
selected:
1029+
10291030
Mode 0:
10301031
Primary controller scans the network but does not resolve
10311032
any address conflicts.
@@ -1086,7 +1087,7 @@ def recall_parameters(self, value=0):
10861087
saved in its non-volatile memory. It is useful when, for example,
10871088
the user has been exploring and changing parameters (e.g., velocity)
10881089
but then chooses to reload from previously stored, qualified
1089-
settings. Note that *RCL 0 command just restores the working
1090+
settings. Note that `*RCL 0` command just restores the working
10901091
parameters to factory default settings. It does not change the
10911092
settings saved in EEPROM.
10921093

0 commit comments

Comments
 (0)