A library and actor to communicate with an STA Archon controller.
Project description
archon
A library and actor to communicate with an STA Archon controller.
Installation
In general you should be able to install archon
by doing
pip install sdss-archon
To build from source, use
git clone git@github.com:sdss/archon
cd archon
pip install .
Docker
The actor can run as a Docker container; new images for main
(pointing to tag latest
) and tags are created via a GitHub Action. The images are stored in the GitHub Container Registry. To pull the latest image run
docker pull ghcr.io/sdss/archon:latest
To run a container
docker run --name archon --rm --detach --network host ghcr.io/sdss/archon:latest
This assumes that RabbitMQ is running on the default port in the host computer and that the Archon controllers are accessible over the host network.
Development
archon
uses poetry for dependency management and packaging. To work with an editable install it's recommended that you setup poetry
and install archon
in a virtual environment by doing
poetry install
Pip does not support editable installs with PEP-517 yet. That means that running pip install -e .
will fail because poetry
doesn't use a setup.py
file. As a workaround, you can use the create_setup.py
file to generate a temporary setup.py
file. To install archon
in editable mode without poetry
, do
pip install --pre poetry
python create_setup.py
pip install -e .
Note that this will only install the production dependencies, not the development ones. You'll need to install those manually (see pyproject.toml
[tool.poetry.dev-dependencies]
). You will also need to return create_setup.py
anytime the dependencies or metadata parameters in pyproject.toml
change.
Style and type checking
This project uses the black code style with 88-character line lengths for code and docstrings. It is recommended that you run black
on save. Imports must be sorted using isort. The GitHub test workflow checks all the Python file to make sure they comply with the black formatting.
Configuration files for flake8, isort, and black are provided and will be applied by most editors.
For Visual Studio Code, the following project file is compatible with the project configuration:
{
"python.formatting.provider": "black",
"[python]" : {
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
"editor.formatOnSave": true
},
"[markdown]": {
"editor.wordWrapColumn": 88
},
"[restructuredtext]": {
"editor.wordWrapColumn": 88
},
"editor.rulers": [88],
"editor.wordWrapColumn": 88,
"python.analysis.typeCheckingMode": "basic"
}
This assumes that the Python and Pylance extensions are installed.
This project uses type hints. Typing is enforced by the test workflow using pyright (in practice this means that if Pylance
doesn't produce any errors in basic mode, pyright
shouldn't).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for sdss_archon-0.6.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e147e81378452c78ad235187a25a12aa70b66dfb0c07a818085ce7535ebdf14f |
|
MD5 | d340535a1f417dc47df587722ea9c872 |
|
BLAKE2b-256 | 2417575e82ff0a80574a5d0b6af62400150fb2227d7735dcb1d1d23049b7bc1c |