Skip to content

Decorator for converting quantity to arrays in specific units? #7368

Open

Description

@mhvk

I know this was discussed some time ago on the mailing list (I know @taldcroft expressed a wish for it), and thought there was an issue already, but couldn't find it: for some functions based on regular ndarray it would be good to have a decorator that converts input to a required unit and then takes the value, i.e., input.to_value(...). If the decorator is sufficiently clever, it would also including converting multiple inputs to the same unit (e.g., that of the first argument), something that is currently done in, e.g., _unquantity_allclose_arguments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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