Skip to content

Commit

Permalink
vector crop now inplace False by default
Browse files Browse the repository at this point in the history
  • Loading branch information
atedstone committed Jan 18, 2024
1 parent ca7a5fa commit 99d03a1
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions geoutils/vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ def __getitem__(self, key: gu.Raster | Vector | list[float] | tuple[float, ...]
"""

if isinstance(key, (gu.Raster, Vector)):
return self.crop(crop_geom=key, clip=False, inplace=False)
return self.crop(crop_geom=key, clip=False)
else:
return self._override_gdf_output(self.ds.__getitem__(key))

Expand Down Expand Up @@ -971,8 +971,8 @@ def crop(
crop_geom: gu.Raster | Vector | list[float] | tuple[float, ...],
clip: bool,
*,
inplace: Literal[True],
) -> None:
inplace: Literal[False] = ...,
) -> VectorType:
...

@overload
Expand All @@ -981,8 +981,8 @@ def crop(
crop_geom: gu.Raster | Vector | list[float] | tuple[float, ...],
clip: bool,
*,
inplace: Literal[False],
) -> VectorType:
inplace: Literal[True],
) -> None:
...

@overload
Expand All @@ -991,15 +991,16 @@ def crop(
crop_geom: gu.Raster | Vector | list[float] | tuple[float, ...],
clip: bool,
*,
inplace: bool = True,
inplace: bool = ...,
) -> VectorType | None:
...

def crop(
self: VectorType,
crop_geom: gu.Raster | Vector | list[float] | tuple[float, ...],
clip: bool = False,
inplace: bool = True,
*,
inplace: bool = False,
) -> VectorType | None:
"""
Crop the vector to given extent.
Expand Down

0 comments on commit 99d03a1

Please sign in to comment.