Skip to content

Make xgcm a dependency and remove vendored code#2220

Merged
VeckoTheGecko merged 4 commits intoParcels-code:v4-devfrom
VeckoTheGecko:2193-xgcm
Sep 16, 2025
Merged

Make xgcm a dependency and remove vendored code#2220
VeckoTheGecko merged 4 commits intoParcels-code:v4-devfrom
VeckoTheGecko:2193-xgcm

Conversation

@VeckoTheGecko
Copy link
Contributor

Fixes #2193

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
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.

Good that we can use xgcm as a dependency now!

assert_valid_lat_lon(ds["lat"], ds["lon"], grid.axes)

assert_valid_mesh(mesh)
self._ds = ds
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@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 :)

Choose a reason for hiding this comment

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

TLDR; Yes, I think its fine as far as I can recall.

@VeckoTheGecko VeckoTheGecko merged commit 6b267ed into Parcels-code:v4-dev Sep 16, 2025
9 checks passed
@github-project-automation github-project-automation bot moved this from Backlog to Done in Parcels development Sep 16, 2025
@VeckoTheGecko VeckoTheGecko deleted the 2193-xgcm branch October 7, 2025 11:03
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.

Make xgcm a dependency and remove vendored code

3 participants

Comments