Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
language: python
python:
- "2.7"
- "3.5"
sudo: required
compiler:
- gcc
Expand Down
13 changes: 12 additions & 1 deletion include/eigenpy/details.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ namespace eigenpy

enum NP_TYPE
{
DEFAULT_TYPE,
MATRIX_TYPE,
ARRAY_TYPE
};
Expand All @@ -66,6 +67,16 @@ namespace eigenpy

bp::object make(PyObject* pyObj, bool copy = false)
{
if (getType() == DEFAULT_TYPE) {
std::cerr <<
"eigenpy warning: you use the deprecated class numpy.matrix without explicily asking for it. "
"The default behaviour will change to numpy.array at next major release.\n"
"- Either call eigenpy.switchToNumpyMatrix() before using eigenpy to suppress this warning\n"
"- or call eigenpy.switchToNumpyArray() and adapt your code accordingly.\n"
"See https://github.com/stack-of-tasks/eigenpy/issues/87 for further details."
<< std::endl;
switchToNumpyMatrix();
}
bp::object m;
if(PyType_IsSubtype(reinterpret_cast<PyTypeObject*>(CurrentNumpyType.ptr()),NumpyMatrixType))
m = NumpyMatrixObject(bp::object(bp::handle<>(pyObj)), bp::object(), copy);
Expand Down Expand Up @@ -122,7 +133,7 @@ namespace eigenpy
//NumpyAsMatrixType = reinterpret_cast<PyTypeObject*>(NumpyAsMatrixObject.ptr());

CurrentNumpyType = NumpyMatrixObject; // default conversion
getType() = MATRIX_TYPE;
getType() = DEFAULT_TYPE;
}

bp::object CurrentNumpyType;
Expand Down