Skip to content

Fix Dataset/DataArray.isel with drop=True and scalar DataArray indexes - #6579

Merged
max-sixty merged 10 commits into
pydata:mainfrom
headtr1ck:isel_drop
May 10, 2022
Merged

Fix Dataset/DataArray.isel with drop=True and scalar DataArray indexes#6579
max-sixty merged 10 commits into
pydata:mainfrom
headtr1ck:isel_drop

Conversation

@headtr1ck

Copy link
Copy Markdown
Collaborator

Additionally I have added new literal types for error handling (Only applied to functions related to isel such that mypy stops complaining).

@headtr1ckheadtr1ck changed the title Isel dropFix Dataset/DataArray.isel with drop=True and scalar DataArray indexesMay 8, 2022

@max-sixtymax-sixty left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Excellent, thanks @headtr1ck !

Comment threadxarray/core/dataset.py
Comment threadxarray/core/types.py
VarCompatible = Union["Variable", "ScalarOrArray"]
GroupByIncompatible = Union["Variable", "GroupBy"]

ErrorChoice = Literal["raise", "ignore"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Great! We could find / replace for these at some point

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

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

Even though it is scope creep, I have typed any occurences that I have found in this PR.
Mypy is not complaining locally about these changes.

Comment threadxarray/core/dataset.py Outdated
Comment threadxarray/core/dataset.py Outdated
@max-sixtymax-sixty added the plan to merge Final call for comments label May 8, 2022
@max-sixty

Copy link
Copy Markdown
Collaborator

I think the error is unrelated — trying again.

Thanks for switching all those over @headtr1ck !

@max-sixty
max-sixty enabled auto-merge (squash) May 10, 2022 05:53
@max-sixty
max-sixty merged commit fdc3c3d into pydata:mainMay 10, 2022
@headtr1ck
headtr1ck deleted the isel_drop branch May 11, 2022 17:19
dcherian added a commit to dcherian/xarray that referenced this pull request May 20, 2022
* main: (24 commits)
Fix overflow issue in decode_cf_datetime for dtypes <= np.uint32 (pydata#6598)
Enable flox in GroupBy and resample (pydata#5734)
Add setuptools as dependency in ASV benchmark CI (pydata#6609)
change polyval dim ordering (pydata#6601)
re-add timedelta support for polyval (pydata#6599)
Minor Dataset.map docstr clarification (pydata#6595)
New inline_array kwarg for open_dataset (pydata#6566)
Fix polyval overloads (pydata#6593)
Restore old MultiIndex dropping behaviour (pydata#6592)
[docs] add Dataset.assign_coords example (pydata#6336) (pydata#6558)
Fix zarr append dtype checks (pydata#6476)
Add missing space in exception message (pydata#6590)
Doc Link to accessors list in extending-xarray.rst (pydata#6587)
Fix Dataset/DataArray.isel with drop=True and scalar DataArray indexes (pydata#6579)
Add some warnings about rechunking to the docs (pydata#6569)
[pre-commit.ci] pre-commit autoupdate (pydata#6584)
terminology.rst: fix link to Unidata's "netcdf_dataset_components" (pydata#6583)
Allow string formatting of scalar DataArrays (pydata#5981)
Fix mypy issues & reenable in tests (pydata#6581)
polyval: Use Horner's algorithm + support chunked inputs (pydata#6548)
...
dcherian added a commit to headtr1ck/xarray that referenced this pull request May 20, 2022
commit 398f1b6
Author: dcherian <deepak@cherian.net>
Date: Fri May 20 08:47:56 2022 -0600
Backward compatibility dask
commit bde40e4
Merge: 0783df34cae8d0
Author: dcherian <deepak@cherian.net>
Date: Fri May 20 07:54:48 2022 -0600
Merge branch 'main' into dask-datetime-to-numeric
* main:
concatenate docs style (pydata#6621)
Typing for open_dataset/array/mfdataset and to_netcdf/zarr (pydata#6612)
{full,zeros,ones}_like typing (pydata#6611)
commit 0783df3
Merge: 5cff4f18de7061
Author: dcherian <deepak@cherian.net>
Date: Sun May 15 21:03:50 2022 -0600
Merge branch 'main' into dask-datetime-to-numeric
* main: (24 commits)
Fix overflow issue in decode_cf_datetime for dtypes <= np.uint32 (pydata#6598)
Enable flox in GroupBy and resample (pydata#5734)
Add setuptools as dependency in ASV benchmark CI (pydata#6609)
change polyval dim ordering (pydata#6601)
re-add timedelta support for polyval (pydata#6599)
Minor Dataset.map docstr clarification (pydata#6595)
New inline_array kwarg for open_dataset (pydata#6566)
Fix polyval overloads (pydata#6593)
Restore old MultiIndex dropping behaviour (pydata#6592)
[docs] add Dataset.assign_coords example (pydata#6336) (pydata#6558)
Fix zarr append dtype checks (pydata#6476)
Add missing space in exception message (pydata#6590)
Doc Link to accessors list in extending-xarray.rst (pydata#6587)
Fix Dataset/DataArray.isel with drop=True and scalar DataArray indexes (pydata#6579)
Add some warnings about rechunking to the docs (pydata#6569)
[pre-commit.ci] pre-commit autoupdate (pydata#6584)
terminology.rst: fix link to Unidata's "netcdf_dataset_components" (pydata#6583)
Allow string formatting of scalar DataArrays (pydata#5981)
Fix mypy issues & reenable in tests (pydata#6581)
polyval: Use Horner's algorithm + support chunked inputs (pydata#6548)
...
commit 5cff4f1
Merge: dfe200d6144c61
Author: Maximilian Roos <5635139+max-sixty@users.noreply.github.com>
Date: Sun May 1 15:16:33 2022 -0700
Merge branch 'main' into dask-datetime-to-numeric
commit dfe200d
Author: dcherian <deepak@cherian.net>
Date: Sun May 1 11:04:03 2022 -0600
Minor cleanup
commit 35ed378
Author: dcherian <deepak@cherian.net>
Date: Sun May 1 10:57:36 2022 -0600
Support dask arrays in datetime_to_numeric
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plan to mergeFinal call for comments

Projects

None yet

Development

Successfully merging this pull request may close these issues.

isel with drop=True does not drop coordinates if using scalar DataArray as indexer

3 participants

@headtr1ck@max-sixty@keewis