Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,16 @@ jobs:
pip install flake8 pytest Pyqt6 pytest-qt
sudo apt-get update
sudo apt-get install -y libegl1 xvfb
if [ -f slitmaskgui/requirements.txt ]; then pip install -r slitmaskgui/requirements.txt; fi
if [ -f gui/slitmaskgui/requirements.txt ]; then pip install -r gui/slitmaskgui/requirements.txt; fi

- name: Lint with flake8
run: |
source .venv/bin/activate
flake8 slitmaskgui/ --count --select=E9,F63,F7,F82 --show-source --statistics --exclude=.venv
flake8 slitmaskgui/ --count --exit-zero --max-complexity=10 --statistics #--max-line-length=120 --exclude=.venv
flake8 gui/slitmaskgui/ --count --select=E9,F63,F7,F82 --show-source --statistics --exclude=.venv
flake8 gui/slitmaskgui/ --count --exit-zero --max-complexity=10 --statistics

- name: Test
run: |
source .venv/bin/activate
export QT_QPA_PLATFORM=offscreen
xvfb-run -a python3 -m pytest slitmaskgui/tests/
#test:
xvfb-run -a python3 -m pytest tests/
16 changes: 8 additions & 8 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[submodule "src/lris2/util/lris2-csu"]
path = src/lris2/util/lris2-csu
url = git@github.com:CaltechOpticalObservatories/lris2-csu.git
[submodule "src/lris2/util/coo-ethercat"]
path = src/lris2/util/coo-ethercat
url = git@github.com:CaltechOpticalObservatories/coo-ethercat.git
[submodule "src/lris2/util/sunpower"]
path = src/lris2/util/sunpower
[submodule "src/driver/sunpower"]
path = src/driver/sunpower
url = git@github.com:COO-Utilities/sunpower.git
[submodule "src/driver/coo_ethercat"]
path = src/driver/coo_ethercat
url = git@github.com:CaltechOpticalObservatories/coo-ethercat.git
[submodule "src/driver/lris2_csu"]
path = src/driver/lris2_csu
url = git@github.com:CaltechOpticalObservatories/lris2-csu.git
74 changes: 73 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,73 @@
# lris2
# lris2

LRIS2 Instrument Control Software

## Structure

- `daemons/` – mKTL service daemons
- `gui/` – Graphical interfaces (`slitmaskgui`, `demo`)
- `scripts/` – AIT and utility scripts
- `src/driver/` – Hardware driver submodules
- `tests/` – Unit tests

## Quick start

```bash
# 1) Clone
git clone <repo-url>
cd lris2

# 2) Make sure submodule URLs are in sync
git submodule sync --recursive
git submodule update --init --recursive

# 3) Install the package for development
pip install -U pip
pip install -e ".[dev]"
```

## Submodules

This repo uses submodules under `src/driver/`:

| Submodule | Path | Import |
|-----------|------|--------|
| coo-ethercat | `src/driver/coo_ethercat` | `lris2.driver.coo_ethercat` |
| lris2-csu | `src/driver/lris2_csu` | `lris2.driver.lris2_csu` |
| sunpower | `src/driver/sunpower` | `lris2.driver.sunpower` |

### Pull the submodules

```bash
git submodule sync --recursive
git submodule update --init --recursive
```

### Update to the latest on a tracked branch (e.g., main)

> Only do this if you intend to move submodule pointers and commit them.

```bash
# One-off refresh to submodules' tracked branches
git submodule update --remote --merge --recursive

# Record updated pointers in parent repo
git add .gitmodules .
git commit -m "Update submodules to latest on main"
```

## Testing

Tests mirror the `src/` layout under `tests/`.

To run tests from the project root:

```bash
pytest
```

## Contributing

1. Create a feature branch.
2. Include tests for new behavior.
3. Run `pytest` before opening a PR.
File renamed without changes.
29 changes: 29 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[build-system]
requires = ["setuptools>=42"]
build-backend = "setuptools.build_meta"

[project]
name = "lris2"
version = "0.1.0"
description = "LRIS2 Instrument Control Software"
requires-python = ">=3.12"
authors = [
{name = "Michael Langmayr", email = "langmayr@caltech.edu"}
]
license = {text = "MIT"}
readme = "README.md"

[project.optional-dependencies]
dev = [
"pytest",
]

[tool.setuptools.package-dir]
lris2 = "src"

[tool.setuptools]
packages = ["lris2", "lris2.driver"]

[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["gui"]
1 change: 1 addition & 0 deletions src/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""LRIS2 Instrument Control Software."""
1 change: 1 addition & 0 deletions src/driver/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""LRIS2 hardware driver submodules."""
Loading