Skip to content

Commit a6c5e63

Browse files
committed
test/switch: test getNumpyType
1 parent b41630d commit a6c5e63

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

unittest/python/test_switch.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,19 @@
33
import eigenpy
44
import numpy as np
55

6+
eigenpy.switchToNumpyMatrix()
67
quat = eigenpy.Quaternion()
78
# By default, we convert as numpy.matrix
89
coeffs_vector = quat.coeffs()
910
print(type(coeffs_vector))
1011

1112
assert isinstance(coeffs_vector,np.matrixlib.defmatrix.matrix)
13+
assert eigenpy.getNumpyType() == np.matrix
1214

1315
# Switch to numpy.array
1416
eigenpy.switchToNumpyArray()
1517
coeffs_array = quat.coeffs()
1618
print(type(coeffs_array))
1719

1820
assert isinstance(coeffs_vector,np.ndarray)
21+
assert eigenpy.getNumpyType() == np.ndarray

0 commit comments

Comments
 (0)