Skip to content

Compute multiple dask backed arrays at once #804

Description

@jcrist

In dask, a user can compute multiple arrays in a single scheduler run using the dask.compute function:

>>> a_computed, b_computed = dask.compute(a, b)

This is nice for when a and b might share intermediates. The same can be done currently in xarray if a and b are first put into a dataset:

>>> both = xr.Dataset(dict(a=a, b=b))
>>> both.load()    # Compute all the arrays in a single pass

This is fine, but it might also be nice to be able to do this without first putting everything into a dataset. I'm not sure what a good api is here, as xarray objects mutate when computed. Perhaps just adding an xr.compute(*args) function that fully realizes all dask backed variables.

>>> xr.compute(a, b)    # a and b now contain numpy arrays, not dask arrays

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions