Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
eigenpy
Commits
b2eca85f
Verified
Commit
b2eca85f
authored
May 23, 2020
by
Justin Carpentier
Browse files
core: fix call to PyArray_Check
parent
4e82e8b5
Changes
3
Hide whitespace changes
Inline
Side-by-side
include/eigenpy/eigen-from-python.hpp
View file @
b2eca85f
...
...
@@ -285,7 +285,7 @@ namespace eigenpy
template
<
typename
MatType
>
void
*
EigenFromPy
<
MatType
>::
convertible
(
PyArrayObject
*
pyArray
)
{
if
(
!
PyArray_Check
(
pyArray
))
if
(
!
call_
PyArray_Check
(
pyArray
))
return
0
;
if
(
!
np_type_is_convertible_into_scalar
<
Scalar
>
(
EIGENPY_GET_PY_ARRAY_TYPE
(
pyArray
)))
...
...
@@ -476,7 +476,7 @@ namespace eigenpy
/// \brief Determine if pyObj can be converted into a MatType object
static
void
*
convertible
(
PyArrayObject
*
pyArray
)
{
if
(
!
PyArray_Check
(
pyArray
))
if
(
!
call_
PyArray_Check
(
pyArray
))
return
0
;
if
(
!
PyArray_ISWRITEABLE
(
pyArray
))
return
0
;
...
...
include/eigenpy/numpy.hpp
View file @
b2eca85f
...
...
@@ -37,6 +37,8 @@ namespace eigenpy
#if defined _WIN32 || defined __CYGWIN__
namespace
eigenpy
{
EIGENPY_DLLEXPORT
bool
call_PyArray_Check
(
PyObject
*
);
EIGENPY_DLLEXPORT
PyObject
*
call_PyArray_SimpleNew
(
int
nd
,
npy_intp
*
shape
,
int
np_type
);
EIGENPY_DLLEXPORT
PyObject
*
call_PyArray_New
(
PyTypeObject
*
py_type_ptr
,
int
nd
,
npy_intp
*
shape
,
int
np_type
,
void
*
data_ptr
,
int
options
);
...
...
@@ -52,6 +54,7 @@ namespace eigenpy
EIGENPY_DLLEXPORT
int
call_PyArray_RegisterDataType
(
PyArray_Descr
*
dtype
);
}
#else
#define call_PyArray_Check(py_obj) PyArray_Check(py_obj)
#define call_PyArray_SimpleNew PyArray_SimpleNew
#define call_PyArray_New(py_type_ptr,nd,shape,np_type,data_ptr,options) \
PyArray_New(py_type_ptr,nd,shape,np_type,NULL,data_ptr,0,options,NULL)
...
...
src/numpy.cpp
View file @
b2eca85f
...
...
@@ -22,6 +22,11 @@ namespace eigenpy
#if defined _WIN32 || defined __CYGWIN__
bool
call_PyArray_Check
(
PyObject
*
py_obj
)
{
return
PyArray_Check
(
py_obj
);
}
PyObject
*
call_PyArray_SimpleNew
(
int
nd
,
npy_intp
*
shape
,
int
np_type
)
{
return
PyArray_SimpleNew
(
nd
,
shape
,
np_type
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment