Repository navigation
Conversation
accessors/time.py and accessors/space.py held alignment operations rather than accessor code. Move them into align/time.py and align/space.py next to the multi-dataset align_time/align_space, and have the mx accessor import them from there. No behaviour change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 27, 2026
There was a problem hiding this comment.
🟢 Approval recommended
It is a pure code move with imports and all call sites correctly repointed, no remaining references to the old paths, and no circular imports introduced.
No open issues 🎉
What changed in this PR
This PR is a mechanical refactor that relocates pairwise alignment operations out of the accessors/ package and into the align/ package, so that accessors/ holds only the mx accessor itself. It is the first in a stack against refactor/alignment (#30) that will later rename packages and add a config schema. The move also removes the prior circular dependency where align/time.py imported from accessors/time.py.
Changes:
- Moved pairwise time ops (
align_forecast_to_observation,align_observation_to_forecast,align_observation_to_observation,align_forecast_to_forecast,_add_valid_time,_parse_lead_times) intoalign/time.py. - Moved pairwise space ops (
align_grid_grid,align_grid_point,COORD_TOLERANCE) intoalign/space.py. - Updated
accessors/mx.pyto import_time/_spacefrom..align, and emptiedaccessors/time.py/accessors/space.py.
| File | Description |
|---|---|
| src/mxalign/align/time.py | Adds the pairwise time-alignment functions and the numpy/pandas/mlwp_data_specs imports they need; drops the old accessors import. |
| src/mxalign/align/space.py | Adds COORD_TOLERANCE and the grid/point pairwise space-alignment functions. |
| src/mxalign/accessors/time.py | Removes all relocated time-alignment code. |
| src/mxalign/accessors/space.py | Removes all relocated space-alignment code. |
| src/mxalign/accessors/mx.py | Repoints _time/_space imports from . to ..align. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses bullet 3 of my notes on #30: "put accessor operation modules into submodules".
This is the first PR in a stack against
refactor/alignment(#30). The next PRs rename the packages toaccessor/alignment/pipelineand add an explicit config schema.Changes
align_forecast_to_observation,align_observation_to_forecast,align_observation_to_observation,align_forecast_to_forecast,_add_valid_time,_parse_lead_times) fromaccessors/time.pyintoalign/time.py.align_grid_grid,align_grid_point,COORD_TOLERANCE) fromaccessors/space.pyintoalign/space.py.accessors/mx.pyimports these from..align. Theaccessorspackage now holds only the accessor itself.align/time.pyno longer imports fromaccessors.The code is moved unchanged, so there is no behaviour change, and all 93 tests pass.
🤖 Generated with Claude Code