Skip to content

refactor: - #54

Draft
Hendrik-code wants to merge 1 commit into
mainfrom
hm/unified-transform-system
Draft

refactor: #54
Hendrik-code wants to merge 1 commit into
mainfrom
hm/unified-transform-system

Conversation

@Hendrik-code

Copy link
Copy Markdown
Collaborator

drive every augmentation from a registry instead of if ladders

Which augmentations exist, what they accept, and where they sit in the pipeline were encoded four times over: one dispatch ladder in gpu/transforms.py, two in gpu/transforms_list.py, and one in cpu/transforms.py, totaling ~900 lines across them. They had already drifted -- the list pipelines passed a crop= argument no transform accepts, and ordered SimulateLowRes differently from the sequential one.

Each augmentation class now registers itself. The registry (smauglab/registry.py) is the single source of truth for the class a config key maps to, the parameters it accepts (read from the constructor signature, so there is no second schema to drift), its pipeline order, and its GEO/GE/TA group. smauglab/transforms/build.py dispatches once for all three pipeline modes.

Config handling moves to smauglab/config.py: a sectioned GPU/CPU/pipeline schema, validation that reports all problems in a single file rather than one per run, and "did you mean" suggestions. A flat, section-less config is now rejected -- the two namespaces overlapped enough that GaussianBlurTransform meant different transforms depending on which builder read it.

The three nnU-Net trainers collapse into one. Which sections a config populates decides whether augmentation runs on the dataloader, on the batch, or both, so the CPU/GPU/Hybrid split no longer needs a class each. The class keeps the name nnUNetTrainerDAExtGPU: nnU-Net writes it to every checkpoint and resolves the class from it at inference, so renaming it would leave trained models stranded.

A smauglab CLI answers what exists and whether a config is valid by reading the registry, so it cannot go out of date, and generates the README coverage matrix and the all-augmentations template config that CI checks for staleness.

The .gitignore ignores *.json repo-wide to keep per-experiment configs out (see 7ff2088). That silently swallowed three things this change adds and needs tracked -- the generated template, the test fixtures, and the migrator the config error messages point at -- so each gets an explicit un-ignore.

… ladders

Which augmentations exist, what they accept, and where they sit in the pipeline
were encoded four times over: one dispatch ladder in gpu/transforms.py, two in
gpu/transforms_list.py, one in cpu/transforms.py, ~900 lines between them. They
had already drifted -- the list pipelines passed a `crop=` argument no transform
accepts, and ordered SimulateLowRes differently from the sequential one.

Each augmentation class now registers itself. The registry (smauglab/registry.py)
is the single source of truth for the class a config key maps to, the parameters
it accepts (read from the constructor signature, so there is no second schema to
drift), its pipeline order, and its GEO/GE/TA group. smauglab/transforms/build.py
does the dispatch once for all three pipeline modes.

Config handling moves to smauglab/config.py: a sectioned GPU/CPU/pipeline schema,
validation that reports every problem in a file at once rather than one per run,
and "did you mean" suggestions. A flat, section-less config is now rejected --
the two namespaces overlapped enough that `GaussianBlurTransform` meant different
transforms depending on which builder read it.

The three nnU-Net trainers collapse into one. Which sections a config populates
decides whether augmentation runs on the dataloader, on the batch, or both, so
the CPU/GPU/Hybrid split no longer needs a class each. The class keeps the name
nnUNetTrainerDAExtGPU: nnU-Net writes it into every checkpoint and resolves the
class from it at inference, so renaming it would strand trained models.

A `smauglab` CLI answers what exists and whether a config is valid by reading the
registry, so it cannot go out of date, and generates the README coverage matrix
and the all-augmentations template config that CI checks for staleness.

The .gitignore ignores *.json repo-wide to keep per-experiment configs out (see
7ff2088). That silently swallowed three things this change adds and needs
tracked -- the generated template, the test fixtures, and the migrator the config
error messages point at -- so each gets an explicit un-ignore.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Hendrik-code Hendrik-code self-assigned this Aug 19, 2026
@Hendrik-code Hendrik-code added the enhancement New feature or request label Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant