Skip to content
Snippets Groups Projects
Verified Commit a6c5e63f authored by Justin Carpentier's avatar Justin Carpentier
Browse files

test/switch: test getNumpyType

parent b41630d3
No related branches found
No related tags found
No related merge requests found
......@@ -3,12 +3,14 @@ from __future__ import print_function
import eigenpy
import numpy as np
eigenpy.switchToNumpyMatrix()
quat = eigenpy.Quaternion()
# By default, we convert as numpy.matrix
coeffs_vector = quat.coeffs()
print(type(coeffs_vector))
assert isinstance(coeffs_vector,np.matrixlib.defmatrix.matrix)
assert eigenpy.getNumpyType() == np.matrix
# Switch to numpy.array
eigenpy.switchToNumpyArray()
......@@ -16,3 +18,4 @@ coeffs_array = quat.coeffs()
print(type(coeffs_array))
assert isinstance(coeffs_vector,np.ndarray)
assert eigenpy.getNumpyType() == np.ndarray
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment