Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Although the refactor itself is correct and complete, it builds on and includes the unmerged #39 and targets the refactor/alignment branch, so it should not be merged until its prerequisite lands.
No open issues 🎉
What changed in this PR
This PR renames the top-level packages to the target layout from the author's refactor notes on #30: accessors/ → accessor/ (holding only the xr.Dataset.mx accessor), align/ → alignment/, and nests interpolations/ under alignment/interpolations/ since it is only used by space alignment. It is a pure move/rename with no behavioral change, building on #39, and keeps the public API in mxalign/__init__.py stable.
Changes:
- Renamed/relocated the three packages and updated all relative imports to the new dot-levels (e.g.
interpolations/base.pynow uses...utils.traits,accessor/mx.pyimports..alignment). alignment/__init__.pyimportsinterpolationsso interpolators still register onimport mxalign;mxalign/__init__.pyre-exports the same public functions and updates__all__toaccessor/alignment.- Updated tests to the new import paths and the
mxalign.alignment.timelogger name.
| File | Description |
|---|---|
src/mxalign/__init__.py |
Updates imports/__all__ to new accessor/alignment paths; public API unchanged |
src/mxalign/accessor/__init__.py |
New package init that imports mx to register the accessor |
src/mxalign/accessor/mx.py |
Imports time/space from ..alignment instead of local package |
src/mxalign/alignment/__init__.py |
Adds interpolations to package imports and __all__ |
src/mxalign/alignment/time.py |
Hosts global + pairwise time ops; adds numpy/pandas imports, drops old accessors import |
src/mxalign/alignment/space.py |
Hosts align_space + pairwise grid ops; lazy-imports .interpolations.registry |
src/mxalign/alignment/nans.py |
Relocated broadcast_nans |
src/mxalign/alignment/interpolations/* |
Relocated interpolation modules/registry; base.py import fixed to ...utils.traits |
src/mxalign/runner.py |
Imports align_time/broadcast_nans from .alignment |
src/mxalign/accessors/*, src/mxalign/align/space.py |
Old modules removed |
tests/test_interpolations.py, tests/test_align_time_global.py |
Updated import paths and logger name |
Verification performed: old accessors/, align/, interpolations/ directories are fully removed; no code references the old module paths (the only matches are saved stack-trace text in examples/introduction.ipynb output cells, which are not executable and not part of this diff); every _time.*/_space.* function used by accessor/mx.py exists in the new modules; relative-import dot-levels are correct; and the __init__.py import ordering avoids circular imports (accessor is imported after alignment, and alignment modules don't import the accessor at module load). I found no issues to raise.
Review effort: Balanced
…r alignment Top-level layout becomes `accessor` (the ds.mx accessor) and `alignment` (time/space/nans alignment plus the interpolators it uses); the pipeline package follows separately. Public re-exports from mxalign/__init__.py are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
9f7f2df to
05baa49
Compare
Addresses bullet 4 of my notes on #30: "high-level modules will be
accessor,alignmentandpipeline".Changes
accessors/→accessor/(onlymx.py, thexr.Dataset.mxaccessor)align/→alignment/(time,space,nans)interpolations/→alignment/interpolations/, since it's only used by space alignment.alignment/__init__.pyimports it so the interpolators still register onimport mxalign.mx.py,interpolations/base.py,alignment/space.py,runner.py) and tests updated to the new paths, including themxalign.alignment.timelogger name.mxalign/__init__.pyre-exports the same public functions (interpolate,align_time,align_space, registries).__all__now listsaccessor/alignmentinstead ofaccessors/interpolations.pipeline(cli/runner/verification/transformations) follows in the next PR.All 93 tests pass.
🤖 Generated with Claude Code