File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 11language : python
22python :
33 - " 2.7"
4+ - " 3.5"
45sudo : required
56compiler :
67 - gcc
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ namespace eigenpy
4646
4747 enum NP_TYPE
4848 {
49+ DEFAULT_TYPE,
4950 MATRIX_TYPE,
5051 ARRAY_TYPE
5152 };
@@ -66,6 +67,16 @@ namespace eigenpy
6667
6768 bp::object make (PyObject* pyObj, bool copy = false )
6869 {
70+ if (getType () == DEFAULT_TYPE) {
71+ std::cerr <<
72+ " eigenpy warning: you use the deprecated class numpy.matrix without explicily asking for it. "
73+ " The default behaviour will change to numpy.array at next major release.\n "
74+ " - Either call eigenpy.switchToNumpyMatrix() before using eigenpy to suppress this warning\n "
75+ " - or call eigenpy.switchToNumpyArray() and adapt your code accordingly.\n "
76+ " See https://github.com/stack-of-tasks/eigenpy/issues/87 for further details."
77+ << std::endl;
78+ switchToNumpyMatrix ();
79+ }
6980 bp::object m;
7081 if (PyType_IsSubtype (reinterpret_cast <PyTypeObject*>(CurrentNumpyType.ptr ()),NumpyMatrixType))
7182 m = NumpyMatrixObject (bp::object (bp::handle<>(pyObj)), bp::object (), copy);
@@ -122,7 +133,7 @@ namespace eigenpy
122133 // NumpyAsMatrixType = reinterpret_cast<PyTypeObject*>(NumpyAsMatrixObject.ptr());
123134
124135 CurrentNumpyType = NumpyMatrixObject; // default conversion
125- getType () = MATRIX_TYPE ;
136+ getType () = DEFAULT_TYPE ;
126137 }
127138
128139 bp::object CurrentNumpyType;
You can’t perform that action at this time.
0 commit comments