Skip to content

Commit 11a0bad

Browse files
Phil-Duacursoragent
andcommitted
Stabilize napari plugin setup and clarify curvelet parity testing.
Align installation/docs with current plugin requirements by adding segmentation extras to setup, removing stale plugin status notes, and documenting how to run curvelet and strict MATLAB parity checks. Make process-image execution headless-safe in offscreen runs and gate strict MATLAB-reference assertions behind an explicit opt-in flag so default plugin validation remains reliable. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 580fbe6 commit 11a0bad

File tree

10 files changed

+52
-300
lines changed

10 files changed

+52
-300
lines changed

README.md

Lines changed: 17 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,25 @@ See [doc/DEVELOPMENT.md](doc/DEVELOPMENT.md) for plugin setup and troubleshootin
4949
- macOS/Linux: `export QT_QPA_PLATFORM=offscreen`
5050
- Windows/PowerShell: `$env:QT_QPA_PLATFORM = 'offscreen'`
5151

52-
- Core tests (no curvelets):
52+
- Default test suite:
5353
```bash
5454
make test
5555
```
5656

57-
- Full tests with curvelets (after installing `curvelops`): `make test` — curvelet tests run automatically when curvelops is available; otherwise skipped.
57+
- Enable curvelet-dependent tests:
58+
```bash
59+
export TMEQ_RUN_CURVELETS=1
60+
QT_QPA_PLATFORM=offscreen uv run pytest -q tests/test_get_ct.py tests/test_new_curv.py tests/test_process_image.py -rs
61+
```
62+
63+
- Enable strict MATLAB-reference parity assertions:
64+
```bash
65+
export TMEQ_VALIDATE_MATLAB=1
66+
```
5867

5968
Notes:
6069
- The napari test is an import-only smoke test (no `Viewer` is created); it runs headless.
70+
- MATLAB parity tests are opt-in because they validate exact numerical agreement with historical MATLAB reference artifacts.
6171

6272
Testing policy:
6373
- Tests must not write files to the repository root. Use a system
@@ -66,47 +76,17 @@ Testing policy:
6676
`tests/test_resources/` and read from there during tests.
6777

6878
### Continuous integration
69-
- CI installs the package without `curvelops` to avoid building FFTW/CurveLab on runners.
70-
- CI environment:
71-
- Curvelet tests skipped (curvelops not installed on CI)
72-
- `QT_QPA_PLATFORM=offscreen` (headless napari import)
79+
- CI has two lanes in `.github/workflows/ci.yml`:
80+
- `test-basic`: default Python matrix without CurveLab secret requirements.
81+
- `test-curvelab`: secure lane that fetches/builds CurveLab + FFTW and runs curvelet-enabled tests.
82+
- Both lanes run with `QT_QPA_PLATFORM=offscreen`.
7383

7484
### Working with secrets in GitHub Actions
7585
This project uses GitHub Actions secrets for tasks that require authentication or access to private resources. Secrets can be configured in the [Settings tab of the repostiory](https://github.com/uw-loci/tme-quant/settings/secrets/actions). For more information about secrets, see:
7686
- [Secrets as a concept](https://docs.github.com/en/actions/concepts/security/secrets)
7787
- [Secrets in actions](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions).
7888

79-
#### Manual testing workflow
80-
The `manual-test` workflow allows developers to manually trigger workflows from the GitHub UI without committing changes to `main`. This is useful for testing workflows that require secrets on topic branches.
81-
82-
**How to use it:**
83-
84-
1. Create or edit `.github/workflows/test-action.yml` to define your workflow's structure and declare which secrets it needs via the `secrets:` input in `workflow_call`:
85-
```yaml
86-
on:
87-
workflow_call:
88-
secrets:
89-
MY_SECRET_NAME:
90-
ANOTHER_SECRET:
91-
92-
jobs:
93-
my-job:
94-
runs-on: ubuntu-latest
95-
steps:
96-
- name: Use a secret
97-
run: echo "Secret is ${{ secrets.MY_SECRET_NAME }}"
98-
```
99-
100-
2. The `manual-test` workflow (`.github/workflows/manual-test.yml`) will call `test-action.yml` and pass repository secrets to it via `secrets: inherit`.
101-
102-
3. To trigger the workflow:
103-
- Push your branch with the updated `test-action.yml` to GitHub.
104-
- Go to the **Actions** tab in the repository and select the **[Manual Testing Stub](https://github.com/uwloci/tme-quant/actions/workflows/manual-test.yml)** workflow.
105-
- Click **Run workflow** and select your branch.
106-
- The workflow will execute with access to all secrets configured for the repository.
107-
108-
**NOTE**
109-
- Never hardcode secrets or access tokens in workflow files; always use the `secrets:` context.
89+
Never hardcode secrets or access tokens in workflow files; always use the `secrets:` context.
11090

11191
### Troubleshooting
11292
- Qt error ("No Qt bindings could be found"): ensure `uv sync` completed; pyproject includes PyQt6.

bin/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ create_env_and_install() {
180180
export LDFLAGS="-L${FFTW}/lib"
181181

182182
print_info "Syncing uv environment..."
183-
uv sync --extra curvelops &&
183+
uv sync --extra curvelops --extra segmentation &&
184184
print_success "Environment configured."
185185

186186
print_info "Installing tme-quant..."

doc/DEVELOPMENT.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ The plugin is registered via:
1010

1111
After `uv pip install -e .`, run `uv run napari` and open **Plugins → napari-curvealign**.
1212

13+
If you only need plugin segmentation features (Cellpose/StarDist) without curvelets:
14+
15+
```bash
16+
uv sync --extra segmentation
17+
```
18+
1319
## Running tests
1420

1521
```bash

doc/INSTALL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
bash bin/install.sh
2424
```
2525

26-
The script checks for uv, downloads FFTW, detects CurveLab in `../utils`, builds both, syncs the env, and verifies.
26+
The script checks for uv, downloads FFTW, detects CurveLab in `../utils`, builds both, syncs the env with `curvelops` and segmentation extras, and verifies.
2727

2828
## Run
2929

@@ -48,8 +48,8 @@ parent/
4848
To run napari without the curvelet backend (no FFTW/CurveLab required):
4949

5050
```bash
51-
uv sync
51+
uv sync --extra segmentation
5252
uv run napari
5353
```
5454

55-
**Note:** The napari plugin will load, but curvelet-based analysis (e.g. fiber orientation) will not run. You get the UI with mock/placeholder results. For real curvelet analysis, use the full install above.
55+
**Note:** The napari plugin will load, but curvelet-based analysis (e.g. fiber orientation) will not run. For real curvelet analysis, use the full install above.

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ dev = [
3434
curvelops = [
3535
"curvelops @ git+https://github.com/PyLops/curvelops@0.23.4",
3636
]
37+
segmentation = [
38+
"cellcast",
39+
"cellpose",
40+
]
3741

3842
[project.entry-points."napari.manifest"]
3943
napari-curvealign = "napari_curvealign:napari.yaml"

src/napari_curvealign/INSTALLATION_AND_TEST_SUCCESS.md

Lines changed: 0 additions & 255 deletions
This file was deleted.

0 commit comments

Comments
 (0)