コード例 #1
0
def test_param_extent_proj():
    # invalid extent: raise
    with pytest.raises(ValueError):
        pointplot(p_df, extent=(-181, 0, 1, 1))
    with pytest.raises(ValueError):
        pointplot(p_df, extent=(0, -91, 1, 1))
    with pytest.raises(ValueError):
        pointplot(p_df, extent=(0, 0, 181, 1))
    with pytest.raises(ValueError):
        pointplot(p_df, extent=(0, 0, 1, 91))

    # valid extent: set
    return pointplot(
        p_df, hue='var', linewidth= 0, s=10, extent=(-10, -10, 10, 10),
        projection=AlbersEqualArea()
    ).get_figure()
コード例 #2
0
@pytest.mark.mpl_image_compare
@pytest.mark.parametrize("kwargs", [
    {'scale': 'var', 'linewidth': 0, 'limits': (5, 10)},
    {'scale': 'var', 'linewidth': 0, 'limits': (5, 10), 'scale_func': identity_scale}
])
def test_scale_params(kwargs):
    return pointplot(p_df, **kwargs).get_figure()


@pytest.mark.mpl_image_compare
@pytest.mark.parametrize("kwargs", [
    {'clip': clip_geom, 'edgecolor': 'white', 'facecolor': 'lightgray'},
    {'clip': non_clip_geom, 'edgecolor': 'white', 'facecolor': 'lightgray'},
    {'clip': clip_geom, 'edgecolor': 'white', 'facecolor': 'lightgray',
     'projection': AlbersEqualArea()},
    {'clip': non_clip_geom, 'edgecolor': 'white', 'facecolor': 'lightgray',
     'projection': AlbersEqualArea()}
])
def test_clip_params_geometric(kwargs):
    return voronoi(p_df, **kwargs).get_figure()


# xfail due to seaborn#1773
@pytest.mark.mpl_image_compare
@pytest.mark.parametrize("kwargs", [
    pytest.param({'clip': clip_geom}, marks=pytest.mark.xfail),
    pytest.param({'clip': non_clip_geom}, marks=pytest.mark.xfail),
    pytest.param({'clip': clip_geom, 'projection': AlbersEqualArea()}, marks=pytest.mark.xfail),
    pytest.param({'clip': non_clip_geom, 'projection': AlbersEqualArea()}, marks=pytest.mark.xfail)
])
コード例 #3
0

@pytest.mark.mpl_image_compare
@pytest.mark.parametrize("kwargs", [{
    'clip': clip_geom,
    'edgecolor': 'white',
    'facecolor': 'lightgray'
}, {
    'clip': non_clip_geom,
    'edgecolor': 'white',
    'facecolor': 'lightgray'
}, {
    'clip': clip_geom,
    'edgecolor': 'white',
    'facecolor': 'lightgray',
    'projection': AlbersEqualArea()
}, {
    'clip': non_clip_geom,
    'edgecolor': 'white',
    'facecolor': 'lightgray',
    'projection': AlbersEqualArea()
}])
def test_clip_params_geometric(kwargs):
    return voronoi(p_df, **kwargs).get_figure()


# xfail due to seaborn#1773
@pytest.mark.mpl_image_compare
@pytest.mark.parametrize("kwargs", [
    pytest.param({'clip': clip_geom}, marks=pytest.mark.xfail),
    pytest.param({'clip': non_clip_geom}, marks=pytest.mark.xfail),