Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Public API on Flattening Where Possible #14

Merged
merged 5 commits into from
Oct 1, 2024

Conversation

allen-adastra
Copy link
Owner

@allen-adastra allen-adastra commented Oct 1, 2024

On flattening, use the public API for accessing attributes where possible.

Public API Works

  • xr.Variable.dims
  • xr.Variable.attrs
  • xr.DataArray.variable
  • xr.DataArray.name
  • xr.Dataset.dims
  • xr.Dataset.attrs

Public API Does Not Work

  • xr.Variable.data breaks tree masking (e.g. jax.tree.map(lambda _: bool, tree))
  • xr.DataArray.coords Root Cause TBD
  • xr.DataArray.indexes Root Cause TBD
  • xr.Dataset.coords Root Cause TBD
  • xr.Dataset.indexes Root Cause TBD

Also fix some type hints.

@allen-adastra allen-adastra merged commit e2c9406 into main Oct 1, 2024
4 checks passed
@allen-adastra allen-adastra deleted the allenw/public_attrs branch October 1, 2024 02:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant