Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
8880c78f
Commit
8880c78f
authored
Aug 01, 2012
by
Mark Florisson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix numpy fused types dispatch test
parent
ad94a5b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
tests/run/numpy_test.pyx
tests/run/numpy_test.pyx
+10
-8
No files found.
tests/run/numpy_test.pyx
View file @
8880c78f
...
...
@@ -565,7 +565,7 @@ def test_fused_external(np.ndarray[fused_external, ndim=1] a):
>>> test_fused_external["int32_t"](int32_array)
int32
>>> test_fused_external(np.arange(100))
>>> test_fused_external(np.arange(100
, dtype=np.int64
))
int64
"""
print
a
.
dtype
...
...
@@ -604,17 +604,19 @@ def test_fused_ndarray_integral_dtype(np.ndarray[cython.integral, ndim=1] a):
['int', 'long', 'short']
>>> test_fused_ndarray_integral_dtype[cython.int](np.arange(10, dtype=np.dtype('i')))
ndarray[int,ndim=1] ndarray[int,ndim=1]
5 6
5 6
>>> test_fused_ndarray_integral_dtype(np.arange(10, dtype=np.dtype('i')))
ndarray[int,ndim=1] ndarray[int,ndim=1]
5 6
5 6
>>> test_fused_ndarray_integral_dtype[cython.long](np.arange(10, dtype=
np.long
))
ndarray[long,ndim=1] ndarray[long,ndim=1]
5 6
>>> test_fused_ndarray_integral_dtype(np.arange(10, dtype=
np.long
))
ndarray[long,ndim=1] ndarray[long,ndim=1]
5 6
>>> test_fused_ndarray_integral_dtype[cython.long](np.arange(10, dtype=
'l'
))
5 6
>>> test_fused_ndarray_integral_dtype(np.arange(10, dtype=
'l'
))
5 6
"""
cdef
np
.
ndarray
[
cython
.
integral
,
ndim
=
1
]
b
=
a
print
cython
.
typeof
(
a
),
cython
.
typeof
(
b
),
a
[
5
],
b
[
6
]
# Don't print the types, the platform specific sizes can make the dispatcher
# select different integer types with equal sizeof()
print
a
[
5
],
b
[
6
]
cdef
fused
fused_dtype
:
float
complex
...
...
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