From 8e53b9e53c3c42a2dda81e5abb1e405fdef15b44 Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Sat, 16 Mar 2024 12:52:57 +0100 Subject: [PATCH] DOC: add versionadded note to new functions or keywords for 2.1 (#2013) --- shapely/constructive.py | 8 +++++++- shapely/coordinates.py | 2 ++ shapely/creation.py | 7 +++++++ shapely/geometry/base.py | 2 ++ shapely/predicates.py | 4 ++++ 5 files changed, 22 insertions(+), 1 deletion(-) diff --git a/shapely/constructive.py b/shapely/constructive.py index b7141ff29..dbfd7b6a6 100644 --- a/shapely/constructive.py +++ b/shapely/constructive.py @@ -539,10 +539,14 @@ def make_valid(geometry, method="linework", keep_collapsed=True, **kwargs): method : {'linework', 'structure'}, default 'linework' Algorithm to use when repairing geometry. 'structure' requires GEOS >= 3.10. + + .. versionadded:: 2.1.0 keep_collapsed : bool, default True For the 'structure' method, True will keep components that have collapsed into a lower dimensionality. For example, a ring collapsing to a line, or a line collapsing to a point. Must be True for the 'linework' method. + + .. versionadded:: 2.1.0 **kwargs See :ref:`NumPy ufunc docs ` for other keyword arguments. @@ -1027,7 +1031,9 @@ def voronoi_polygons( ordered : bool or array_like, default False If set to True, polygons within the GeometryCollection will be ordered according to the order of the input vertices. Note that this may slow - down the computation. Requires GEOS >= 3.12.0 + down the computation. Requires GEOS >= 3.12.0. + + .. versionadded:: 2.1.0 **kwargs See :ref:`NumPy ufunc docs ` for other keyword arguments. diff --git a/shapely/coordinates.py b/shapely/coordinates.py index 03bd3ac97..f540be399 100644 --- a/shapely/coordinates.py +++ b/shapely/coordinates.py @@ -44,6 +44,8 @@ def transform( one-dimensional arrays (x, y and optional z) instead of a single two-dimensional array. + .. versionadded:: 2.1.0 + See Also -------- has_z : Returns a copy of a geometry array with a function applied to its diff --git a/shapely/creation.py b/shapely/creation.py index d8b3cb3d4..9d8d23324 100644 --- a/shapely/creation.py +++ b/shapely/creation.py @@ -71,6 +71,8 @@ def points( - 'error': if any NaN or Inf is detected in the coordinates, a ValueError is raised. This option ensures that the created geometries have all finite coordinate values. + + .. versionadded:: 2.1.0 out : ndarray, optional An array (with dtype object) to output the geometries into. **kwargs @@ -141,6 +143,8 @@ def linestrings( is raised. This option ensures that the created geometries have all finite coordinate values. + .. versionadded:: 2.1.0 + out : ndarray, optional An array (with dtype object) to output the geometries into. **kwargs @@ -210,6 +214,9 @@ def linearrings( - 'error': if any NaN or Inf is detected in the coordinates, a ValueError is raised. This option ensures that the created geometries have all finite coordinate values. + + .. versionadded:: 2.1.0 + out : ndarray, optional An array (with dtype object) to output the geometries into. **kwargs diff --git a/shapely/geometry/base.py b/shapely/geometry/base.py index 4f64b0381..f3d84a3fc 100644 --- a/shapely/geometry/base.py +++ b/shapely/geometry/base.py @@ -758,6 +758,8 @@ def equals_exact(self, other, tolerance=0.0, normalize=False): If True, normalize the two geometries so that the coordinates are in the same order. + .. versionadded:: 2.1.0 + Examples -------- >>> LineString( diff --git a/shapely/predicates.py b/shapely/predicates.py index 2b221e6a8..ab9314632 100644 --- a/shapely/predicates.py +++ b/shapely/predicates.py @@ -74,6 +74,8 @@ def has_z(geometry, **kwargs): def has_m(geometry, **kwargs): """Returns True if a geometry has M coordinates. + .. versionadded:: 2.1.0 + Parameters ---------- geometry : Geometry or array_like @@ -980,6 +982,8 @@ def equals_exact(a, b, tolerance=0.0, normalize=False, **kwargs): normalize : bool, optional (default: False) If True, normalize the two geometries so that the coordinates are in the same order. + + .. versionadded:: 2.1.0 **kwargs See :ref:`NumPy ufunc docs ` for other keyword arguments.