Skip to content

Commit 9e2dc46

Browse files
try testing
1 parent ee0a9a6 commit 9e2dc46

File tree

3 files changed

+50
-14
lines changed

3 files changed

+50
-14
lines changed

diffeqpy/tests/test_ode.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
import diffeqpy
22
de = diffeqpy.setup()
3+
import numba
34

4-
def f(u,p,t):
5-
return -u
5+
def test_ode_sol():
6+
def f(u,p,t):
7+
return -u
68

7-
u0 = 0.5
8-
tspan = (0., 1.)
9-
prob = de.ODEProblem(f, u0, tspan)
10-
sol = de.pysolve(prob)
9+
u0 = 0.5
10+
tspan = (0., 1.)
11+
prob = de.ODEProblem(f, u0, tspan)
12+
sol = de.pysolve(prob)
13+
assert len(sol.t) < 10
1114

12-
import numba
13-
numba_f = numba.jit(f)
14-
15-
prob = de.ODEProblem(numba_f, u0, tspan)
16-
sol = de.pysolve(prob)
15+
numba_f = numba.jit(f)
16+
prob = de.ODEProblem(numba_f, u0, tspan)
17+
sol2 = de.pysolve(prob)
18+
assert len(sol.t) == len(sol2.t)
1719

1820
def f(u,p,t):
1921
x, y, z = u

setup.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ def readme():
55
return f.read()
66

77
setup(name='diffeqpy',
8-
version='0.1',
8+
version='0.2',
99
description='Solving Differential Equations in Python',
1010
long_description=readme(),
1111
classifiers=[
@@ -23,7 +23,9 @@ def readme():
2323
license='MIT',
2424
packages=['diffeqpy'],
2525
install_requires=['julia'],
26-
test_suite='nose.collector',
27-
tests_require=['nose']
2826
include_package_data=True,
2927
zip_safe=False)
28+
29+
[pytest]
30+
python_files = test_*.py
31+
python_functions=test_*

travis.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
language: python
2+
os:
3+
- linux
4+
- osx
5+
python:
6+
- "2.7"
7+
- "3.7"
8+
notifications:
9+
email: false
10+
before_install:
11+
- mkdir -p ~/Downloads
12+
13+
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then curl -L https://julialang-s3.julialang.org/bin/linux/x64/0.6/julia-0.6.2-linux-x86_64.tar.gz -o "$HOME/Downloads/julia.tar.gz"; fi
14+
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then tar xzf "$HOME/Downloads/julia.tar.gz" -C "$HOME/Downloads"; fi
15+
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then cp -r "$(find "$HOME/Downloads" -maxdepth 2 -name "julia*" -type d | head -n 1)" "$HOME/julia"; fi
16+
17+
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then curl -L https://julialang-s3.julialang.org/bin/mac/x64/0.6/julia-0.6.2-mac64.dmg -o "$HOME/Downloads/julia.dmg"; fi
18+
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then hdiutil attach ~/Downloads/julia.dmg; fi
19+
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then cp -r /Volumes/Julia*/Julia*/Contents/Resources/julia $HOME/julia; fi
20+
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then hdiutil detach -force /Volumes/Julia*; fi
21+
22+
- rm -rf ~/Downloads/julia*
23+
- export PATH="$HOME/julia/bin:$PATH"
24+
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then export R_LD_LIBRARY_PATH="$(R RHOME)/lib:$HOME/julia/lib/julia"; fi
25+
26+
- julia -e 'Pkg.add("DiffEqPy")'
27+
- julia -e 'using DiffEqPy'
28+
29+
- pip install pytest pytest-cov
30+
- pip install julia
31+
script:
32+
- py.test

0 commit comments

Comments
 (0)