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
6178a049
Commit
6178a049
authored
Nov 06, 2018
by
serge-sans-paille
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix pythran include path for numpy math functions
Plus Start filling unit test cases
parent
f75b8e8f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
Cython/Compiler/Pythran.py
Cython/Compiler/Pythran.py
+1
-1
tests/run/numpy_pythran_unit.pyx
tests/run/numpy_pythran_unit.pyx
+15
-0
No files found.
Cython/Compiler/Pythran.py
View file @
6178a049
...
@@ -201,7 +201,7 @@ def is_pythran_buffer(type_):
...
@@ -201,7 +201,7 @@ def is_pythran_buffer(type_):
def
pythran_get_func_include_file
(
func
):
def
pythran_get_func_include_file
(
func
):
func
=
np_func_to_list
(
func
)
func
=
np_func_to_list
(
func
)
return
"pythonic/
include/
numpy/%s.hpp"
%
"/"
.
join
(
func
)
return
"pythonic/numpy/%s.hpp"
%
"/"
.
join
(
func
)
def
include_pythran_generic
(
env
):
def
include_pythran_generic
(
env
):
# Generic files
# Generic files
...
...
tests/run/numpy_pythran_unit.pyx
0 → 100644
View file @
6178a049
# mode: run
# tag: pythran, numpy, cpp
# cython: np_pythran=True
import
numpy
as
np
cimport
numpy
as
np
def
trigo
(
np
.
ndarray
[
double
,
ndim
=
1
]
angles
):
"""
>>> a = np.array([0., np.pi, np.pi *2])
>>> trigo(a)
array([ 1., -1., 1.])
"""
return
np
.
cos
(
angles
)
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