Permalink
Browse files

updating tests

  • Loading branch information...
dfm committed Aug 9, 2018
1 parent 884a853 commit a3dd65b75d0d333622d4aad5c0e8753ebf1be716
Showing with 36 additions and 2 deletions.
  1. +1 −0 .gitignore
  2. +2 −2 .travis.yml
  3. BIN corner/tests/baseline_images/test_corner/basic.png
  4. BIN corner/tests/baseline_images/test_corner/color.png
  5. BIN corner/tests/baseline_images/test_corner/color_filled.png
  6. BIN corner/tests/baseline_images/test_corner/labels.png
  7. BIN corner/tests/baseline_images/test_corner/no_fill_contours.png
  8. BIN corner/tests/baseline_images/test_corner/overplot.png
  9. BIN corner/tests/baseline_images/test_corner/pandas.png
  10. BIN corner/tests/baseline_images/test_corner/quantiles.png
  11. BIN corner/tests/baseline_images/test_corner/reverse.png
  12. BIN corner/tests/baseline_images/test_corner/smooth1.png
  13. BIN corner/tests/baseline_images/test_corner/smooth1d.png
  14. BIN corner/tests/baseline_images/test_corner/smooth2.png
  15. BIN corner/tests/baseline_images/test_corner/tight.png
  16. BIN corner/tests/baseline_images/test_corner/titles1.png
  17. BIN corner/tests/baseline_images/test_corner/titles2.png
  18. BIN corner/tests/baseline_images/test_corner/top_ticks.png
  19. BIN corner/tests/baseline_images/test_corner/truths.png
  20. BIN corner/tests/baseline_images/test_hist2d/basic.png
  21. BIN corner/tests/baseline_images/test_hist2d/color.png
  22. BIN corner/tests/baseline_images/test_hist2d/cutoff.png
  23. BIN corner/tests/baseline_images/test_hist2d/cutoff2.png
  24. BIN corner/tests/baseline_images/test_hist2d/filled.png
  25. BIN corner/tests/baseline_images/test_hist2d/levels1.png
  26. BIN corner/tests/baseline_images/test_hist2d/levels2.png
  27. BIN corner/tests/baseline_images/test_hist2d/lowN.png
  28. BIN corner/tests/baseline_images/test_hist2d/lowNfilled.png
  29. BIN corner/tests/baseline_images/test_hist2d/lowNnofill.png
  30. BIN corner/tests/baseline_images/test_hist2d/philsplot.png
  31. BIN corner/tests/baseline_images/test_hist2d/smooth1.png
  32. BIN corner/tests/baseline_images/test_hist2d/smooth2.png
  33. +21 −0 corner/tests/test_corner.py
  34. +12 −0 corner/tests/test_hist2d.py
View
@@ -8,3 +8,4 @@ build
test_figures
.coverage
!corner/tests/baseline_images/*/*.png
.pytest_cache
View
@@ -18,7 +18,7 @@ install:
- conda update -q conda
- conda info -a
- conda create --yes -n test python=$PYTHON_VERSION matplotlib=$MATPLOTLIB_VERSION numpy scipy nose setuptools pandas
- conda create --yes -n test python=$PYTHON_VERSION matplotlib=$MATPLOTLIB_VERSION numpy scipy setuptools pandas pytest pytest-cov
- source activate test
- pip install coveralls
@@ -28,7 +28,7 @@ before_script: # configure a headless display to test plot generation
- sleep 3 # give xvfb some time to start
script:
- nosetests corner --with-coverage --cover-package=corner
- py.test -v --cov corner
after_success:
- coveralls
View
Binary file not shown.
View
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
View
Binary file not shown.
Binary file not shown.
View
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
@@ -32,68 +32,89 @@ def _run_corner(pandas=False, N=10000, seed=1234, ndim=3, factor=None,
def test_basic():
_run_corner()
@image_comparison(baseline_images=["labels"], extensions=["png"])
def test_labels():
_run_corner(labels=["a", "b", "c"])
@image_comparison(baseline_images=["quantiles"], extensions=["png"])
def test_quantiles():
_run_corner(quantiles=[0.16, 0.5, 0.84])
@image_comparison(baseline_images=["color"], extensions=["png"])
def test_color():
_run_corner(color="g")
@image_comparison(baseline_images=["color_filled"], extensions=["png"])
def test_color_filled():
_run_corner(color="g", fill_contours=True)
@image_comparison(baseline_images=["overplot"], extensions=["png"])
def test_overplot():
fig = _run_corner(color="g", fill_contours=True)
_run_corner(seed=15, color="b", fig=fig, fill_contours=True)
@image_comparison(baseline_images=["smooth1"], extensions=["png"])
def test_smooth1():
_run_corner(bins=50)
@image_comparison(baseline_images=["smooth2"], extensions=["png"])
def test_smooth2():
_run_corner(bins=50, smooth=1.0)
@image_comparison(baseline_images=["smooth1d"], extensions=["png"])
def test_smooth1d():
_run_corner(bins=50, smooth=1.0, smooth1d=1.0)
@image_comparison(baseline_images=["titles1"], extensions=["png"])
def test_titles1():
_run_corner(show_titles=True)
@image_comparison(baseline_images=["titles2"], extensions=["png"])
def test_titles2():
_run_corner(show_titles=True, title_fmt=None, labels=["a", "b", "c"])
@image_comparison(baseline_images=["top_ticks"], extensions=["png"])
def test_top_ticks():
_run_corner(top_ticks=True)
@image_comparison(baseline_images=["pandas"], extensions=["png"])
def test_pandas():
_run_corner(pandas=True)
@image_comparison(baseline_images=["truths"], extensions=["png"])
def test_truths():
_run_corner(truths=[0.0, None, 0.15])
@image_comparison(baseline_images=["no_fill_contours"], extensions=["png"])
def test_no_fill_contours():
_run_corner(no_fill_contours=True)
@image_comparison(baseline_images=["tight"], extensions=["png"])
def test_tight():
_run_corner(ret=True)
pl.tight_layout()
@image_comparison(baseline_images=["reverse"], extensions=["png"])
def test_reverse():
_run_corner(ndim=2, range=[(4, -4), (-5, 5)])
@image_comparison(baseline_images=["hist_bin_factor"], extensions=["png"])
def test_hist_bin_factor():
_run_corner(hist_bin_factor=4)
@@ -23,52 +23,64 @@ def _run_hist2d(nm, N=50000, seed=1234, **kwargs):
def test_cutoff():
_run_hist2d("cutoff", range=[(0, 4), (0, 2.5)])
@image_comparison(baseline_images=["cutoff2"], extensions=["png"])
def test_cutoff2():
_run_hist2d("cutoff2", range=[(-4, 4), (-0.1, 0.1)], N=100000,
fill_contours=True, smooth=1)
@image_comparison(baseline_images=["basic"], extensions=["png"])
def test_basic():
_run_hist2d("basic")
@image_comparison(baseline_images=["color"], extensions=["png"])
def test_color():
_run_hist2d("color", color="g")
@image_comparison(baseline_images=["levels1"], extensions=["png"])
def test_levels1():
_run_hist2d("levels1", levels=[0.68, 0.95])
@image_comparison(baseline_images=["levels2"], extensions=["png"])
def test_levels2():
_run_hist2d("levels2", levels=[0.5, 0.75])
@image_comparison(baseline_images=["filled"], extensions=["png"])
def test_filled():
_run_hist2d("filled", fill_contours=True)
@image_comparison(baseline_images=["smooth1"], extensions=["png"])
def test_smooth1():
_run_hist2d("smooth1", bins=50)
@image_comparison(baseline_images=["smooth2"], extensions=["png"])
def test_smooth2():
_run_hist2d("smooth2", bins=50, smooth=(1.0, 1.5))
@image_comparison(baseline_images=["philsplot"], extensions=["png"])
def test_philsplot():
_run_hist2d("philsplot", plot_datapoints=False, fill_contours=True,
levels=[0.68, 0.95], color="g", bins=50, smooth=1.)
@image_comparison(baseline_images=["lowN"], extensions=["png"])
def test_lowN():
_run_hist2d("lowN", N=20)
@image_comparison(baseline_images=["lowNfilled"], extensions=["png"])
def test_lowNfilled():
_run_hist2d("lowNfilled", N=20, fill_contours=True)
@image_comparison(baseline_images=["lowNnofill"], extensions=["png"])
def test_lowNnofill():
_run_hist2d("lowNnofill", N=20, no_fill_contours=True)

0 comments on commit a3dd65b

Please sign in to comment.