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
06f6bf39
Commit
06f6bf39
authored
May 15, 2020
by
jbrockmendel
Committed by
GitHub
May 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix PyArray_SearchSorted signature (GH-3606)
parent
662cc6b2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
Cython/Includes/numpy/__init__.pxd
Cython/Includes/numpy/__init__.pxd
+1
-2
tests/run/numpy_test.pyx
tests/run/numpy_test.pyx
+14
-0
No files found.
Cython/Includes/numpy/__init__.pxd
View file @
06f6bf39
...
...
@@ -302,7 +302,6 @@ cdef extern from "numpy/arrayobject.h":
"""
return
PyArray_BYTES
(
self
)
ctypedef
unsigned
char
npy_bool
ctypedef
signed
char
npy_byte
...
...
@@ -655,7 +654,7 @@ cdef extern from "numpy/arrayobject.h":
object
PyArray_Choose
(
ndarray
,
object
,
ndarray
,
NPY_CLIPMODE
)
int
PyArray_Sort
(
ndarray
,
int
,
NPY_SORTKIND
)
object
PyArray_ArgSort
(
ndarray
,
int
,
NPY_SORTKIND
)
object
PyArray_SearchSorted
(
ndarray
,
object
,
NPY_SEARCHSIDE
)
object
PyArray_SearchSorted
(
ndarray
,
object
,
NPY_SEARCHSIDE
,
PyObject
*
)
object
PyArray_ArgMax
(
ndarray
,
int
,
ndarray
)
object
PyArray_ArgMin
(
ndarray
,
int
,
ndarray
)
object
PyArray_Reshape
(
ndarray
,
object
)
...
...
tests/run/numpy_test.pyx
View file @
06f6bf39
...
...
@@ -944,3 +944,17 @@ def test_broadcast_comparison(np.ndarray[double, ndim=1] a):
cdef
object
obj
=
a
return
a
==
0
,
obj
==
0
,
a
==
1
,
obj
==
1
@
testcase
def
test_c_api_searchsorted
(
np
.
ndarray
arr
,
other
):
"""
>>> arr = np.random.randn(10)
>>> other = np.random.randn(5)
>>> result, expected = test_c_api_searchsorted(arr, other)
>>> (result == expected).all()
True
"""
result
=
np
.
PyArray_SearchSorted
(
arr
,
other
,
np
.
NPY_SEARCHRIGHT
,
NULL
)
expected
=
arr
.
searchsorted
(
other
,
side
=
"right"
)
return
result
,
expected
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