Skip to content

Commit

Permalink
python: Add test for complex datatype Cython tag generation
Browse files Browse the repository at this point in the history
  • Loading branch information
aeberspaecher authored and b4n committed Jan 28, 2015
1 parent 666c398 commit b979ae5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions Units/cython_sample2.d/args.ctags
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--fields=ksS
3 changes: 3 additions & 0 deletions Units/cython_sample2.d/expected.tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
my_fun input.pyx /^cpdef np.ndarray[dtype=double, ndim=1] my_fun(np.ndarray[dtype=double, ndim=1] x):$/;" f signature:(np.ndarray[dtype=double, ndim=1] x)
np input.pyx /^cimport numpy as np$/;" i
np input.pyx /^import numpy as np$/;" i
11 changes: 11 additions & 0 deletions Units/cython_sample2.d/input.pyx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# -*- cython-mode -*-
# test code for cython functionality with complex datatypes

import numpy as np
cimport numpy as np

cpdef np.ndarray[dtype=double, ndim=1] my_fun(np.ndarray[dtype=double, ndim=1] x):
cdef np.ndarray[dtype=double, ndim=1, mode="c"] res

res = 2*x
return res

0 comments on commit b979ae5

Please sign in to comment.