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
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Bug Report
description: Report a bug, metric discrepancy, or configuration issue in OpenLSR-X
labels: ["bug"]
body:
- type: textarea
id: summary
attributes:
label: Bug Summary
description: Clear description of what failed or produced unexpected scientific results.
validations:
required: true

- type: textarea
id: repro
attributes:
label: Steps / Command to Reproduce
description: Minimal CLI command, YAML snippet, or Python snippet.
placeholder: |
openlsrx fit -c configs/base/config.yaml
validations:
required: true

- type: input
id: env
attributes:
label: Environment (OS, Python, PyTorch, CUDA)
placeholder: "Ubuntu 24.04, Python 3.11, PyTorch 2.5 (CUDA 12.4)"
validations:
required: true

- type: textarea
id: logs
attributes:
label: Error Traceback / Logs
render: shell
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Feature / Dataset / Metric Request
description: Propose a new super-resolution architecture, XCT dataset loader, or petrophysical metric
labels: ["enhancement"]
body:
- type: textarea
id: motivation
attributes:
label: Scientific Motivation
description: What porous-media imaging problem, dataset format, or evaluation metric does this address?
validations:
required: true

- type: textarea
id: design
attributes:
label: Proposed Interface / Design
description: Suggested Python API, CLI flags, or YAML configuration fields, plus relevant literature references.
validations:
required: true
19 changes: 19 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Summary

<!-- Describe what this PR changes and why. -->

## Type of Change

- [ ] Bug fix (non-breaking change fixing an issue)
- [ ] New feature / scientific method (e.g., model block, loss, metric, data loader)
- [ ] Benchmark or configuration update
- [ ] Documentation / JOSS manuscript update
- [ ] CI/CD or packaging update

## Scientific & Engineering Checklist

- [ ] `uv run ruff check src tests scripts` and `uv run ruff format --check src tests scripts` pass
- [ ] `uv run mypy src tests scripts` passes with zero errors
- [ ] `uv run pytest --cov=openlsrx --cov-fail-under=85` passes (including YAML config schema checks)
- [ ] `uv run mkdocs build --strict` builds cleanly if docs or docstrings changed
- [ ] No 3D spatial train/val/test voxel leakage introduced in `openlsrx.data`
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
labels:
- "ci"
- "dependencies"

- package-ecosystem: "uv"
directory: "/"
schedule:
interval: "monthly"
labels:
- "dependencies"
126 changes: 126 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
name: CI

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
quality:
name: Lint, Typecheck & Docs
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true

- name: Set up Python 3.11
run: uv python install 3.11

- name: Install dependencies (CPU PyTorch)
run: |
uv venv --python 3.11
uv pip install --index-url https://download.pytorch.org/whl/cpu torch torchvision
uv pip install -e ".[dev,docs]"

- name: Ruff lint & format check
run: |
uv run --no-sync ruff check src tests scripts
uv run --no-sync ruff format --check src tests scripts

- name: Static type check (Mypy)
run: |
uv run --no-sync mypy src tests scripts

- name: Build documentation strictly
env:
NO_MKDOCS_2_WARNING: "1"
run: |
uv run --no-sync mkdocs build --strict

- name: Build wheel and sdist packages
run: |
uv build
ls -lh dist/

test:
name: Test Suite (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true

- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}

- name: Install dependencies (CPU PyTorch)
run: |
uv venv --python ${{ matrix.python-version }}
uv pip install --index-url https://download.pytorch.org/whl/cpu torch torchvision
uv pip install -e ".[dev]"

- name: Run unit, analytical, CLI & config tests with coverage gate
run: |
uv run --no-sync pytest --cov=openlsrx --cov-report=term-missing --cov-report=xml --cov-fail-under=85

- name: Upload coverage artifact (Python 3.11)
if: matrix.python-version == '3.11'
uses: actions/upload-artifact@v4
with:
name: coverage-xml
path: coverage.xml

benchmark-smoke:
name: End-to-End Benchmark & Paper Output Smoke
runs-on: ubuntu-latest
needs: [quality]
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true

- name: Set up Python 3.11 & dependencies
run: |
uv python install 3.11
uv venv --python 3.11
uv pip install --index-url https://download.pytorch.org/whl/cpu torch torchvision
uv pip install -e "."

- name: Run fast synthetic + rock benchmarks and generate LaTeX/figures
run: |
uv run --no-sync python scripts/benchmarks/porespy_study.py --fast --output-dir /tmp/bench/porespy
uv run --no-sync python scripts/benchmarks/public_rock_xct.py --fast --output-dir /tmp/bench/rock --data-dir /tmp/bench/data
uv run --no-sync python scripts/benchmarks/make_paper_outputs.py \
--porespy-csv /tmp/bench/porespy/porespy_study_results.csv \
--rock-csv /tmp/bench/rock/public_rock_results.csv \
--example-volumes /tmp/bench/porespy/example_volumes \
--out-dir /tmp/bench/paper_artifacts
test -f /tmp/bench/paper_artifacts/tables/porespy_benchmark.tex
test -f /tmp/bench/paper_artifacts/figures/orthogonal_sr_comparison.pdf
62 changes: 62 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Docs CD

on:
push:
branches: ["main"]
paths:
- "docs/**"
- "mkdocs.yml"
- "src/openlsrx/**"
- ".github/workflows/docs.yml"
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
name: Build MkDocs Site
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true

- name: Install docs environment
run: |
uv python install 3.11
uv venv --python 3.11
uv pip install --index-url https://download.pytorch.org/whl/cpu torch torchvision
uv pip install -e ".[docs]"

- name: Build static site
env:
NO_MKDOCS_2_WARNING: "1"
run: uv run --no-sync mkdocs build --strict

- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: site

deploy:
name: Deploy to GitHub Pages
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
91 changes: 91 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Release & JOSS Paper CD

on:
push:
tags:
- "v*.*.*"
pull_request:
paths:
- "paper/**"
- ".github/workflows/release.yml"
workflow_dispatch:

permissions:
contents: read

jobs:
joss-paper:
name: Compile JOSS Paper PDF (Inara)
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Build JOSS PDF via openjournals/inara
uses: openjournals/inara@main
with:
args: -o pdf paper/paper.md

- name: Upload compiled JOSS PDF
uses: actions/upload-artifact@v4
with:
name: joss-paper-pdf
path: paper/paper.pdf

build-dist:
name: Build & Smoke-Test Python Distributions
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Build wheel and sdist
run: |
uv build
sha256sum dist/* > dist/SHA256SUMS.txt

- name: Smoke-test built wheel in isolated environment
run: |
uv python install 3.11
uv venv /tmp/wheel-smoke --python 3.11
uv pip install --python /tmp/wheel-smoke/bin/python --index-url https://download.pytorch.org/whl/cpu torch torchvision
uv pip install --python /tmp/wheel-smoke/bin/python dist/*.whl
/tmp/wheel-smoke/bin/openlsrx --help

- name: Upload distribution artifacts
uses: actions/upload-artifact@v4
with:
name: python-dist
path: dist/*

github-release:
name: Publish GitHub Release
if: startsWith(github.ref, 'refs/tags/v')
needs: [joss-paper, build-dist]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download distribution artifacts
uses: actions/download-artifact@v4
with:
name: python-dist
path: dist

- name: Download JOSS PDF
uses: actions/download-artifact@v4
with:
name: joss-paper-pdf
path: dist

- name: Create GitHub Release with wheel, sdist, checksums, and JOSS PDF
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "${GITHUB_REF_NAME}" dist/* \
--repo "${GITHUB_REPOSITORY}" \
--generate-notes \
--title "OpenLSR-X ${GITHUB_REF_NAME}"
Loading
Loading