Пример #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")
Пример #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)")
Пример #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)')
Пример #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")
Пример #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')