Exemplo n.º 1
0
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")
Exemplo n.º 2
0
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)")
Exemplo n.º 3
0
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)')
Exemplo n.º 4
0
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")
Exemplo n.º 5
0
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')