Skip to content
Open
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
8 changes: 4 additions & 4 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
fetch-depth: 0

- uses: hynek/build-and-inspect-python-package@v2
- uses: hynek/build-and-inspect-python-package@v2.15.0

publish:
needs: [dist]
Expand All @@ -41,12 +41,12 @@ jobs:
if: github.event_name == 'release' && github.event.action == 'published'

steps:
- uses: actions/download-artifact@v4
- uses: actions/download-artifact@v8
with:
name: Packages
path: dist

- uses: pypa/gh-action-pypi-publish@release/v1
- uses: pypa/gh-action-pypi-publish@v1.13.0
if: github.event_name == 'release' && github.event.action == 'published'
with:
# Remember to tell (test-)pypi about this repo before publishing
Expand Down
16 changes: 6 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-python@v5
- uses: actions/setup-python@v6
with:
python-version: "3.x"
- uses: pre-commit/action@v3.0.1
Expand All @@ -42,19 +42,15 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.12"]
python-version: ["3.10", "3.12"]
runs-on: [ubuntu-latest, macos-latest, windows-latest]

include:
- python-version: pypy-3.10
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
fetch-depth: 0

- uses: actions/setup-python@v5
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
Expand All @@ -68,6 +64,6 @@ jobs:
--durations=20

- name: Upload coverage report
uses: codecov/codecov-action@v5.1.2
uses: codecov/codecov-action@v6
with:
token: ${{ secrets.CODECOV_TOKEN }}
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@ repos:
entry: PyBind|Numpy|Cmake|CCache|Github|PyTest
exclude: .pre-commit-config.yaml

- id: pylint
name: pylint
entry: pylint
language: python
types: [python]
files: ^src/
require_serial: true
additional_dependencies: ["pylint", "numpy", "SimpleITK"]

- repo: https://github.com/abravalheri/validate-pyproject
rev: "v0.16"
hooks:
Expand Down
52 changes: 52 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# CLAUDE.md

## Project

pydcmqi — Python API wrapper for dcmqi (DICOM quantitative imaging) CLI tools.

## Development

- Python 3.10+
- Uses `hatchling` + `hatch-vcs` for build/versioning
- Install for development: `.venv/bin/pip install -e ".[test]"`
- Pre-commit hooks configured (ruff, mypy, pylint, prettier, codespell, etc.)

## Before committing

Always run pre-commit hooks before committing:

```bash
.venv/bin/pre-commit run --all-files
```

Fix any failures before creating the commit. Do not skip hooks with
`--no-verify`.

## Testing

```bash
.venv/bin/pytest tests/
```

Integration tests (TestSegimageRead, TestSegimageWrite) require network access
to download DICOM data from IDC.

## Linting

```bash
.venv/bin/pre-commit run --all-files # all hooks including mypy and pylint
.venv/bin/ruff check src/ tests/ # ruff only
.venv/bin/mypy src/ tests/ # mypy only
```

## Project structure

```
src/pydcmqi/
├── __init__.py # Public API exports
├── types.py # TypedDicts, Literal types
├── exceptions.py # DcmqiError
├── triplet.py # Triplet class (DICOM code triplet)
├── segment.py # SegmentData, Segment
├── segimage.py # SegImageData, SegImageFiles, SegImage (orchestrator)
```
Loading
Loading