Skip to content

Commit

Permalink
Support archon 0.13.x (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox authored Dec 2, 2023
1 parent 8dcd1d6 commit 28d0ee7
Show file tree
Hide file tree
Showing 9 changed files with 88 additions and 131 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## Next version

### ✨ Improved

* [#24](https://github.com/sdss/lvmscp/pull/24) Support `archon` 0.13.x.


## 0.7.1 - November 30, 2023

### 🔧 Fixed
Expand Down
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ ENV IS_CONTAINER=yes
RUN apt-get update && apt-get install -y build-essential libbz2-dev zlib1g-dev

RUN pip3 install -U pip setuptools wheel
RUN cd lvmscp && pip3 install .
RUN pip3 install fitsio
RUN cd lvmscp && pip3 install .[fitsio]
RUN rm -Rf lvmscp

ENTRYPOINT lvmscp actor start --debug
28 changes: 1 addition & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# lvmscp

![Versions](https://img.shields.io/badge/python->3.8-blue)
![Versions](https://img.shields.io/badge/python->3.9-blue)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Documentation Status](https://readthedocs.org/projects/lvmscp/badge/?version=latest)](https://lvmscp.readthedocs.io/en/latest/?badge=latest)
[![Test](https://github.com/sdss/lvmscp/actions/workflows/test.yml/badge.svg)](https://github.com/sdss/lvmscp/actions/workflows/test.yml)
Expand Down Expand Up @@ -33,29 +33,3 @@ The preferred installation for development is using [poetry](https://python-poet
cd lvmscp
poetry install
```


### Basic ping-pong test

Start the `lvmscp` actor.

```console
lvmscp start
```

In another terminal, type `clu` and `lvmscp ping` for test.

```console
$ clu
lvmscp ping
07:41:22.636 lvmscp >
07:41:22.645 lvmscp : {
"text": "Pong."
}
```

Stop `lvmscp` actor.

```console
lvmscp stop
```
82 changes: 42 additions & 40 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 10 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "sdss-lvmscp"
version = "0.7.2a0"
version = "0.8.0a0"
description = "LVM spectrograph control package."
authors = ["José Sánchez-Gallego <[email protected]>", "Changgon Kim <[email protected]>"]
maintainers = ["José Sánchez-Gallego <[email protected]>"]
Expand All @@ -17,6 +17,7 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Documentation :: Sphinx",
"Topic :: Software Development :: Libraries :: Python Modules"
]
Expand All @@ -32,8 +33,12 @@ ln2fill = "lvmscp.ln2:ln2fill"
[tool.poetry.dependencies]
python = "^3.9,<3.13"
click-default-group = "^1.2.2"
sdss-archon = "^0.12.0"
sdss-archon = "^0.13.0"
sdss-clu = "^2.1.3"
fitsio = {version = "^1.2.1", optional = true}

[tool.poetry.extras]
fitsio = ["fitsio"]

[tool.poetry.dev-dependencies]
ipython = [
Expand Down Expand Up @@ -74,13 +79,14 @@ sphinx-click = ">=3.0.1"

[tool.black]
line-length = 88
target-version = ['py311']
target-version = ['py312']
fast = true

[tool.ruff]
line-length = 88
target-version = 'py311'
target-version = 'py312'
select = ["E", "F", "I"]
exclude = ["**/*.pyi"]

[tool.ruff.per-file-ignores]
"__init__.py" = ["F403", "F401", "E402"]
Expand Down
27 changes: 3 additions & 24 deletions python/lvmscp/actor/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,9 @@
# @Filename: __init__.py
# @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause)

import glob
import importlib
import os
from __future__ import annotations

from archon.actor.commands import parser


# Autoimport all modules in this directory so that they are added to the parser.

exclusions = ["__init__.py"]

cwd = os.getcwd()
os.chdir(os.path.dirname(os.path.realpath(__file__)))

files = [
file_ for file_ in glob.glob("**/*.py", recursive=True) if file_ not in exclusions
]

for file_ in files:
if file_.startswith("deprecated"):
continue
modname = file_[0:-3].replace("/", ".")
mod = importlib.import_module(
"lvmscp.actor.commands." + modname
) # changged by CK 2021/03/30

os.chdir(cwd)
from .focus import focus
from .hardware_status import hardware_status
Loading

0 comments on commit 28d0ee7

Please sign in to comment.