Skip to content

ones() and zeros() got multiple values for argument 'dtype' #6275

Open

Description

@bluegeo

While computing a dask array using the ones() (or zeros) API, and using dtype as a positional (second) argument, the following error occurs:

TypeError: ones() got multiple values for argument 'dtype'

The documentation states that they follow the signature of the numpy variants exactly, which would not require dtype to be a keyword argument.

This works:

da.ones((3, 3), dtype='bool').compute()

But this does not:

da.ones((3, 3), 'bool').compute()

Using dask-2.17.2-py_0 with Python 3.6.9 installed using conda on MacOS 10.15.5

Activity

  1. jcrist commented on Jun 1, 2020

    @jcrist
    Member

    Thanks for the issue report, I'm able to reproduce. Taking care of this now.

  2. jcrist commented on Jun 1, 2020

    @jcrist
    Member

    See #6276.

  3. bmerry commented on Feb 8, 2021

    @bmerry
    Contributor

    I just ran into this bug, but it seems that now (version 2021.2.0), the behaviour is to silently ignore the positional dtype and use float64, rather than raising an exception.

  4. jsignell commented on Feb 8, 2021

    @jsignell
    Member

    but it seems that now (version 2021.2.0), the behaviour is to silently ignore the positional dtype and use float64, rather than raising an exception.

    Well that seems worse. I will see if I can revitalize #6276 or if there is a smaller diff that we can do instead.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions