From a6578a45a2038a76f67e40f6517f9beb3d578af2 Mon Sep 17 00:00:00 2001 From: iamtekson Date: Wed, 20 Sep 2023 11:14:20 -0600 Subject: [PATCH 1/2] new required changes to generate api docs --- docs/requirements-docs.txt | 1 + docs/source/geo.rst | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/requirements-docs.txt b/docs/requirements-docs.txt index 7c4c937..1a8a4c1 100644 --- a/docs/requirements-docs.txt +++ b/docs/requirements-docs.txt @@ -9,3 +9,4 @@ sphinxcontrib-openapi==0.7.0 geopandas seaborn requests +xmltodict diff --git a/docs/source/geo.rst b/docs/source/geo.rst index a763f07..f18a897 100644 --- a/docs/source/geo.rst +++ b/docs/source/geo.rst @@ -12,7 +12,7 @@ The ``Geoserver`` class The ``Style`` functions ----------------- +------------------------ .. automodule:: geo.Style :members: From 35d7c6844e9100c0d7b10bca6537b708f3e37f6c Mon Sep 17 00:00:00 2001 From: iamtekson Date: Wed, 20 Sep 2023 11:32:06 -0600 Subject: [PATCH 2/2] docstring format and auto generate docs --- geo/Geoserver.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/geo/Geoserver.py b/geo/Geoserver.py index d695068..2c33bdd 100644 --- a/geo/Geoserver.py +++ b/geo/Geoserver.py @@ -350,8 +350,7 @@ def create_coveragestore( file_type: str = "GeoTIFF", content_type: str = "image/tiff", ): - """ - Creates the coveragestore; Data will uploaded to the server. + """Creates the coveragestore; Data will uploaded to the server. Parameters ---------- @@ -367,6 +366,7 @@ def create_coveragestore( ----- the path to the file and file_type indicating it is a geotiff, arcgrid or other raster type """ + if path is None: raise Exception("You must provide the full path to the raster") @@ -1104,8 +1104,7 @@ def upload_style( workspace: Optional[str] = None, sld_version: str = "1.0.0", ): - """ - + """Uploads a style file to geoserver. Parameters ---------- path : str @@ -1169,7 +1168,7 @@ def create_coveragestyle( cmap_type: str = "ramp", number_of_classes: int = 5, ): - """ + """Dynamically create style for raster. Parameters ---------- @@ -1177,8 +1176,7 @@ def create_coveragestyle( style_name : str, optional workspace : str color_ramp : str - cmap_type : str - # TODO: This should be a set of the available options : {"ramp", "linear", ... } + cmap_type : str TODO: This should be a set of the available options : {"ramp", "linear", ... } number_of_classes : int overwrite : bool @@ -1188,6 +1186,7 @@ def create_coveragestyle( This function will dynamically create the style file for raster. Inputs: name of file, workspace, cmap_type (two options: values, range), ncolors: determines the number of class, min for minimum value of the raster, max for the max value of raster """ + raster = raster_value(raster_path) min_value = raster["min"] max_value = raster["max"] @@ -1697,6 +1696,7 @@ def create_datastore( ----- If you have PostGIS datastore, please use create_featurestore function """ + if workspace is None: workspace = "default" @@ -1754,6 +1754,7 @@ def create_shp_datastore( ----- The layer name will be assigned according to the shp name """ + if path is None: raise Exception("You must provide a full path to shapefile")