pyobs-zaber 2.0.0.dev5__tar.gz → 2.0.0.dev7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyobs_zaber-2.0.0.dev7/.readthedocs.yml +15 -0
- {pyobs_zaber-2.0.0.dev5 → pyobs_zaber-2.0.0.dev7}/PKG-INFO +1 -1
- pyobs_zaber-2.0.0.dev7/README.md +53 -0
- pyobs_zaber-2.0.0.dev7/docs/Makefile +31 -0
- pyobs_zaber-2.0.0.dev7/docs/make.bat +36 -0
- pyobs_zaber-2.0.0.dev7/docs/requirements.txt +1 -0
- pyobs_zaber-2.0.0.dev7/docs/source/_static/pyobs.gif +0 -0
- pyobs_zaber-2.0.0.dev7/docs/source/conf.py +117 -0
- pyobs_zaber-2.0.0.dev7/docs/source/index.rst +34 -0
- {pyobs_zaber-2.0.0.dev5 → pyobs_zaber-2.0.0.dev7}/pyobs_zaber/zaberdriver.py +1 -1
- {pyobs_zaber-2.0.0.dev5 → pyobs_zaber-2.0.0.dev7}/pyobs_zaber/zabermodeselector.py +2 -2
- {pyobs_zaber-2.0.0.dev5 → pyobs_zaber-2.0.0.dev7}/pyproject.toml +1 -1
- {pyobs_zaber-2.0.0.dev5 → pyobs_zaber-2.0.0.dev7}/uv.lock +1 -1
- pyobs_zaber-2.0.0.dev5/README.md +0 -15
- {pyobs_zaber-2.0.0.dev5 → pyobs_zaber-2.0.0.dev7}/.github/workflows/pypi.yml +0 -0
- {pyobs_zaber-2.0.0.dev5 → pyobs_zaber-2.0.0.dev7}/.github/workflows/ruff.yml +0 -0
- {pyobs_zaber-2.0.0.dev5 → pyobs_zaber-2.0.0.dev7}/.pre-commit-config.yaml +0 -0
- {pyobs_zaber-2.0.0.dev5 → pyobs_zaber-2.0.0.dev7}/LICENSE +0 -0
- {pyobs_zaber-2.0.0.dev5 → pyobs_zaber-2.0.0.dev7}/pyobs_zaber/__init__.py +0 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
Zaber module for *pyobs*
|
|
2
|
+
========================
|
|
3
|
+
|
|
4
|
+
This is a [pyobs](https://www.pyobs.org) module for selecting between named positions (e.g. instrument ports)
|
|
5
|
+
on a [Zaber](https://www.zaber.com/) linear motor.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Install *pyobs-zaber*
|
|
9
|
+
-----------------------
|
|
10
|
+
Clone the repository:
|
|
11
|
+
|
|
12
|
+
git clone https://github.com/pyobs/pyobs-zaber.git
|
|
13
|
+
cd pyobs-zaber
|
|
14
|
+
|
|
15
|
+
Install it with [uv](https://docs.astral.sh/uv/):
|
|
16
|
+
|
|
17
|
+
uv sync
|
|
18
|
+
|
|
19
|
+
Alternatively, with plain `venv`/`pip`:
|
|
20
|
+
|
|
21
|
+
python3 -m venv .venv
|
|
22
|
+
source .venv/bin/activate
|
|
23
|
+
pip install .
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
Configuration
|
|
27
|
+
-------------
|
|
28
|
+
The *ZaberModeSelector* class takes a dictionary of named modes mapped to motor positions, plus some parameters
|
|
29
|
+
for the underlying Zaber driver:
|
|
30
|
+
|
|
31
|
+
modes:
|
|
32
|
+
Dictionary of available modes in the form {name: position}.
|
|
33
|
+
port:
|
|
34
|
+
USB port of the motor (default: /dev/ttyUSB1).
|
|
35
|
+
speed:
|
|
36
|
+
Velocity of the selector movement (default: 10000).
|
|
37
|
+
acceleration:
|
|
38
|
+
Acceleration of the selector movement (default: 800).
|
|
39
|
+
|
|
40
|
+
A basic module configuration would look like this:
|
|
41
|
+
|
|
42
|
+
class: pyobs_zaber.ZaberModeSelector
|
|
43
|
+
name: Mode selector
|
|
44
|
+
port: /dev/ttyUSB0
|
|
45
|
+
modes:
|
|
46
|
+
Photometry: 0
|
|
47
|
+
Spectroscopy: 50000
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
Dependencies
|
|
51
|
+
------------
|
|
52
|
+
* [pyobs-core](https://github.com/pyobs/pyobs-core) for the core functionality.
|
|
53
|
+
* [zaber-motion](https://pypi.org/project/zaber-motion/) for communicating with the motor.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Minimal makefile for Sphinx documentation
|
|
2
|
+
#
|
|
3
|
+
|
|
4
|
+
# You can set these variables from the command line.
|
|
5
|
+
SPHINXOPTS =
|
|
6
|
+
SPHINXBUILD = sphinx-build
|
|
7
|
+
SPHINXPROJ = pyobs
|
|
8
|
+
SOURCEDIR = source
|
|
9
|
+
BUILDDIR = ../.doc-build
|
|
10
|
+
|
|
11
|
+
#.EXPORT_ALL_VARIABLES:
|
|
12
|
+
|
|
13
|
+
#PYTHONPATH:=../pyobs-core/:../pyobs-sbig/:../pyobs-fli:../pyobs-weather:../pyobs-archive:${PYTHONPATH}
|
|
14
|
+
|
|
15
|
+
# Put it first so that "make" without argument is like "make help".
|
|
16
|
+
help:
|
|
17
|
+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
18
|
+
|
|
19
|
+
.PHONY: help Makefile
|
|
20
|
+
|
|
21
|
+
html:
|
|
22
|
+
@$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS)
|
|
23
|
+
|
|
24
|
+
livehtml:
|
|
25
|
+
sphinx-autobuild -b html --watch ../pyobs_zaber $(ALLSPHINXOPTS) "$(SOURCEDIR)/" "$(BUILDDIR)/html/"
|
|
26
|
+
|
|
27
|
+
# Catch-all target: route all unknown targets to Sphinx using the new
|
|
28
|
+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
|
29
|
+
%: Makefile
|
|
30
|
+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
31
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
@ECHO OFF
|
|
2
|
+
|
|
3
|
+
pushd %~dp0
|
|
4
|
+
|
|
5
|
+
REM Command file for Sphinx documentation
|
|
6
|
+
|
|
7
|
+
if "%SPHINXBUILD%" == "" (
|
|
8
|
+
set SPHINXBUILD=sphinx-build
|
|
9
|
+
)
|
|
10
|
+
set SOURCEDIR=source
|
|
11
|
+
set BUILDDIR=build
|
|
12
|
+
set SPHINXPROJ=pyobs
|
|
13
|
+
|
|
14
|
+
if "%1" == "" goto help
|
|
15
|
+
|
|
16
|
+
%SPHINXBUILD% >NUL 2>NUL
|
|
17
|
+
if errorlevel 9009 (
|
|
18
|
+
echo.
|
|
19
|
+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
|
|
20
|
+
echo.installed, then set the SPHINXBUILD environment variable to point
|
|
21
|
+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
|
|
22
|
+
echo.may add the Sphinx directory to PATH.
|
|
23
|
+
echo.
|
|
24
|
+
echo.If you don't have Sphinx installed, grab it from
|
|
25
|
+
echo.http://sphinx-doc.org/
|
|
26
|
+
exit /b 1
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
|
|
30
|
+
goto end
|
|
31
|
+
|
|
32
|
+
:help
|
|
33
|
+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
|
|
34
|
+
|
|
35
|
+
:end
|
|
36
|
+
popd
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
sphinx-rtd-theme
|
|
Binary file
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# Configuration file for the Sphinx documentation builder.
|
|
2
|
+
#
|
|
3
|
+
# This file does only contain a selection of the most common options. For a
|
|
4
|
+
# full list see the documentation:
|
|
5
|
+
# http://www.sphinx-doc.org/en/stable/config
|
|
6
|
+
|
|
7
|
+
# -- Path setup --------------------------------------------------------------
|
|
8
|
+
|
|
9
|
+
# If extensions (or modules to document with autodoc) are in another directory,
|
|
10
|
+
# add these directories to sys.path here. If the directory is relative to the
|
|
11
|
+
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
|
12
|
+
#
|
|
13
|
+
import os
|
|
14
|
+
import sys
|
|
15
|
+
|
|
16
|
+
sys.path.insert(0, os.path.abspath("../../"))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
# -- Project information -----------------------------------------------------
|
|
20
|
+
|
|
21
|
+
project = "pyobs-zaber"
|
|
22
|
+
copyright = "2024, Tim-Oliver Husser"
|
|
23
|
+
author = "Tim-Oliver Husser"
|
|
24
|
+
|
|
25
|
+
# The short X.Y version
|
|
26
|
+
# version = "0.16"
|
|
27
|
+
# The full version, including alpha/beta/rc tags
|
|
28
|
+
# release = "0.16.0"
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
# -- General configuration ---------------------------------------------------
|
|
32
|
+
|
|
33
|
+
add_module_names = False
|
|
34
|
+
|
|
35
|
+
# If your documentation needs a minimal Sphinx version, state it here.
|
|
36
|
+
#
|
|
37
|
+
# needs_sphinx = '1.0'
|
|
38
|
+
|
|
39
|
+
# Add any Sphinx extension module names here, as strings. They can be
|
|
40
|
+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
|
41
|
+
# ones.
|
|
42
|
+
extensions = [
|
|
43
|
+
"sphinx.ext.autodoc",
|
|
44
|
+
"sphinx.ext.githubpages",
|
|
45
|
+
"sphinx.ext.napoleon",
|
|
46
|
+
"sphinx.ext.viewcode",
|
|
47
|
+
"sphinx.ext.autosectionlabel",
|
|
48
|
+
"sphinx.ext.intersphinx",
|
|
49
|
+
#'sphinx_autodoc_typehints'
|
|
50
|
+
]
|
|
51
|
+
|
|
52
|
+
intersphinx_mapping = {"http://docs.python.org/3": None}
|
|
53
|
+
|
|
54
|
+
# napoleon settings
|
|
55
|
+
napoleon_google_docstring = True
|
|
56
|
+
napoleon_numpy_docstring = False
|
|
57
|
+
napoleon_use_param = False
|
|
58
|
+
napoleon_use_ivar = True
|
|
59
|
+
|
|
60
|
+
# typehints
|
|
61
|
+
# set_type_checking_flag = True
|
|
62
|
+
# autodoc_typehints = "description"
|
|
63
|
+
|
|
64
|
+
# show c'tor parameters in class only
|
|
65
|
+
autoclass_content = "both"
|
|
66
|
+
|
|
67
|
+
# Add any paths that contain templates here, relative to this directory.
|
|
68
|
+
templates_path = ["_templates"]
|
|
69
|
+
|
|
70
|
+
# The suffix(es) of source filenames.
|
|
71
|
+
# You can specify multiple suffix as a list of string:
|
|
72
|
+
#
|
|
73
|
+
source_suffix = ".rst"
|
|
74
|
+
|
|
75
|
+
# The master toctree document.
|
|
76
|
+
master_doc = "index"
|
|
77
|
+
|
|
78
|
+
# The language for content autogenerated by Sphinx. Refer to documentation
|
|
79
|
+
# for a list of supported languages.
|
|
80
|
+
#
|
|
81
|
+
# This is also used if you do content translation via gettext catalogs.
|
|
82
|
+
# Usually you set "language" from the command line for these cases.
|
|
83
|
+
language = "en"
|
|
84
|
+
|
|
85
|
+
# List of patterns, relative to source directory, that match files and
|
|
86
|
+
# directories to ignore when looking for source files.
|
|
87
|
+
# This pattern also affects html_static_path and html_extra_path .
|
|
88
|
+
exclude_patterns = []
|
|
89
|
+
|
|
90
|
+
# The name of the Pygments (syntax highlighting) style to use.
|
|
91
|
+
pygments_style = "sphinx"
|
|
92
|
+
|
|
93
|
+
# Be a little nitpicky
|
|
94
|
+
nitpicky = True
|
|
95
|
+
nitpick_ignore = []
|
|
96
|
+
|
|
97
|
+
# intersphinx
|
|
98
|
+
intersphinx_mapping = {
|
|
99
|
+
"pyobs": ("https://pyobs-core.readthedocs.io/en/latest/", None),
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
# -- Options for HTML output -------------------------------------------------
|
|
103
|
+
|
|
104
|
+
# The theme to use for HTML and HTML Help pages. See the documentation for
|
|
105
|
+
# a list of builtin themes.
|
|
106
|
+
html_theme = "sphinx_rtd_theme"
|
|
107
|
+
html_theme_options = {
|
|
108
|
+
"collapse_navigation": False,
|
|
109
|
+
"sticky_navigation": True,
|
|
110
|
+
"navigation_depth": 4,
|
|
111
|
+
"display_version": False,
|
|
112
|
+
"logo_only": False,
|
|
113
|
+
"prev_next_buttons_location": "bottom",
|
|
114
|
+
"titles_only": False,
|
|
115
|
+
"style_nav_header_background": "#cccccc",
|
|
116
|
+
}
|
|
117
|
+
html_logo = "_static/pyobs.gif"
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
pyobs-zaber
|
|
2
|
+
###########
|
|
3
|
+
|
|
4
|
+
This is a `pyobs <https://www.pyobs.org>`_ (`documentation <https://docs.pyobs.org>`_) module for selecting
|
|
5
|
+
between named positions (e.g. instrument ports) on a `Zaber <https://www.zaber.com/>`_ linear motor.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Example configuration
|
|
9
|
+
*********************
|
|
10
|
+
|
|
11
|
+
This is an example configuration::
|
|
12
|
+
|
|
13
|
+
class: pyobs_zaber.ZaberModeSelector
|
|
14
|
+
port: /dev/ttyUSB0
|
|
15
|
+
modes:
|
|
16
|
+
Photometry: 0
|
|
17
|
+
Spectroscopy: 50000
|
|
18
|
+
|
|
19
|
+
# communication
|
|
20
|
+
comm:
|
|
21
|
+
jid: test@example.com
|
|
22
|
+
password: ***
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
Available classes
|
|
26
|
+
*****************
|
|
27
|
+
|
|
28
|
+
There is one single class for Zaber motors.
|
|
29
|
+
|
|
30
|
+
ZaberModeSelector
|
|
31
|
+
=================
|
|
32
|
+
.. autoclass:: pyobs_zaber.ZaberModeSelector
|
|
33
|
+
:members:
|
|
34
|
+
:show-inheritance:
|
|
@@ -110,7 +110,7 @@ class ZaberDriver:
|
|
|
110
110
|
status: True -> LED on, False -> LED off
|
|
111
111
|
"""
|
|
112
112
|
async with zaber_device(self.port) as device:
|
|
113
|
-
device.settings.
|
|
113
|
+
await device.settings.set_async("system.led.enable", float(status))
|
|
114
114
|
|
|
115
115
|
async def stop(self):
|
|
116
116
|
"""Stop motion."""
|
|
@@ -46,12 +46,12 @@ class ZaberModeSelector(Module, IMode, IMotion):
|
|
|
46
46
|
await self.comm.set_state(IReady, ReadyState(ready=True))
|
|
47
47
|
await self.comm.set_state(IMotion, MotionState(status=MotionStatus.PARKED))
|
|
48
48
|
|
|
49
|
-
async def set_mode(self, mode: str, group:
|
|
49
|
+
async def set_mode(self, mode: str, group: str = "", **kwargs: Any) -> None:
|
|
50
50
|
"""Set the current mode.
|
|
51
51
|
|
|
52
52
|
Args:
|
|
53
53
|
mode: Name of mode to set.
|
|
54
|
-
group:
|
|
54
|
+
group: Name of the group to set the mode for (unused, single group only).
|
|
55
55
|
|
|
56
56
|
Raises:
|
|
57
57
|
ValueError: If an invalid mode was given.
|
pyobs_zaber-2.0.0.dev5/README.md
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|