Skip to content

Commit

Permalink
fix(test): add missing tests for plot of pca
Browse files Browse the repository at this point in the history
  • Loading branch information
axelfahy committed Apr 8, 2020
1 parent f8f262c commit 171d093
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Binary file modified tests/baseline/test_plot_pca_explained_variance_ratio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 11 additions & 1 deletion tests/test_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def test_plot_pca_explained_variance_ratio(self):
"""
pca = PCA(n_components=30)
pca.fit(np.random.randint(0, 100, size=(1000, 60)))
ax = bplt.plot_pca_explained_variance_ratio(pca)
ax = bplt.plot_pca_explained_variance_ratio(pca, grid='y')
return ax.figure

@pytest.mark.mpl_image_compare
Expand All @@ -324,6 +324,16 @@ def test_plot_pca_explained_variance_ratio_with_hline(self):
ax = bplt.plot_pca_explained_variance_ratio(pca, title='PCA with hline option', hline=0.55)
return ax.figure

@pytest.mark.mpl_image_compare
def test_plot_pca_explained_variance_ratio_with_limits(self):
"""
Test of the `plot_pca_explained_variance_ratio` function.
"""
pca = PCA(n_components=30)
pca.fit(np.random.randint(0, 100, size=(1000, 60)))
ax = bplt.plot_pca_explained_variance_ratio(pca, lim_x=(0, 20), lim_y=(0, 0.5))
return ax.figure

def test_plot_pie(self):
"""
Test of the `plot_pie` function.
Expand Down

0 comments on commit 171d093

Please sign in to comment.