Skip to content

add optional undo to dataset aligner - #200

Merged
tennlee merged 2 commits into
ACCESS-Community-Hub:developfrom
edoyango:add_dimalign_undo
Nov 11, 2025
Merged

tennlee merged 2 commits into
ACCESS-Community-Hub:developfrom
edoyango:add_dimalign_undo

Conversation

@edoyango

@edoyango edoyango commented Nov 10, 2025 •

Copy link
Copy Markdown
Collaborator

As a follow up to #197 This adds undo functionality to the AlignDataVariableDimensionsToDatasetCoords class. By default, undoing the dim alignment is turned off (restoring previous behaviour). Turn it on by passing undo=True at instantiation.

Associated tests have been added and made use of parameterized tests to make existing tests a bit neater.

@coveralls

coveralls commented Nov 10, 2025 •

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 19249517778

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 24 of 24 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 61.189%

Totals Coverage Status
Change from base Build 19207266644: 0.02%
Covered Lines: 9552
Relevant Lines: 15196

💛 - Coveralls

@tennlee

tennlee commented Nov 10, 2025

Copy link
Copy Markdown
Collaborator

This looks really good. Ideally the init method would have a docstring explaining the purpose of the 'undo' argument.

Potentially, the argument should be called something like "restore_original_dimension_ordering_on_undo" which, while verbose, is pretty easy to understand. I'm open to suggestions.

The implementation looks great, thank you very much. Let's talk it through tomorrow and put the finishing touches on it then.

@edoyango

Copy link
Copy Markdown
Collaborator Author

no worries happy to rename the variable and add doc strings. Perhaps restore_dim_order_on_undo could be more succinct while retaining clarity?

@edoyango

Copy link
Copy Markdown
Collaborator Author

variable name changed and doc string added!

@tennlee
tennlee merged commit 626161b into ACCESS-Community-Hub:develop Nov 11, 2025
6 checks passed
@edoyango
edoyango deleted the add_dimalign_undo branch November 12, 2025 22:39
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