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

Support **kwargs form in .chunk() #6459

Closed
jbusecke opened this issue Apr 8, 2022 · 0 comments · Fixed by #6471
Closed

Support **kwargs form in .chunk() #6459

jbusecke opened this issue Apr 8, 2022 · 0 comments · Fixed by #6471

Comments

@jbusecke
Copy link
Contributor

jbusecke commented Apr 8, 2022

Is your feature request related to a problem?

Take a simple example

import xarray as xr
da = xr.DataArray([1,2,4], dims=['x'])

If I want to chunk the array I can do:

da.chunk({'x':1})

but I cant do this:

da.chunk(x=1)
TypeError: chunk() got an unexpected keyword argument 'x'

Describe the solution you'd like

I would like to be able to use the .chunk() method for dataarrays in both ways, since it is common for many xarray methods to work either way (e.g. isel()/coarsen()/etc).

@TomNicholas

Describe alternatives you've considered

No response

Additional context

No response

@dcherian dcherian changed the title Unify input behavior of .chunk() with other methods Support **kwargs form in .chunk() Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant