Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
41c33990
Commit
41c33990
authored
Jul 18, 2016
by
Ivan Smirnov
Browse files
Update npy_format_descriptor::name()
parent
076b953c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletion
+3
-1
example/example20.py
example/example20.py
+2
-0
include/pybind11/numpy.h
include/pybind11/numpy.h
+1
-1
No files found.
example/example20.py
View file @
41c33990
...
@@ -70,3 +70,5 @@ check_eq(arr, [((False, 0, 0.0), (True, 1, 1.5)),
...
@@ -70,3 +70,5 @@ check_eq(arr, [((False, 0, 0.0), (True, 1, 1.5)),
((
True
,
1
,
1.5
),
(
False
,
2
,
3.0
)),
((
True
,
1
,
1.5
),
(
False
,
2
,
3.0
)),
((
False
,
2
,
3.0
),
(
True
,
3
,
4.5
))],
nested_dtype
)
((
False
,
2
,
3.0
),
(
True
,
3
,
4.5
))],
nested_dtype
)
print_rec_nested
(
arr
)
print_rec_nested
(
arr
)
assert
create_rec_nested
.
__doc__
.
strip
().
endswith
(
'numpy.ndarray[dtype=NestedStruct]'
)
include/pybind11/numpy.h
View file @
41c33990
...
@@ -281,7 +281,7 @@ struct field_descriptor {
...
@@ -281,7 +281,7 @@ struct field_descriptor {
template
<
typename
T
>
template
<
typename
T
>
struct
npy_format_descriptor
<
T
,
typename
std
::
enable_if
<
is_pod_struct
<
T
>::
value
>::
type
>
{
struct
npy_format_descriptor
<
T
,
typename
std
::
enable_if
<
is_pod_struct
<
T
>::
value
>::
type
>
{
static
PYBIND11_DESCR
name
()
{
return
_
(
"
user-defined
"
);
}
static
PYBIND11_DESCR
name
()
{
return
_
(
"
struct
"
);
}
static
object
dtype
()
{
static
object
dtype
()
{
if
(
!
dtype_
())
if
(
!
dtype_
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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