Skip to content

np.dot is not supported by scimath #89

@awa5114

Description

@awa5114

I came from he pint package, disappointed with its numpy support to scimath in hopes that the UnitArray could present some interesting possibilities. Unfortunately this is not the case. I would like to run a unit-aware dot product using 2 unit arrays, but this won't work:

a = UnitArray(np.linspace(0, 5, 6), units="cm")
b = UnitArray(np.linspace(0, 9, 6), units="sec")
c = np.dot(a,b)

type(c) shows that this is a numpy.float64 object and not a UnitArray of length 0 or a UnitScalar as I would expect. This makes it difficult for me to see the use of UnitArrays since they currently only appear to support element wise multiplication in numpy...

Is there a concise way of doing a unit-aware dot product with scimath? If so how? If not how to implement it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions