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
b37985ee
Commit
b37985ee
authored
Jul 18, 2016
by
Ivan Smirnov
Browse files
Fix a comment and wrong indentation
parent
b51fa02c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
include/pybind11/numpy.h
include/pybind11/numpy.h
+2
-3
No files found.
include/pybind11/numpy.h
View file @
b37985ee
...
@@ -134,8 +134,7 @@ public:
...
@@ -134,8 +134,7 @@ public:
array
(
const
buffer_info
&
info
)
{
array
(
const
buffer_info
&
info
)
{
auto
&
api
=
lookup_api
();
auto
&
api
=
lookup_api
();
// _dtype_from_pep3118 returns dtypes with padding fields in, however the array
// _dtype_from_pep3118 returns dtypes with padding fields in, so we need to strip them
// constructor seems to then consume them, so we don't need to strip them ourselves
auto
numpy_internal
=
module
::
import
(
"numpy.core._internal"
);
auto
numpy_internal
=
module
::
import
(
"numpy.core._internal"
);
auto
dtype_from_fmt
=
(
object
)
numpy_internal
.
attr
(
"_dtype_from_pep3118"
);
auto
dtype_from_fmt
=
(
object
)
numpy_internal
.
attr
(
"_dtype_from_pep3118"
);
auto
dtype
=
strip_padding_fields
(
dtype_from_fmt
(
pybind11
::
str
(
info
.
format
)));
auto
dtype
=
strip_padding_fields
(
dtype_from_fmt
(
pybind11
::
str
(
info
.
format
)));
...
@@ -175,7 +174,7 @@ protected:
...
@@ -175,7 +174,7 @@ protected:
auto
format
=
spec
[
1
].
cast
<
tuple
>
()[
0
].
cast
<
object
>
();
auto
format
=
spec
[
1
].
cast
<
tuple
>
()[
0
].
cast
<
object
>
();
auto
offset
=
spec
[
1
].
cast
<
tuple
>
()[
1
].
cast
<
int_
>
();
auto
offset
=
spec
[
1
].
cast
<
tuple
>
()[
1
].
cast
<
int_
>
();
if
(
!
len
(
name
)
&&
(
std
::
string
)
dtype
.
attr
(
"kind"
).
cast
<
pybind11
::
str
>
()
==
"V"
)
if
(
!
len
(
name
)
&&
(
std
::
string
)
dtype
.
attr
(
"kind"
).
cast
<
pybind11
::
str
>
()
==
"V"
)
continue
;
continue
;
field_descriptors
.
push_back
({
name
,
strip_padding_fields
(
format
),
offset
});
field_descriptors
.
push_back
({
name
,
strip_padding_fields
(
format
),
offset
});
}
}
...
...
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