Skip to content

Commit 3689ede

Browse files
update testing setup
1 parent 9e2dc46 commit 3689ede

File tree

4 files changed

+35
-32
lines changed

4 files changed

+35
-32
lines changed

diffeqpy/tests/__init__.py

Whitespace-only changes.

diffeqpy/tests/test_ode.py

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,31 @@ def f(u,p,t):
1717
sol2 = de.pysolve(prob)
1818
assert len(sol.t) == len(sol2.t)
1919

20-
def f(u,p,t):
21-
x, y, z = u
22-
sigma, rho, beta = p
23-
return [sigma * (y - x), x * (rho - z) - y, x * y - beta * z]
24-
25-
u0 = [1.0,0.0,0.0]
26-
tspan = (0., 100.)
27-
p = [10.0,28.0,8/3]
28-
prob = de.ODEProblem(f, u0, tspan, p)
29-
sol = de.pysolve(prob)
30-
31-
def f(du,u,p,t):
32-
x, y, z = u
33-
sigma, rho, beta = p
34-
du[0] = sigma * (y - x)
35-
du[1] = x * (rho - z) - y
36-
du[2] = x * y - beta * z
37-
38-
u0 = [1.0,0.0,0.0]
39-
tspan = (0., 100.)
40-
p = [10.0,28.0,2.66]
41-
prob = de.ODEProblem(f, u0, tspan, p)
42-
sol = de.pysolve(prob)
43-
44-
numba_f = numba.jit(f)
45-
prob = de.ODEProblem(numba_f, u0, tspan, p)
46-
sol = de.pysolve(prob)
20+
def test_lorenz_sol():
21+
def f(u,p,t):
22+
x, y, z = u
23+
sigma, rho, beta = p
24+
return [sigma * (y - x), x * (rho - z) - y, x * y - beta * z]
25+
26+
u0 = [1.0,0.0,0.0]
27+
tspan = (0., 100.)
28+
p = [10.0,28.0,8/3]
29+
prob = de.ODEProblem(f, u0, tspan, p)
30+
sol = de.pysolve(prob)
31+
32+
def f(du,u,p,t):
33+
x, y, z = u
34+
sigma, rho, beta = p
35+
du[0] = sigma * (y - x)
36+
du[1] = x * (rho - z) - y
37+
du[2] = x * y - beta * z
38+
39+
u0 = [1.0,0.0,0.0]
40+
tspan = (0., 100.)
41+
p = [10.0,28.0,2.66]
42+
prob = de.ODEProblem(f, u0, tspan, p)
43+
sol = de.pysolve(prob)
44+
45+
numba_f = numba.jit(f)
46+
prob = de.ODEProblem(numba_f, u0, tspan, p)
47+
sol2 = de.pysolve(prob)

setup.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[tool:pytest]
2+
norecursedirs = .* scripts build dist conda-recipe
3+
4+
# https://github.com/pytest-dev/pytest/issues/1445
5+
[easy_install]
6+
zip_ok = 0

setup.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@ def readme():
2121
author='Chris Rackauckas',
2222
author_email='[email protected]',
2323
license='MIT',
24-
packages=['diffeqpy'],
24+
packages=['diffeqpy','diffeqpy.tests'],
2525
install_requires=['julia'],
2626
include_package_data=True,
2727
zip_safe=False)
28-
29-
[pytest]
30-
python_files = test_*.py
31-
python_functions=test_*

0 commit comments

Comments
 (0)