Skip to content

Commit 7c68aba

Browse files
authored
Merge pull request #43 from phobson/py36-in-travis
add python 3.6 to travis
2 parents e08e80b + 7d742a4 commit 7c68aba

File tree

3 files changed

+26
-21
lines changed

3 files changed

+26
-21
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ matrix:
1414
- ARGS="--mpl --verbose"
1515
- python: 3.5
1616
env:
17-
- COVERAGE=false
17+
- COVERAGE=true
1818
- EXTRATESTERS=""
1919
- ARGS="--mpl --verbose"
20-
- python: 3.5
20+
- python: 3.6
2121
env:
22-
- COVERAGE=true
22+
- COVERAGE=false
2323
- EXTRATESTERS=""
2424
- ARGS="--mpl --verbose --pep8"
2525

check_probscale.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
import matplotlib
33
matplotlib.use('agg')
44

5+
from matplotlib.pyplot import style
6+
style.use('classic')
7+
58
import probscale
69
status = probscale.test(*sys.argv[1:])
710
sys.exit(status)

probscale/tests/test_viz.py

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@
1919
PY27 = sys.version_info.major == 2
2020
if PY27: # pragma: no cover
2121
import mock
22-
TOLERANCE = 15
22+
TIGHT_TOLERANCE = 15
23+
LOOSE_TOLERANCE = 18
2324
else:
2425
from unittest import mock
25-
TOLERANCE = 12
26+
TIGHT_TOLERANCE = 13
27+
LOOSE_TOLERANCE = 18
2628

2729

2830
BASELINE_DIR = 'baseline_images/test_viz'
@@ -513,23 +515,23 @@ def test__fit_ci(plot_data, fitlogs, known_lo, known_hi):
513515
nptest.assert_allclose(yhat_hi, known_hi, rtol=0.001)
514516

515517

516-
@pytest.mark.mpl_image_compare(baseline_dir=BASELINE_DIR, tolerance=TOLERANCE)
518+
@pytest.mark.mpl_image_compare(baseline_dir=BASELINE_DIR, tolerance=TIGHT_TOLERANCE)
517519
def test_probplot_prob(plot_data):
518520
fig, ax = plt.subplots()
519521
fig = viz.probplot(plot_data, ax=ax, problabel='Test xlabel', datascale='log')
520522
assert isinstance(fig, plt.Figure)
521523
return fig
522524

523525

524-
@pytest.mark.mpl_image_compare(baseline_dir=BASELINE_DIR, tolerance=TOLERANCE)
526+
@pytest.mark.mpl_image_compare(baseline_dir=BASELINE_DIR, tolerance=TIGHT_TOLERANCE)
525527
def test_probplot_qq(plot_data):
526528
fig, ax = plt.subplots()
527529
fig = viz.probplot(plot_data, ax=ax, plottype='qq', datalabel='Test label',
528530
datascale='log', scatter_kws=dict(color='r'))
529531
return fig
530532

531533

532-
@pytest.mark.mpl_image_compare(baseline_dir=BASELINE_DIR, tolerance=TOLERANCE)
534+
@pytest.mark.mpl_image_compare(baseline_dir=BASELINE_DIR, tolerance=TIGHT_TOLERANCE)
533535
@pytest.mark.skipif(stats is None, reason="no scipy")
534536
def test_probplot_qq_dist(plot_data):
535537
fig, ax = plt.subplots()
@@ -539,7 +541,7 @@ def test_probplot_qq_dist(plot_data):
539541
return fig
540542

541543

542-
@pytest.mark.mpl_image_compare(baseline_dir=BASELINE_DIR, tolerance=TOLERANCE)
544+
@pytest.mark.mpl_image_compare(baseline_dir=BASELINE_DIR, tolerance=TIGHT_TOLERANCE)
543545
def test_probplot_pp(plot_data):
544546
fig, ax = plt.subplots()
545547
scatter_kws = dict(color='b', linestyle='--', markeredgecolor='g', markerfacecolor='none')
@@ -549,7 +551,7 @@ def test_probplot_pp(plot_data):
549551
return fig
550552

551553

552-
@pytest.mark.mpl_image_compare(baseline_dir=BASELINE_DIR, tolerance=TOLERANCE)
554+
@pytest.mark.mpl_image_compare(baseline_dir=BASELINE_DIR, tolerance=TIGHT_TOLERANCE)
553555
def test_probplot_prob_bestfit(plot_data):
554556
fig, ax = plt.subplots()
555557
fig = viz.probplot(plot_data, ax=ax, datalabel='Test xlabel', bestfit=True,
@@ -558,7 +560,7 @@ def test_probplot_prob_bestfit(plot_data):
558560
return fig
559561

560562

561-
@pytest.mark.mpl_image_compare(baseline_dir=BASELINE_DIR, tolerance=TOLERANCE)
563+
@pytest.mark.mpl_image_compare(baseline_dir=BASELINE_DIR, tolerance=TIGHT_TOLERANCE)
562564
def test_probplot_qq_bestfit(plot_data):
563565
fig, ax = plt.subplots()
564566
fig = viz.probplot(plot_data, ax=ax, plottype='qq', bestfit=True,
@@ -567,7 +569,7 @@ def test_probplot_qq_bestfit(plot_data):
567569
return fig
568570

569571

570-
@pytest.mark.mpl_image_compare(baseline_dir=BASELINE_DIR, tolerance=TOLERANCE)
572+
@pytest.mark.mpl_image_compare(baseline_dir=BASELINE_DIR, tolerance=TIGHT_TOLERANCE)
571573
def test_probplot_pp_bestfit(plot_data):
572574
fig, ax = plt.subplots()
573575
scatter_kws = {'marker': 's', 'color': 'red'}
@@ -579,23 +581,23 @@ def test_probplot_pp_bestfit(plot_data):
579581
return fig
580582

581583

582-
@pytest.mark.mpl_image_compare(baseline_dir=BASELINE_DIR, tolerance=TOLERANCE)
584+
@pytest.mark.mpl_image_compare(baseline_dir=BASELINE_DIR, tolerance=TIGHT_TOLERANCE)
583585
def test_probplot_prob_probax_y(plot_data):
584586
fig, ax = plt.subplots()
585587
fig = viz.probplot(plot_data, ax=ax, datalabel='Test xlabel', datascale='log', probax='y')
586588
assert isinstance(fig, plt.Figure)
587589
return fig
588590

589591

590-
@pytest.mark.mpl_image_compare(baseline_dir=BASELINE_DIR, tolerance=TOLERANCE)
592+
@pytest.mark.mpl_image_compare(baseline_dir=BASELINE_DIR, tolerance=TIGHT_TOLERANCE)
591593
def test_probplot_qq_probax_y(plot_data):
592594
fig, ax = plt.subplots()
593595
fig = viz.probplot(plot_data, ax=ax, plottype='qq', problabel='Test label', probax='y',
594596
datascale='log', scatter_kws=dict(color='r'))
595597
return fig
596598

597599

598-
@pytest.mark.mpl_image_compare(baseline_dir=BASELINE_DIR, tolerance=TOLERANCE)
600+
@pytest.mark.mpl_image_compare(baseline_dir=BASELINE_DIR, tolerance=TIGHT_TOLERANCE)
599601
def test_probplot_pp_probax_y(plot_data):
600602
fig, ax = plt.subplots()
601603
scatter_kws = dict(color='b', linestyle='--', markeredgecolor='g', markerfacecolor='none')
@@ -604,7 +606,7 @@ def test_probplot_pp_probax_y(plot_data):
604606
return fig
605607

606608

607-
@pytest.mark.mpl_image_compare(baseline_dir=BASELINE_DIR, tolerance=TOLERANCE)
609+
@pytest.mark.mpl_image_compare(baseline_dir=BASELINE_DIR, tolerance=TIGHT_TOLERANCE)
608610
def test_probplot_prob_bestfit_probax_y(plot_data):
609611
fig, ax = plt.subplots()
610612
fig = viz.probplot(plot_data, ax=ax, datalabel='Test xlabel', bestfit=True,
@@ -613,15 +615,15 @@ def test_probplot_prob_bestfit_probax_y(plot_data):
613615
return fig
614616

615617

616-
@pytest.mark.mpl_image_compare(baseline_dir=BASELINE_DIR, tolerance=TOLERANCE)
618+
@pytest.mark.mpl_image_compare(baseline_dir=BASELINE_DIR, tolerance=TIGHT_TOLERANCE)
617619
def test_probplot_qq_bestfit_probax_y(plot_data):
618620
fig, ax = plt.subplots()
619621
fig = viz.probplot(plot_data, ax=ax, plottype='qq', bestfit=True, problabel='Test label',
620622
datascale='log', probax='y', estimate_ci=True)
621623
return fig
622624

623625

624-
@pytest.mark.mpl_image_compare(baseline_dir=BASELINE_DIR, tolerance=TOLERANCE)
626+
@pytest.mark.mpl_image_compare(baseline_dir=BASELINE_DIR, tolerance=TIGHT_TOLERANCE)
625627
def test_probplot_pp_bestfit_probax_y(plot_data):
626628
fig, ax = plt.subplots()
627629
scatter_kws = {'marker': 's', 'color': 'red'}
@@ -632,7 +634,7 @@ def test_probplot_pp_bestfit_probax_y(plot_data):
632634
return fig
633635

634636

635-
@pytest.mark.mpl_image_compare(baseline_dir=BASELINE_DIR, tolerance=TOLERANCE)
637+
@pytest.mark.mpl_image_compare(baseline_dir=BASELINE_DIR, tolerance=LOOSE_TOLERANCE)
636638
@pytest.mark.skipif(stats is None, reason="no scipy")
637639
def test_probplot_beta_dist_best_fit_y(plot_data):
638640
fig, (ax1, ax2) = plt.subplots(ncols=2)
@@ -650,7 +652,7 @@ def test_probplot_beta_dist_best_fit_y(plot_data):
650652
return fig
651653

652654

653-
@pytest.mark.mpl_image_compare(baseline_dir=BASELINE_DIR, tolerance=TOLERANCE)
655+
@pytest.mark.mpl_image_compare(baseline_dir=BASELINE_DIR, tolerance=TIGHT_TOLERANCE)
654656
@pytest.mark.skipif(stats is None, reason="no scipy")
655657
def test_probplot_beta_dist_best_fit_x(plot_data):
656658
fig, (ax1, ax2) = plt.subplots(nrows=2)
@@ -697,7 +699,7 @@ def test__set_prob_limits_x(probax, N, minval, maxval):
697699
ax.set_ylim.assert_called_once_with(bottom=minval, top=maxval)
698700

699701

700-
@pytest.mark.mpl_image_compare(baseline_dir=BASELINE_DIR, tolerance=TOLERANCE)
702+
@pytest.mark.mpl_image_compare(baseline_dir=BASELINE_DIR, tolerance=TIGHT_TOLERANCE)
701703
def test_probplot_color_and_label(plot_data):
702704
fig, ax = plt.subplots()
703705
fig = viz.probplot(plot_data, ax=ax, color='pink', label='A Top-Level Label')

0 commit comments

Comments
 (0)