Skip to content

Conversation

@VeckoTheGecko
Copy link
Contributor

@VeckoTheGecko VeckoTheGecko commented Jan 13, 2026

Before, the tooling in sgrid was used for the renaming of dimensions. Now that we're also parsing node_coordinates - which aren't dimensions - we need to make this tooling more flexible so that we can handle renaming of any dimension/coordinate name listed in the metadata.

This PR implements these changes, and updates all local variable names/error messages accordingly

Notable changes:

  • Update Grid*DMetadata.rename_dims to .rename
  • Update sgrid.rename_dims to sgrid.rename (along with internal xarray call)
  • Add test

See commit history for full info

Done to help along #2460

Copy link
Member

@erikvansebille erikvansebille left a comment

Choose a reason for hiding this comment

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

Looks good to me!

return dims


@overload
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These were moved to be directly over the _metadata_rename_dims function (as this is how @overloads work).

Wasn't flagged before since we're not (yet) running mypy

Docs reference generation wasn't ignored before
- Update Grid*DMetadata.rename_dims to .rename
- Update sgrid.rename_dims to sgrid.rename
- Add test
@VeckoTheGecko VeckoTheGecko enabled auto-merge (squash) January 13, 2026 11:00
@VeckoTheGecko VeckoTheGecko merged commit afc820a into Parcels-code:v4-dev Jan 13, 2026
9 of 10 checks passed
@github-project-automation github-project-automation bot moved this from Backlog to Done in Parcels development Jan 13, 2026
@VeckoTheGecko VeckoTheGecko deleted the 000-sgrid-rename branch January 20, 2026 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants