Skip to content

chore: add Pixi, CI, pre-commit, contributor guides and PR template - #1

Closed
vboussot wants to merge 1 commit into
mainfrom
pr/tooling
Closed

chore: add Pixi, CI, pre-commit, contributor guides and PR template#1
vboussot wants to merge 1 commit into
mainfrom
pr/tooling

Conversation

@vboussot

Copy link
Copy Markdown
Member

Description

Developer environment, CI, and contributor tooling.

  • Pixi workspace + lockfile; Ruff / Mypy / Pytest / build config; optional-dependency extras (itk, hdf5, dicom, omezarr, imaging, monitoring, ...).
  • CI workflows (konfai_ci, pre-commit, commit-hygiene), pre-commit config, commit-message branding check.
  • Contributor guides (AGENTS.md, CLAUDE.md, copilot instructions), a development guide, installation docs, and a GitHub PR template.

Testing

pixi run check — green.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@vboussot

Copy link
Copy Markdown
Member Author

Superseded: the disjoint per-theme split couldn't pass CI (shared ruff/build config + cross-theme tests). Replaced by a stacked set: a core base PR (tooling+perf, verified green) with thin imaging/model/docs PRs stacked on it.

@vboussot vboussot closed this Jun 28, 2026
@vboussot
vboussot deleted the pr/tooling branch June 28, 2026 10:51
vboussot added a commit that referenced this pull request Jun 29, 2026
…oupling (#10)

* fix: resolve audit findings across data, models, metrics, and imaging

Address the open items from the whole-repository audit (AUDIT.md):
- augmentation: re-sample parameters each epoch via DataAugmentation.reset_state (#1)
- checkpoint: load_state_dict warm-starts resized layers and keeps siblings (#2)
- patching: Accumulator raises a typed PatchError instead of UnboundLocalError (#14)
- scheduler: update_scheduler raises ConfigError on an empty schedule (#15)
- metrics: declare ssim/fid/lpips extras and raise an actionable MeasureError (#16)
- models: rebuild LinearVAE on a real LatentDistribution bottleneck (#17),
  set Adaptation requires_grad in __init__ (#18), label debug blocks and make
  Write's output path explicit (#19)
- transform: reuse a persisted Crop box to skip the full-volume read (#10)
- dicom: non-destructive writes and multi-frame / irregular-spacing detection
- network/metrics: thread the GPU-index counter explicitly instead of os.environ
- apps: document number_of_mc_dropout as a reserved future feature (#11)

Add regression tests (patching, named_forward, audit fixes, DICOM hardening)
and expand AUDIT.md / AGENTS.md to cover the whole repository.

* feat: add validation_augmentations and zero-LR training stop

Re-apply two drafted improvements onto the modernized core:

- DataTrain gains a `validation_augmentations` flag (default true). When
  false, the train and validation datasets are prepared separately so
  augmented variants never leak into validation; the float split is now
  computed from per-case entry counts. `_get_validation_mapping()` is the
  single accessor that enforces this invariant.
- EarlyStopping: move `early_stop`/`is_stopped` to `EarlyStoppingBase`,
  add `stop()`, and end the run cleanly once the schedulers decay the
  optimizer learning rate to <= 0.

Also remove the now-dead `_split_train_validation` (replaced by
`_split_train_validation_names`) and migrate its tests. The drafted SSIM
index change was intentionally dropped: `MaskedLoss.forward` passes the
full [B, C, ...] tensor, so the existing `x[0][0]` indexing is correct.

Add unit tests for the disabled-validation-augmentation paths and for
EarlyStopping, and document the new key in the examples, the training
guide, and AGENTS.md.

* refactor: decouple konfai-apps runtime deps from the core

konfai-apps is an independent package: its runtime deps (fastapi, uvicorn,
python-multipart) belong in konfai-apps/pyproject.toml, not in the core. Remove
them from konfai's `[dev]` extra and the Pixi `dev` feature so `pip install konfai`
no longer drags in the apps server stack; `pip install konfai-apps` (or
`pip install -e ./konfai-apps`) pulls them itself.

Re-lock pixi (drops fastapi/uvicorn/python-multipart + orphaned transitives) and
document that the apps suite needs `pip install -e ./konfai-apps` first. The shared
lint/format/bandit tooling stays (one config for the monorepo). Core is unchanged
(it never imported these); the apps wheel stays self-contained (Requires-Dist:
konfai, fastapi, uvicorn, python-multipart) and its 31 tests pass.
vboussot added a commit that referenced this pull request Jun 29, 2026
- AGENTS.md (303 -> 93 lines): a shorter, more general guide. Keeps the
  load-bearing parts -- the three design pillars, the extension model
  (subclass + classpath), the do-not-break invariants, and the coding/commit/
  agent conventions -- and drops the verbose config-key catalogues, per-subsystem
  deep-dives, env-var/optional-dep tables, and the end-to-end run trace, which
  belong in docs/ and examples/.

- AUDIT.md (206 -> 64 lines): rewritten to the current state after PR #10. It
  records concisely what is fixed (modernization #6-#9 + audit follow-up #1, #2,
  #10, #14-#19, DICOM hardening, os.environ device fix) versus what remains -- the
  audit does NOT claim everything is resolved: ~9 confirmed bugs are still a
  clearly-listed backlog (#3 VAE noise, #4 EMA early-stop score, #5 explicit
  Standardize, #6 Rotate deg->rad, #7 CLI tensorboard, #8 Unsqueeze, #9
  ResampleToShape, #12 Select, #13 ITK) plus the deferred cross-cutting refactors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant