Skip to content

Make eye signature consistent with NumPy #8934

@tomwhite

Description

@tomwhite

What happened:

Dask's signature for eye is

dask.array.eye(N, chunks='auto', M=None, k=0, dtype=<class 'float'>)

Whereas NumPy's is

numpy.eye(N, M=None, k=0, dtype=<class 'float'>, order='C', *, like=None)

The position of the chunks parameter in Dask means that a call like eye(3, 2) means different things in Dask and NumPy.

What you expected to happen: Behaviour the same as NumPy.

Minimal Complete Verifiable Example:

>>> import numpy as np
>>> np.eye(3, 2).shape
(3, 2)
>>> import dask.array as da
>>> da.eye(3, 2).shape
(3, 3)

Anything else we need to know?:

Environment:

  • Dask version: main
  • Python version: 3.8
  • Operating System: mac
  • Install method (conda, pip, source): source
Cluster Dump State:

Metadata

Metadata

Assignees

No one assigned

    Labels

    arrayneeds attentionIt's been a while since this was pushed on. Needs attention from the owner or a maintainer.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions