Make xgcm a dependency and remove vendored code#2220
Merged
VeckoTheGecko merged 4 commits intoParcels-code:v4-devfrom Sep 16, 2025
Merged
Make xgcm a dependency and remove vendored code#2220VeckoTheGecko merged 4 commits intoParcels-code:v4-devfrom
VeckoTheGecko merged 4 commits intoParcels-code:v4-devfrom
Conversation
Now we're not vendoring anymore, reducing reliance on private API - Axis._ds no longer exists - Saving `parcels.XGrid._ds` as an attribute
- Pass dataset to Grid (not dataarray) - Set `autoparse_metadata` to where coords are provided
52d1642 to
48210b9
Compare
erikvansebille
approved these changes
Sep 16, 2025
Member
erikvansebille
left a comment
There was a problem hiding this comment.
Good that we can use xgcm as a dependency now!
VeckoTheGecko
commented
Sep 16, 2025
| assert_valid_lat_lon(ds["lat"], ds["lon"], grid.axes) | ||
|
|
||
| assert_valid_mesh(mesh) | ||
| self._ds = ds |
Contributor
Author
There was a problem hiding this comment.
@jbusecke do you feel accessing xgcm.Grid._ds would be bad practice? Its private API (not asking you to make it public), but also passing the original dataset alongside in the initialiser seems a bit verbose. We need access to the dataset for grid searching.
Also, I assume you aren't making modifications to the dataset under the hood in xgcm?
Happy to discuss face to face during our catchup :)
There was a problem hiding this comment.
TLDR; Yes, I think its fine as far as I can recall.
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.
Fixes #2193