Repository navigation
Apply dimension renaming without requiring new variables - #45
Open
sylvesterkaczmarek wants to merge 1 commit into
Open
sylvesterkaczmarek wants to merge 1 commit into
sylvesterkaczmarek wants to merge 1 commit into
Conversation
Author
|
Any feedback on the metadata annotation change? Let me know what needs changing before review. |
This branch has not been deployed
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.
Description
Fixes #44.
Run configured dimension renaming independently of missing-variable creation. The current nesting under
if variables_to_createskips renaming whenever a rule applies only to existing variables. This writes the requesteddimensionsattribute but leaves the variable's actual dimension names unchanged, and bypasses the existing dimension-count check.Move the existing renaming condition outside that block. Missing-variable creation retains its reference filtering, and the existing dimension helper continues to handle renaming and validation. No coordinate-generation formula, metadata precedence, dependency, deployment, or release-version changes are included. This does not overlap the history changes in #43 or exception-message changes in #40.
Jira Issue ID
Not assigned. External contribution tracked by GitHub issue #44.
Local Test Steps
Added ten file-based regression cases exercising
annotate_granulewith real VarInfo configurations. Coverage includes root/nested groups, one/two dimensions, existing or absent target coordinate variables, invalid dimension counts, and a metadata-only control. They verify numerical values, dtype, fill value, compression, coordinate values, unrelated variables, and byte-for-byte input preservation.python -m pytest tests -q --disable-warnings --cov=metadata_annotator --cov=harmony_service --cov-report=term-missing: 84 passed, 92% combined package/service statement coverage.ruff check .: passed.git diff --check: passed.Tested on macOS with Python 3.12.11 and the repository's Xarray 2025.9.0 requirement, against main at
33addf50c4176961769dbfdc5436e28202ebaaf8. Tests use synthetic NetCDF files and existing repository fixtures. No deployed Harmony service, remote granules, or other operating systems were tested.PR Acceptance Checklist
CHANGELOG.mdupdated.