refactor: Remove xgcm dependency - #2803
Merged
Merged
Conversation
…sage Remove XgcmLikeAxis, XgcmLikeGrid, construct_xgcm_axes_object and all xgcm imports from xgrid.py; replace with SGrid2DMetadata / FaceNodePadding / Padding throughout. Clean up XgcmAxisPosition and XgcmAxes from _typing.py. Update test_structured.py to use SGRID-native get_dim_position assertions.
Delete SGRID_PADDING_TO_XGCM_POSITION and xgcm_parse_sgrid() from _sgrid/core.py, remove xgcm_parse_sgrid from the package __all__, delete the two xgcm-backed tests from test_sgrid.py, and remove "xgcm >=0.9.0" from pyproject.toml and pixi.toml. xgcm is no longer referenced anywhere in src/parcels.
- get_cell_count_along_dim: fall back to deriving face size from node dim when the face dim is absent from the dataset - _xinterpolators.py: replace grid.xgcm_grid.axes offset checks with sgrid_metadata.face/vertical_dimensions padding comparisons - _reprs.py: replace xgcm_grid repr with sgrid_metadata repr - tests/utils.py: update get_axis_from_dim_name call to new signature
erikvansebille
left a comment
Member
There was a problem hiding this comment.
PR looks very good! A few comments/questions below
Co-authored-by: Erik van Sebille <e.vansebille@uu.nl>
Co-authored-by: Erik van Sebille <e.vansebille@uu.nl>
erikvansebille
approved these changes
Aug 6, 2026
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
Resort to built-in SGRID parsing instead
Checklist
mainfor normal development,v3-supportfor v3 support)AI Disclosure