Skip to content

Bug: can perform numpy.linalg.solve on offset unit #2211

@oxygen-dioxide

Description

@oxygen-dioxide

Offset units (such as degC) shouldn't be allowed to perform numpy.linalg.solve. However, in current pint, the following code doesn't throw error:

from pint import UnitRegistry;ureg=UnitRegistry();import numpy
numpy.linalg.solve(ureg.Quantity([[1,2],[3,4]], "degC"), [1,1])

and the result is <Quantity([-1. 1.], '1 / degree_Celsius')>

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