Skip to content

Avoid using x.dtype in dask.array #1718

Closed

Description

@mrocklin

We sometimes use the .dtype property within dask.array which can sometimes trigger computation. We should use ._dtype instead.

Activity

  1. jcrist commented on Oct 28, 2016

    @jcrist
    Member

    I'm took a brief look through this, and am wondering if there's a reason why we don't make known dtype strict here, as we did in dask.dataframe. The only places I can see where unknown dtype may appear is in user provided functions (e.g. map_blocks). dtype inference similar to what we did for dask.dataframe could also work here. This seems easier to me than trying to find all the places where we accidentally trigger computation.

  2. mrocklin commented on Oct 28, 2016

    @mrocklin
    MemberAuthor

    I would be open to trying the function. I would also be open to requiring explicit dtypes.

    FWIW I think that this is fairly low priority

  3. shoyer commented on Oct 28, 2016

    @shoyer
    Member

    Yes, I like requiring explicit dtypes. Trigger computation with .dtype can be problematic if it's expensive -- users have encountered this when using when using dask.array in xarray.

  4. mrocklin commented on Oct 28, 2016

    @mrocklin
    MemberAuthor

    @shoyer you'd prefer that dask.array err early?

  5. shoyer commented on Oct 28, 2016

    @shoyer
    Member

    I think so. It's not hard to require a dtype in map_blocks.

    On Fri, Oct 28, 2016 at 2:27 PM, Matthew Rocklin [email protected]
    wrote:

    @shoyer https://github.com/shoyer you'd prefer that dask.array err
    early?

    —
    You are receiving this because you were mentioned.
    Reply to this email directly, view it on GitHub
    #1718 (comment), or mute
    the thread
    https://github.com/notifications/unsubscribe-auth/ABKS1vcQE0noODpWPf5AbnxaLh2g1VySks5q4mjRgaJpZM4Ki7Yj
    .

  6. added this to the 0.13.0 milestone on Jan 4, 2017
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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions