Skip to content

Commit

Permalink
Removed IPython dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
marceloprates committed Oct 1, 2021
1 parent e8ecfe5 commit 7d60660
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 33 deletions.
32 changes: 0 additions & 32 deletions prettymaps/draw.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,42 +34,10 @@
from shapely.affinity import translate, scale, rotate
from descartes import PolygonPatch
from tabulate import tabulate
from IPython.display import Markdown, display

from .fetch import get_perimeter, get_layer


# Helper functions
def get_hash(key):
return frozenset(key.items()) if type(key) == dict else key


# Drawing functions
def show_palette(palette, description=""):
"""
Helper to display palette in Markdown
"""

colorboxes = [
f"![](https://placehold.it/30x30/{c[1:]}/{c[1:]}?text=)" for c in palette
]

display(Markdown((description)))
display(Markdown(tabulate(pd.DataFrame(colorboxes), showindex=False)))


def get_patch(shape, **kwargs):
"""
Convert shapely object to matplotlib patch
"""
# if type(shape) == Path:
# return patches.PathPatch(shape, **kwargs)
if type(shape) == Polygon and shape.area > 0:
return PolygonPatch(list(zip(*shape.exterior.xy)), **kwargs)
else:
return None


# Plot a single shape
def plot_shape(shape, ax, vsketch=None, **kwargs):
"""
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
osmnx==1.0.1
tabulate==0.8.9
IPython==7.27.0
#vsketch==1.0.0

0 comments on commit 7d60660

Please sign in to comment.