Skip to content

refactor: move cli/runner/verification into pipeline/ - #41

Merged
mpvginde merged 2 commits into
mlwp-tools:refactor/alignmentfrom
leifdenby:refactor/pipeline-subpackage
Oct 27, 2026
Merged

mpvginde merged 2 commits into
mlwp-tools:refactor/alignmentfrom
leifdenby:refactor/pipeline-subpackage

Conversation

@leifdenby

@leifdenby leifdenby commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Addresses bullet 5 of my notes on #30: "current cli, runner and verification to the .pipeline submodule".

Changes

  • cli.py, runner.py and verification.py move to pipeline/.
  • transformations/ moves to pipeline/transformations/, because only the runner uses it.
  • utils/config.py, utils/dates.py and utils/save.py move to pipeline/config.py, pipeline/dates.py and pipeline/save.py. These are pipeline-only helpers. utils/ keeps projections and traits, which accessor and alignment use.
  • Console script: mxalign = "mxalign.pipeline.cli:main".
  • mxalign/__init__.py still re-exports transform, available_transformations and register_transformation. __all__ now lists accessor / alignment / pipeline.
  • README.md and examples/advanced.ipynb updated to from mxalign.pipeline.runner import Runner; tests updated to the new paths.

Top level is now accessor, alignment and pipeline, plus utils. The orphaned loaders/ifs_forecast.py, which imports modules that no longer exist, is left alone here.

All 93 tests pass, and mxalign --help works.

🤖 Generated with Claude Code

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

It is a package-wide public API/import reorganization stacked on two still-unmerged PRs against a feature branch, which warrants final human confirmation even though the mechanical moves verify as consistent.

No open issues 🎉

What changed in this PR

This PR reorganizes the mxalign package so that the configuration-driven verification pipeline lives under a single pipeline/ submodule. It is the final step in a stacked refactor series (#39, #40) that reshapes the top level into accessor, alignment, and pipeline (plus the shared utils). The cli, runner, verification, and transformations modules—together with the pipeline-only helpers config, dates, and save—move into pipeline/, while utils/ retains only projections and traits used by accessor and alignment.

Changes:

  • Move cli.py, runner.py, verification.py, transformations/, and utils/{config,dates,save}.py into pipeline/, updating relative imports (e.g. runner now imports ..alignment.time/..alignment.nans and .config/.save/.verification).
  • Update the public surface: mxalign/__init__.py re-exports the same functions and lists accessor/alignment/pipeline in __all__; console script becomes mxalign.pipeline.cli:main.
  • Update tests, README.md, and examples/advanced.ipynb to the new import paths.
File Description
src/​mxalign/​__init__.py Re-exports public API from new paths; __all__ → accessor/alignment/pipeline
src/​mxalign/​pipeline/​__init__.py New package init importing transformations so they register on import
src/​mxalign/​pipeline/​cli.py Moved CLI; lazily imports .runner
src/​mxalign/​pipeline/​runner.py Moved runner; imports updated to .config/.save/.verification and ..alignment.*
src/​mxalign/​pipeline/​verification.py Moved Metric/verify; imports .transformations.external
src/​mxalign/​pipeline/​config.py Moved config loader; imports .dates
src/​mxalign/​pipeline/​dates.py Moved date-range helper
src/​mxalign/​pipeline/​save.py Moved dataset/metrics save helpers
src/​mxalign/​pipeline/​transformations/​*.py Moved transformation registry/base/external/transform modules
src/​mxalign/​alignment/​*.py, alignment/​interpolations/​*.py Alignment/interpolation modules (from stacked #39/#40) with corrected relative imports
src/​mxalign/​accessor/​*.py Accessor package importing ..alignment ops (from stacked #40)
src/​mxalign/​accessors/​*.py, align/​space.py Old modules removed as part of the move
pyproject.toml Console script → mxalign.pipeline.cli:main
README.md, examples/​advanced.ipynb Updated Runner import to mxalign.pipeline.runner
tests/​test_*.py Updated imports and logger name to new module paths

Review effort: Balanced

@leifdenby
leifdenby force-pushed the refactor/pipeline-subpackage branch from e3e1602 to d26eae1 Compare October 27, 2026 14:04
@mpvginde

Copy link
Copy Markdown
Contributor

@leifdenby this also needs a rebase I guess

leifdenby and others added 2 commits October 27, 2026 15:33
The YAML-driven pipeline (cli, runner, verification, transformations
and the config/dates/save helpers it alone uses) now lives in
mxalign.pipeline. The console script points at mxalign.pipeline.cli:main.
Public re-exports from mxalign/__init__.py are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@leifdenby
leifdenby force-pushed the refactor/pipeline-subpackage branch from d26eae1 to 6d5aca5 Compare October 27, 2026 14:33
@mpvginde
mpvginde merged commit 08e4724 into mlwp-tools:refactor/alignment Oct 27, 2026
2 checks passed
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.

3 participants