Skip to content

Commit

Permalink
Deprecate the geoplot function. (ResidentMario#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
ResidentMario committed Jul 9, 2019
1 parent 6391dc4 commit 5b99ad5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
19 changes: 18 additions & 1 deletion missingno/missingno.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,24 @@ def geoplot(df,
:param kwargs: Additional keyword arguments are passed to the underlying `geoplot` function.
:return: If `inline` is False, the underlying `matplotlib.figure` object. Else, nothing.
"""
import geoplot as gplt
warnings.warn(
"The 'geoplot' function has been deprecated, and will be removed in a future version "
"of missingno. The 'geoplot' package has an example recipe for a more full-featured "
"geospatial nullity plot: "
"https://residentmario.github.io/geoplot/gallery/plot_san_francisco_trees.html"
)
try:
import geoplot as gplt
except ImportError:
raise ImportError("Install geoplot <= 0.2.4 (the package) for geoplot function support")

if gplt.__version__ >= "0.3.0":
raise ImportError(
f"The missingno geoplot function requires geoplot package version 0.2.4 or lower, "
f"but version {gplt.__version__} is installed instead. To use the geoplot function, "
f"downgrade to an older version of the geoplot package."
)

import geopandas as gpd
from shapely.geometry import Point

Expand Down
2 changes: 1 addition & 1 deletion tests/viz_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def setUp(self):
self.x_y_df = simple_df

# @pytest.mark.mpl_image_compare
@pytest.xfail
@pytest.mark.xfail
def test_geoplot_quadtree(self):
msno.geoplot(self.x_y_df, x='r0', y='r1')
return plt.gcf()

0 comments on commit 5b99ad5

Please sign in to comment.