Skip to content

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

@jbusecke

Description

@jbusecke

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions