[MRG] Make matplotlib optional (#190)

* Rename png files

* Convert plot to PlotMethods class and update docs

* Update test

* Update setup.py and docs

* Refactor PlotMethods

* Make matplotlib optional

* Raise ImportError in cli
This commit is contained in:
Vinayak Mehta
2018-11-02 23:16:03 +05:30
committed by GitHub
parent c0e9235164
commit db3f8c6897
15 changed files with 236 additions and 225 deletions

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

+6 -6
View File
@@ -16,15 +16,15 @@ testdir = os.path.join(testdir, "files")
def test_text_plot():
filename = os.path.join(testdir, "foo.pdf")
tables = camelot.read_pdf(filename)
return camelot.plot(tables[0], plot_type='text')
return camelot.plot(tables[0], kind='text')
@pytest.mark.mpl_image_compare(
baseline_dir="files/baseline_plots", remove_text=True)
def test_table_plot():
def test_grid_plot():
filename = os.path.join(testdir, "foo.pdf")
tables = camelot.read_pdf(filename)
return camelot.plot(tables[0], plot_type='table')
return camelot.plot(tables[0], kind='grid')
@pytest.mark.mpl_image_compare(
@@ -32,7 +32,7 @@ def test_table_plot():
def test_contour_plot():
filename = os.path.join(testdir, "foo.pdf")
tables = camelot.read_pdf(filename)
return camelot.plot(tables[0], plot_type='contour')
return camelot.plot(tables[0], kind='contour')
@pytest.mark.mpl_image_compare(
@@ -40,7 +40,7 @@ def test_contour_plot():
def test_line_plot():
filename = os.path.join(testdir, "foo.pdf")
tables = camelot.read_pdf(filename)
return camelot.plot(tables[0], plot_type='line')
return camelot.plot(tables[0], kind='line')
@pytest.mark.mpl_image_compare(
@@ -48,4 +48,4 @@ def test_line_plot():
def test_joint_plot():
filename = os.path.join(testdir, "foo.pdf")
tables = camelot.read_pdf(filename)
return camelot.plot(tables[0], plot_type='joint')
return camelot.plot(tables[0], kind='joint')