1## Tests are enabled even though Bokeh functionality is private for now, 2## in order to keep code coverage good. 3## Bokeh versions are not intended for release 4## but will be picked up later 5 6from libpysal.weights.contiguity import Queen 7from libpysal import examples 8import geopandas as gpd 9import esda 10import pytest 11 12from splot._bk import ( 13 plot_choropleth, 14 lisa_cluster, 15 moran_scatterplot, 16 plot_local_autocorrelation, 17) 18 19 20@pytest.mark.skip(reason="to be deprecated") 21def test_plot_choropleth(): 22 link = examples.get_path("columbus.shp") 23 df = gpd.read_file(link) 24 25 w = Queen.from_dataframe(df) 26 w.transform = "r" 27 28 TOOLS = "tap,help" 29 fig = plot_choropleth( 30 df, "HOVAL", title="columbus", reverse_colors=True, tools=TOOLS 31 ) 32 33 34@pytest.mark.skip(reason="to be deprecated") 35def test_lisa_cluster(): 36 link = examples.get_path("columbus.shp") 37 df = gpd.read_file(link) 38 39 y = df["HOVAL"].values 40 w = Queen.from_dataframe(df) 41 w.transform = "r" 42 43 moran_loc = esda.moran.Moran_Local(y, w) 44 45 TOOLS = "tap,reset,help" 46 fig = lisa_cluster(moran_loc, df, p=0.05, tools=TOOLS) 47 48 49@pytest.mark.skip(reason="to be deprecated") 50def test_moran_scatterplot(): 51 link = examples.get_path("columbus.shp") 52 df = gpd.read_file(link) 53 54 y = df["HOVAL"].values 55 w = Queen.from_dataframe(df) 56 w.transform = "r" 57 58 moran_loc = esda.moran.Moran_Local(y, w) 59 60 fig = moran_scatterplot(moran_loc, p=0.05) 61 62 63@pytest.mark.skip(reason="to be deprecated") 64def test_plot_local_autocorrelation(): 65 link = examples.get_path("columbus.shp") 66 df = gpd.read_file(link) 67 68 y = df["HOVAL"].values 69 w = Queen.from_dataframe(df) 70 w.transform = "r" 71 72 moran_loc = esda.moran.Moran_Local(y, w) 73 74 fig = plot_local_autocorrelation(moran_loc, df, "HOVAL") 75