enthought / enthought/scimath

np.dot is not supported by scimath

Open
#89 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
66
Forks
13
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.