home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 681605223

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/issues/4372#issuecomment-681605223 https://api.github.com/repos/pydata/xarray/issues/4372 681605223 MDEyOklzc3VlQ29tbWVudDY4MTYwNTIyMw== 5821660 2020-08-27T06:13:03Z 2020-08-27T06:13:03Z MEMBER

One solution would be to catch this ValueError, issue a FutureWarning and add allow_rechunk=True to dask_gufunc_kwargs here:

https://github.com/pydata/xarray/blob/9c85dd5f792805bea319f01f08ee51b83bde0f3b/xarray/core/computation.py#L646-L657

```python def func(*arrays): import dask.array as da

        gufunc = functools.partial(
            da.apply_gufunc,
            numpy_func,
            signature.to_gufunc_string(exclude_dims),
            *arrays,
            vectorize=vectorize,
            output_dtypes=output_dtypes,
        )

        try:
            res = gufunc(**dask_gufunc_kwargs)
        except ValueError as exc:
            if "with different chunksize present" in str(exc):
                warnings.warn(
                    f"``allow_rechunk=True`` need to be explicitely set in the "
                    f"``dask_gufunc_kwargs`` parameter. Not setting will raise dask "
                    f"ValueError ``{str(exc)}`` in a future version.",
                    FutureWarning,
                    stacklevel=2,
                )
                dask_gufunc_kwargs["allow_rechunk"] = True
                res = gufunc(**dask_gufunc_kwargs)
            else:
                raise

```

I could make a PR out of this. The message wording can surely be improved. WDYT @dcherian and @shoyer?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  684930038
Powered by Datasette · Queries took 0.473ms · About: xarray-datasette