Skip to content

Overload DataArray's argmin and argmax methods on dim parameter #10893

@cfriedland5

Description

@cfriedland5

Is your feature request related to a problem?

DataArray's argmin and argmax methods currently have a return type of Self | dict[Hashable, Self]. However, based on the argument provided to dim I know which element of the union it will be, making the return value less convenient to type check than it could be (e.g., requires casting or type checker suppression comments).

Describe the solution you'd like

Provide overloads for the methods that give a more specific return type depending on the type of the argument to dim.

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions