Describe the bug
There is a bug in the unitVector function when the input is 1D. It then returns a matrix with the unit vector repeated in rows.
Impact
Will eventually cause someone a problem
Reproduction
Here is an example of the error.
"""Test unit vector"""
import numpy as np
from hexrd.core.matrixutil import unitVector
x = np.array([1.0, 2.0, 3.0])
u = unitVector(x)
print(u)
And running it:
> python test_uv.py
[[0.26726124 0.53452248 0.80178373]
[0.26726124 0.53452248 0.80178373]
[0.26726124 0.53452248 0.80178373]]
Version
Affected Workflows
Describe the bug
There is a bug in the
unitVectorfunction when the input is 1D. It then returns a matrix with the unit vector repeated in rows.Impact
Will eventually cause someone a problem
Reproduction
Here is an example of the error.
And running it:
Version
Affected Workflows