From a6c5e63f1ce352b1c1b112f5209e737c8624c1c1 Mon Sep 17 00:00:00 2001 From: Justin Carpentier <justin.carpentier@inria.fr> Date: Thu, 14 Nov 2019 18:14:32 +0100 Subject: [PATCH] test/switch: test getNumpyType --- unittest/python/test_switch.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/unittest/python/test_switch.py b/unittest/python/test_switch.py index a68e6fe..da08b1d 100644 --- a/unittest/python/test_switch.py +++ b/unittest/python/test_switch.py @@ -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 -- GitLab