Skip to content

How to best deal with copyto and pint? #553

@NOhs

Description

@NOhs

The copyto function complains that argument must be numpy.ndarray, not Quantity. I guess that this numpy function is one of the few that is not supported by pint currently. My current approach to work around this is:

# ...
tmp = destination.magnitude
np.copyto(tmp, source.magnitude)
destination= tmp * source.units

Are there any cleaner options to use copyto with units?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions