Skip to content

Fix open_datatree when decode_cf=False #10141

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

Merged
merged 2 commits into from
Mar 18, 2025
Merged

Fix open_datatree when decode_cf=False #10141

merged 2 commits into from
Mar 18, 2025

Conversation

ianhi
Copy link
Contributor

@ianhi ianhi commented Mar 17, 2025

Harmonizes behavior with dataset for the same situation. When the dataarray has an attribute that triggers cf_convention decoding, passing decode_cf=False had not effect.

I also updated the text rendering of the simple_datatree test fixture to the current rendering which looks nicer and also correctly indentifies the type of each array.

As a side note (for follow up) it seems that assert_equal as is used in the other tests does not check for dtype.

attn @TomNicholas

Copy link

welcome bot commented Mar 17, 2025

Thank you for opening this pull request! It may take us a few days to respond here, so thank you for being patient.
If you have questions, some answers may be found in our contributing guidelines.

@TomNicholas TomNicholas added topic-CF conventions topic-DataTree Related to the implementation of a DataTree class labels Mar 18, 2025
Copy link
Member

@TomNicholas TomNicholas left a comment

Choose a reason for hiding this comment

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

Nice, thanks @ianhi !

@dcherian dcherian merged commit 314cb26 into pydata:main Mar 18, 2025
40 checks passed
Copy link

welcome bot commented Mar 18, 2025

Congratulations on completing your first pull request! Welcome to Xarray! We are proud of you, and hope to see you again! celebration gif

@ianhi ianhi deleted the decode_cf branch March 18, 2025 16:32
dcherian added a commit to dcherian/xarray that referenced this pull request Mar 19, 2025
* main: (85 commits)
  Adds open_datatree and load_datatree to the tutorial module (pydata#10082)
  Fix version in requires_zarr_v3 fixture (pydata#10145)
  Fix `open_datatree` when `decode_cf=False` (pydata#10141)
  [docs] `DataTree` cannot be constructed from `DataArray` (pydata#10142)
  Refactor datetime and timedelta encoding for increased robustness (pydata#9498)
  Fix test_distributed::test_async (pydata#10138)
  Refactor concat / combine / merge into `xarray/structure` (pydata#10134)
  Split `apply_ufunc` out of `computation.py` (pydata#10133)
  Refactor modules from `core` into `xarray.computation` (pydata#10132)
  Refactor compatibility modules into xarray.compat package (pydata#10131)
  Fix type issues from pandas stubs (pydata#10128)
  Don't skip tests when on a `mypy` branch (pydata#10129)
  Change `python_files` in `pyproject.toml` to a list (pydata#10127)
  Better `uv` compatibility (pydata#10124)
  explicitly cast the dtype of `where`'s condition parameter to `bool` (pydata#10087)
  Use `to_numpy` in time decoding (pydata#10081)
  Pin pandas stubs (pydata#10119)
  Fix broken Zarr test (pydata#10109)
  Update asv badge url in README.md (pydata#10113)
  fix and supress some test warnings (pydata#10104)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-CF conventions topic-DataTree Related to the implementation of a DataTree class
Projects
None yet
Development

Successfully merging this pull request may close these issues.

inconsticency between xr.open_dataset and xr.open_datatree for decode_cf argument
3 participants