Skip to content

Commit

Permalink
Align difference doc with 88 character flake settings
Browse files Browse the repository at this point in the history
  • Loading branch information
theroggy committed Aug 7, 2023
1 parent 2442f11 commit d3014af
Showing 1 changed file with 20 additions and 21 deletions.
41 changes: 20 additions & 21 deletions shapely/set_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,29 @@
def difference(a, b, grid_size=None, **kwargs):
"""Returns the part of geometry A that does not intersect with geometry B.
If grid_size is nonzero, input coordinates will be snapped to a precision
grid of that size and resulting coordinates will be snapped to that same
grid. If 0, this operation will use double precision coordinates. If None,
the highest precision of the inputs will be used, which may be previously
set using set_precision. Note: returned geometry does not have precision
set unless specified previously by set_precision.
If grid_size is nonzero, input coordinates will be snapped to a precision grid of
that size and resulting coordinates will be snapped to that same grid. If 0, this
operation will use double precision coordinates. If None, the highest precision of
the inputs will be used, which may be previously set using set_precision. Note:
returned geometry does not have precision set unless specified previously by
set_precision.
Especially for larger geometries, running difference between geometries
that don't intersect can take significantly longer than checking for this
first using :meth:`~intersects`.
Especially for larger geometries, running difference between geometries that don't
intersect can take significantly longer than checking for this first using
:meth:`~intersects`.
The values returned depend on the input geometries:
- If a and b are single geometries, a single geometry is returned: a
differenced with b.
- If a is a single geometry and b is arraylike, an array of length b is
returned. Each element contains geometry a differenced with the
corresponding element in b.
- If a is arraylike and b a single geometry, an array of length a is
returned. Each element contains the corresponding geometry in array a
differenced with geometry b.
- If both a and b are arraylike, they should be the same length or a
ValueError is raised. An array of this length is returned and each
element contains the difference between the corresponding element in
array a and array b.
- If a and b are single geometries, a single geometry is returned: a differenced
with b.
- If a is a single geometry and b is arraylike, an array of length b is returned.
Each element contains geometry a differenced with the corresponding element in
input array b.
- If a is arraylike and b a single geometry, an array of length a is returned.
Each element contains the corresponding geometry in array a differenced with
geometry b.
- If both a and b are arraylike, they should be the same length or a ValueError is
raised. An array of this length is returned and each element contains the
difference between the corresponding element in array a and array b.
Parameters
----------
Expand Down

0 comments on commit d3014af

Please sign in to comment.