def test_pairwise_density_plot_not_numeric(artworks_df, artworks_summary): plt.cla() def mock_render(fig): assert False explorer = Explorer(artworks_summary, plot_renderer=mock_render) with pytest.raises(ValueError): explorer.pairwise_density_plot("Diameter (cm)", "Nationality")
def test_pairwise_density_plot(artworks_df, artworks_summary): plt.cla() def mock_render(fig): # currently pairwise_density_plot returns a plotly figure assert len(fig["data"]) == 1 data = fig["data"][0] assert data["type"] == "heatmap" explorer = Explorer(artworks_summary, plot_renderer=mock_render) explorer.pairwise_density_plot("Width (cm)", "Height (cm)")
def test_pairwise_density_plot(artworks_df, artworks_summary): plt.cla() def mock_render(fig): # currently pairwise_density_plot returns a plotly figure assert len(fig['data']) == 1 data = fig['data'][0] assert data['type'] == 'heatmap' explorer = Explorer(artworks_summary, plot_renderer=mock_render) explorer.pairwise_density_plot('Width (cm)', 'Height (cm)')
def test_pairwise_density_plot_both_categorical(artworks_df, artworks_summary): plt.cla() def mock_render(fig): # currently pairwise_density_plot returns a plotly figure assert len(fig["data"]) == 1 data = fig["data"][0] assert data["type"] == "heatmap" explorer = Explorer(artworks_summary, plot_renderer=mock_render) explorer.pairwise_density_plot("Nationality", "Gender")
def test_pairwise_density_plot_both_categorical(artworks_df, artworks_summary): plt.cla() def mock_render(fig): # currently pairwise_density_plot returns a plotly figure assert len(fig['data']) == 1 data = fig['data'][0] assert data['type'] == 'heatmap' explorer = Explorer(artworks_summary, plot_renderer=mock_render) explorer.pairwise_density_plot('Nationality', 'Gender')