diff --git a/docs/0_getting_started.rst b/docs/0_getting_started.rst index cac6b5b..293d53f 100644 --- a/docs/0_getting_started.rst +++ b/docs/0_getting_started.rst @@ -20,7 +20,7 @@ Installation with pip: Dependencies ------------ -(``python3.6+``),``numpy`` +(``python3.6+``), ``numpy`` diff --git a/docs/4_api.rst b/docs/4_api.rst index a786009..8a8f230 100644 --- a/docs/4_api.rst +++ b/docs/4_api.rst @@ -13,3 +13,12 @@ API documentation PolygonEnvironment ------------------ .. autoclass:: PolygonEnvironment + + +.. py:module:: extremitypathfinder.plotting + +PlottingEnvironment +------------------- +.. autoclass:: PlottingEnvironment + :members: store, prepare, find_shortest_path + :no-inherited-members: diff --git a/docs/requirements_docs.txt b/docs/requirements_docs.txt index cae37e9..aa19de0 100644 --- a/docs/requirements_docs.txt +++ b/docs/requirements_docs.txt @@ -2,3 +2,4 @@ # python3.6+ numpy>=1.16 sphinx_rtd_theme +matplotlib diff --git a/extremitypathfinder/plotting.py b/extremitypathfinder/plotting.py index 733f460..9cd6c0e 100644 --- a/extremitypathfinder/plotting.py +++ b/extremitypathfinder/plotting.py @@ -195,6 +195,9 @@ def draw_graph(map, graph): class PlottingEnvironment(PolygonEnvironment): + """Extends PolygonEnvironment. In addition to the base functionality it + plots graphs of the polygons, the visibility graph and the computed path. + Stores all graphs in the folder defined by plotting_dir parameter.""" def __init__(self, plotting_dir=PLOTTING_DIR): super().__init__() global PLOTTING_DIR @@ -203,14 +206,17 @@ def __init__(self, plotting_dir=PLOTTING_DIR): makedirs(plotting_dir) def store(self, *args, **kwargs): + """In addition to storing, also plots a graph of the input polygons.""" super().store(*args, **kwargs) draw_loaded_map(self) def prepare(self): + """Also draws a prepared map with the computed visibility graph.""" super().prepare() draw_prepared_map(self) def find_shortest_path(self, *args, **kwargs): + """Also draws the computed shortest path.""" # important to not delete the temp graph! for plotting vertex_path, distance = super().find_shortest_path( *args, free_space_after=False, **kwargs diff --git a/requirements.txt b/requirements.txt index 2549ae4..267f350 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ # basic dependencies: # python3.7+ numpy>=1.16 +matplotlib