From 180a686e141a0e0c22324f786a409b707ba43633 Mon Sep 17 00:00:00 2001 From: Thomas Grandjean Date: Thu, 6 Mar 2025 21:13:54 +0100 Subject: [PATCH 1/2] expose silent arg in get_geodata --- pynsee/geodata/get_geodata.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pynsee/geodata/get_geodata.py b/pynsee/geodata/get_geodata.py index 3ecf7692..61dd1097 100644 --- a/pynsee/geodata/get_geodata.py +++ b/pynsee/geodata/get_geodata.py @@ -13,6 +13,7 @@ def get_geodata( update: bool = False, crs: Any = "EPSG:3857", constrain_area: Optional[GeoDataFrame] = None, + silent: bool = False, ) -> GeoFrDataFrame: """Get geographical data with identifier and from IGN API @@ -25,6 +26,8 @@ def get_geodata( constrain_area (:class:`~geopandas.GeoDataFrame`, optional): GeoDataFrame used to constrain the area of interest. Defaults to None. + silence (bool, optional): whether to print warnings or not. Defaults to False. + .. versionchanged: 0.2.0 Changed `polygon` and `crsPolygon` into a `constrain_area` :class:`~geopandas.GeoDataFrame`. @@ -40,14 +43,14 @@ def get_geodata( """ polygon = None - crsPolygon = "EPSG:4326" + crs_polygon = "EPSG:4326" if constrain_area is not None: if constrain_area.crs.to_string() not in ("EPSG:3857", "EPSG:4326"): constrain_area = constrain_area.to_crs("EPSG:4326") polygon = constrain_area.union_all() - crsPolygon = constrain_area.crs.to_string() + crs_polygon = constrain_area.crs.to_string() return _get_geodata( dataset_id=dataset_id, @@ -55,5 +58,6 @@ def get_geodata( crs=crs, ignore_error=False, polygon=polygon, - crs_polygon=crsPolygon, + crs_polygon=crs_polygon, + silent=silent, ) From e23aa791a68547fa66af1851f1d80739c7b7f265 Mon Sep 17 00:00:00 2001 From: Thomas Grandjean Date: Sun, 9 Mar 2025 19:58:04 +0100 Subject: [PATCH 2/2] update docstring --- pynsee/geodata/get_geodata.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pynsee/geodata/get_geodata.py b/pynsee/geodata/get_geodata.py index 61dd1097..b978d6c5 100644 --- a/pynsee/geodata/get_geodata.py +++ b/pynsee/geodata/get_geodata.py @@ -32,6 +32,11 @@ def get_geodata( Changed `polygon` and `crsPolygon` into a `constrain_area` :class:`~geopandas.GeoDataFrame`. + .. versionchanged: 0.3.0 + + Added silent parameter. + + Examples: >>> from pynsee.geodata import get_geodata_list, get_geodata >>> #