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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
cython
Commits
27ec276b
Commit
27ec276b
authored
Oct 21, 2017
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix test output of Pythran test and give a better name to a test function.
parent
b67bfd5c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
tests/run/numpy_pythran.pyx
tests/run/numpy_pythran.pyx
+5
-4
No files found.
tests/run/numpy_pythran.pyx
View file @
27ec276b
...
@@ -5,9 +5,9 @@
...
@@ -5,9 +5,9 @@
import
numpy
as
np
import
numpy
as
np
cimport
numpy
as
cnp
cimport
numpy
as
cnp
def
test
():
def
diffuse
():
"""
"""
>>> u =
test
()
>>> u =
diffuse
()
>>> count_non_zero = np.sum(u > 0)
>>> count_non_zero = np.sum(u > 0)
>>> 15000 < count_non_zero < (2**7) * (2**7) or count_non_zero
>>> 15000 < count_non_zero < (2**7) * (2**7) or count_non_zero
True
True
...
@@ -15,11 +15,11 @@ def test():
...
@@ -15,11 +15,11 @@ def test():
lx
,
ly
=
(
2
**
7
,
2
**
7
)
lx
,
ly
=
(
2
**
7
,
2
**
7
)
u
=
np
.
zeros
([
lx
,
ly
],
dtype
=
np
.
double
)
u
=
np
.
zeros
([
lx
,
ly
],
dtype
=
np
.
double
)
u
[
lx
//
2
,
ly
//
2
]
=
1000.0
u
[
lx
//
2
,
ly
//
2
]
=
1000.0
diffuse_numpy
(
u
,
500
)
_
diffuse_numpy
(
u
,
500
)
return
u
return
u
def
diffuse_numpy
(
cnp
.
ndarray
[
double
,
ndim
=
2
]
u
,
int
N
):
def
_
diffuse_numpy
(
cnp
.
ndarray
[
double
,
ndim
=
2
]
u
,
int
N
):
"""
"""
Apply Numpy matrix for the Forward-Euler Approximation
Apply Numpy matrix for the Forward-Euler Approximation
"""
"""
...
@@ -41,6 +41,7 @@ def calculate_tax(cnp.ndarray[double, ndim=1] d):
...
@@ -41,6 +41,7 @@ def calculate_tax(cnp.ndarray[double, ndim=1] d):
>>> d = np.random.lognormal(mu, sigma, 10000)
>>> d = np.random.lognormal(mu, sigma, 10000)
>>> avg = calculate_tax(d)
>>> avg = calculate_tax(d)
>>> 0.243 < avg < 0.244 or avg # 0.24342652180085891
>>> 0.243 < avg < 0.244 or avg # 0.24342652180085891
True
"""
"""
tax_seg1
=
d
[(
d
>
256303
)]
*
0.45
-
16164.53
tax_seg1
=
d
[(
d
>
256303
)]
*
0.45
-
16164.53
tax_seg2
=
d
[(
d
>
54057
)
&
(
d
<=
256303
)]
*
0.42
-
8475.44
tax_seg2
=
d
[(
d
>
54057
)
&
(
d
<=
256303
)]
*
0.42
-
8475.44
...
...
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