Skip to content

Commit 7638d01

Browse files
authored
Merge pull request #19 from rflamary/pytest
Pytest with 89% coverage Fixes #19
2 parents 1cf304c + 838550e commit 7638d01

35 files changed

+632
-92
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,6 @@ ENV/
100100

101101
# Mac stuff
102102
.DS_Store
103+
104+
# coverage output folder
105+
cov_html/

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ matrix:
1313
python: 2.7
1414
before_install:
1515
- ./.travis/before_install.sh
16+
before_script: # configure a headless display to test plot generation
17+
- "export DISPLAY=:99.0"
18+
- "sh -e /etc/init.d/xvfb start"
19+
- sleep 3 # give xvfb some time to start
1620
# command to install dependencies
1721
install:
1822
- pip install -r requirements.txt

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ pep8 :
3838
flake8 examples/ ot/ test/
3939

4040
test : FORCE pep8
41-
python -m py.test -v test/
41+
python -m py.test -v test/ --cov=ot --cov-report html:cov_html
4242

4343
pytest : FORCE
44-
python -m py.test -v test/
44+
python -m py.test -v test/ --cov=ot
4545

4646
uploadpypi :
4747
#python setup.py register

examples/plot_OTDA_2D.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
77
"""
88

9+
# Author: Remi Flamary <[email protected]>
10+
#
11+
# License: MIT License
12+
913
import numpy as np
1014
import matplotlib.pylab as pl
1115
import ot

examples/plot_OTDA_classes.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
77
"""
88

9+
# Author: Remi Flamary <[email protected]>
10+
#
11+
# License: MIT License
12+
913
import matplotlib.pylab as pl
1014
import ot
1115

examples/plot_OTDA_color_images.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
SIAM Journal on Imaging Sciences, 7(3), 1853-1882.
1010
"""
1111

12+
# Author: Remi Flamary <[email protected]>
13+
#
14+
# License: MIT License
15+
1216
import numpy as np
1317
from scipy import ndimage
1418
import matplotlib.pylab as pl

examples/plot_OTDA_mapping.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
Neural Information Processing Systems (NIPS), 2016.
1010
"""
1111

12+
# Author: Remi Flamary <[email protected]>
13+
#
14+
# License: MIT License
15+
1216
import numpy as np
1317
import matplotlib.pylab as pl
1418
import ot

examples/plot_OTDA_mapping_color_images.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
1212
"""
1313

14+
# Author: Remi Flamary <[email protected]>
15+
#
16+
# License: MIT License
17+
1418
import numpy as np
1519
from scipy import ndimage
1620
import matplotlib.pylab as pl

examples/plot_OT_1D.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44
1D optimal transport
55
====================
66
7-
@author: rflamary
87
"""
98

9+
# Author: Remi Flamary <[email protected]>
10+
#
11+
# License: MIT License
12+
1013
import numpy as np
1114
import matplotlib.pylab as pl
1215
import ot

examples/plot_OT_2D_samples.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44
2D Optimal transport between empirical distributions
55
====================================================
66
7-
@author: rflamary
87
"""
98

9+
# Author: Remi Flamary <[email protected]>
10+
#
11+
# License: MIT License
12+
1013
import numpy as np
1114
import matplotlib.pylab as pl
1215
import ot

0 commit comments

Comments
 (0)