Skip to content

UserWarning when computing chunked pint arrays #116

Closed
@TomNicholas

Description

@TomNicholas
da = xr.DataArray([1,2,3], dims=['x'], attrs={'units': 'metres'})

chunked = da.pint.quantify().pint.chunk(1)
# chunked2 = da.chunk(1).pint.quantify()  # also happens if I do it in this order instead

Everything looks fine here, excellent...

Screenshot from 2021-07-01 12-31-28

but when I go to compute then I get a UserWarning, even though it returns the correct answer:

chunked.mean().compute()
/home/tegn500/miniconda3/envs/py38-mamba/lib/python3.8/site-packages/dask/array/core.py:3139: 
UserWarning: Passing an object to dask.array.from_array which is already a Dask collection. This can lead to unexpected behavior.
  warnings.warn(

Even if this is working fine then we don't want to be giving warnings to the user ideally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingupstream issueSomething isn't working upstream

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions