Uh oh!
There was an error while loading. Please reload this page.
isel(): Clean up logic, improve docs, and fix UxDataset.isel(..., ignore_grid=True) crash - #1684
isel(): Clean up logic, improve docs, and fix UxDataset.isel(..., ignore_grid=True) crash#1684Sevans711 wants to merge 6 commits into
isel(): Clean up logic, improve docs, and fix UxDataset.isel(..., ignore_grid=True) crash#1684Conversation
see #1683 for details. Still need to add regression test for the UxDataArray.isel(..., ignore_grid=True) case
rajeeja
commented
Aug 19, 2026
Logic and docs are a clear improvement, and matching xarray's error messages verbatim is the right call — users shouldn't get a different exception from us than from xarray for the same mistake. One nit: |
Sevans711
commented
Aug 19, 2026
@rajeeja Thank you for taking a look! I just updated it to |
Closes#1683
Overview
Implements all fixes and suggestions from #1683.
Bug fix:
The following lines used to crash, but now succeed:
The originally-reported bug was slightly misleading in that it claimed
uxds.isel(..., ignore_grid=True)crashed. In fact, that method does not actually crash directly. But, it does lead to a resultingUxDatasetwithout auxgrid, so when it is the last line in a Jupyter notebook cell and Jupyter attempts to display it, it crashed upon attempting to accessuxgrid. This crash no longer occurs in this PR.Added a regression test which fails on main but succeeds after this fix.
Cleanup of confusing logic and redundant error message handling:
With numbers here corresponding to numbers in original issue report:
len(grid_dims)>1 and not ignore_grid(which should be unreachable due to_validate_indexerscrashing earlier on in that case).Docstring improvements
With numbers here corresponding to numbers in original issue report:
ignore_grid=Truebehavior in docstring, including the phrase:CAUTION: using ignore_grid=True will cause the result's data to be inconsistent with its underlying grid, if any grid dimensions were sliced.PR Checklist
General
Testing & Benchmarking
Documentation
docs/api.rst_)AI Disclosure
AI Usage: just GitHub Copilot's inline code suggestions.