Skip to content

Commit 2b32b30

Browse files
Update docs
1 parent bd1ab8d commit 2b32b30

File tree

10 files changed

+86
-28
lines changed

10 files changed

+86
-28
lines changed

.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ version: 2
99
build:
1010
os: "ubuntu-22.04"
1111
tools:
12-
python: "3.8"
12+
python: "3.9"
1313

1414
# Build documentation in the "docs/" directory with Sphinx
1515
sphinx:

README.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
[![Documentation Status](https://readthedocs.org/projects/pystages/badge/?version=latest)](https://pystages.readthedocs.io/en/latest/?badge=latest)
2-
31
# PyStages
42

3+
[![Documentation Status](https://readthedocs.org/projects/pystages/badge/?version=latest)](https://pystages.readthedocs.io/en/latest/?badge=latest)
4+
55
PyStages is a Python 3 library for controlling motorized stages which have a
66
motion controller. It has been designed for microscopy test benches automation.
77

@@ -14,17 +14,28 @@ are implemented):
1414
- Tic Stepper Motor controller (USB only)
1515
- CNC Router with GRBL/GCode instructions (CNC 3018-PRO)
1616

17-
The library also provides helper classes for basic vector manipulation and
18-
autofocus calculation
17+
The library also provides helper classes for basic vector manipulation and
18+
autofocus computation.
1919

2020
## Documentation
2121

2222
Documentation is available on [Read the Docs](https://pystages.readthedocs.io).
2323

24+
## PyStages GUI
25+
26+
A user interface has been implemented to control the stages.
27+
28+
You can run it with the following command:
29+
30+
```bash
31+
python -m pystages.gui
32+
```
33+
2434
## Requirements
2535

2636
This library requires the following packages:
37+
2738
- [pyserial](https://pypi.org/project/pyserial/)
2839
- [numpy](https://pypi.org/project/numpy/)
2940
- [pyusb](https://pypi.org/project/pyusb/)
30-
- [PyQt6](https://pypi.org/project/PyQt6/)
41+
- [PyQt6](https://pypi.org/project/PyQt6/)

docs/api.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ Classes
1717
.. automodule:: pystages
1818
:members:
1919

20-
.. autoclass:: Autofocus
21-
:members:
20+
.. .. autoclass:: Autofocus
21+
.. :members:
2222
23-
.. autoclass:: Vector
24-
:special-members: __init__
25-
:members:
23+
.. .. autoclass:: Vector
24+
.. :special-members: __init__
25+
.. :members:
2626

docs/conf.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@
2121
# -- Project information -----------------------------------------------------
2222

2323
project = "pystages"
24-
copyright = "2022, Olivier Hériveaux, Manuel San Pedro, Michaël Mouchous"
24+
copyright = "2024, Olivier Hériveaux, Manuel San Pedro, Michaël Mouchous"
2525
author = "Olivier Hériveaux, Manuel San Pedro, Michaël Mouchous"
2626

2727
# The full version, including alpha/beta/rc tags
28-
release = "1.1"
28+
release = "1.1.1"
2929

3030

3131
# -- General configuration ---------------------------------------------------
3232

3333
# Add any Sphinx extension module names here, as strings. They can be
3434
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3535
# ones.
36-
extensions = ["sphinx.ext.autodoc"]
36+
extensions = ["sphinx.ext.autodoc", "myst_parser"]
3737

3838
# Add any paths that contain templates here, relative to this directory.
3939
templates_path = ["_templates"]
@@ -57,3 +57,8 @@
5757
html_static_path = []
5858

5959
html_logo = "logo.png"
60+
61+
source_suffix = {
62+
".rst": "restructuredtext",
63+
".md": "markdown",
64+
}

docs/gui.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# PyStages GUI
2+
3+
A user interface has been implemented to control the stages.
4+
5+
You can run it with the following command:
6+
7+
```bash
8+
python -m pystages.gui
9+
```
10+
11+
This tool presents basic controls. After connection to the stage, it polls the position and prints out
12+
at the bottom of the window.
13+
14+
## Stage selection and connection
15+
16+
Select the type of stage that you want to control and chose either a serial port to connect to, or select `Auto detect`
17+
to make pystage to select the correct one according to the device description.
18+
19+
Then click to `Connect`. If the connection success, the control buttons are activated.
20+
21+
## Relative move
22+
23+
You can click on buttons to move for a positive of negative relative distance.
24+
The direction correspond to the axis number of the stage (`X` for first axe, `Y` for the second one,
25+
`Z` for the third one). The moving distance is selected throug the `Step` dropdown menu.
26+
27+
## Absolute move
28+
29+
You can enter absolute coordinates in the 3 entry boxes and trigger the move by clicking the `Go To Position` button.
30+
31+
## Z offset
32+
33+
The `Z offset` checkbox and dropdown menu permit for each horizontal move (X or Y)
34+
to make first a vertical-up displacement (Z+) followed by the
35+
actual move, and then a final vertical-down displacement (Z-).
36+
37+
## Homing
38+
39+
The `Home` button permits to trigger the calibration process of the stage.
40+
Be careful that your setup is clear before using it.
41+

docs/index.rst

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
.. pystages documentation master file, created by
2-
sphinx-quickstart on Tue Jul 7 15:03:18 2020.
3-
You can adapt this file completely to your liking, but it should at least
4-
contain the root `toctree` directive.
5-
61
Welcome to pystages's documentation!
72
====================================
83

@@ -24,13 +19,14 @@ The library also provides helper classes for basic vector manipulation
2419
(:class:`pystages.Autofocus`).
2520

2621
.. toctree::
27-
:maxdepth: 2
28-
:caption: Contents:
29-
30-
Vectors <vectors.rst>
31-
Autofocus <autofocus.rst>
32-
Python API <api.rst>
33-
Troubleshooting <troubleshooting.rst>
22+
:maxdepth: 2
23+
:caption: Contents:
24+
25+
Vectors <vectors.rst>
26+
Autofocus <autofocus.rst>
27+
Python API <api.rst>
28+
GUI <gui.md>
29+
Troubleshooting <troubleshooting.rst>
3430

3531

3632
Indices and tables

docs/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ pyusb
33
numpy
44
sphinx
55
sphinx-rtd-theme
6+
myst-parser

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ authors = [
1111
]
1212
description = "Motorized stage control library for scientific applications"
1313
readme = "README.md"
14-
requires-python = ">=3.8"
14+
requires-python = ">=3.9"
1515
classifiers = [
1616
"Programming Language :: Python :: 3",
1717
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",

pystages/cncrouter.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@
3131

3232

3333
class CNCStatus(str, Enum):
34+
"""
35+
Possible statuses that the CNC can report.
36+
"""
37+
3438
IDLE = "Idle"
3539
RUN = "Run"
3640
HOLD = "Hold"

pystages/gui/gui.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def __init__(self):
169169
self.go_z = w = QLineEdit()
170170
w.setValidator(v)
171171
box.addWidget(w)
172-
w = QPushButton("Got to position")
172+
w = QPushButton("Go to position")
173173
w.clicked.connect(self.go_to_position)
174174
self.controls.append(w)
175175
box.addWidget(w)

0 commit comments

Comments
 (0)