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
10beaf23
Verified
Commit
10beaf23
authored
Jul 17, 2021
by
Justin Carpentier
Browse files
user type: add dtype property
parent
6f588fa2
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/register.cpp
View file @
10beaf23
...
...
@@ -82,6 +82,11 @@ namespace eigenpy
const
int
code
=
call_PyArray_RegisterDataType
(
descr_ptr
);
assert
(
code
>=
0
&&
"The return code should be positive"
);
PyArray_Descr
*
new_descr
=
call_PyArray_DescrFromType
(
code
);
if
(
PyDict_SetItemString
(
py_type_ptr
->
tp_dict
,
"dtype"
,(
PyObject
*
)
descr_ptr
)
<
0
)
{
throw
std
::
invalid_argument
(
"PyDict_SetItemString fails."
);
}
instance
().
type_to_py_type_bindings
.
insert
(
std
::
make_pair
(
type_info_ptr
,
py_type_ptr
));
instance
().
py_array_descr_bindings
[
py_type_ptr
]
=
new_descr
;
...
...
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