Skip to content

Commit

Permalink
Fix inplace in FC (#51)
Browse files Browse the repository at this point in the history
* Fix inplace in FC
  • Loading branch information
SakharovGeoalert committed Apr 2, 2024
1 parent 8d2c258 commit b6c050e
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
0.2.5:
=====
- All Feature and FeatureCollection methods now have inplace=False by default

0.2.4:
=====
- Synchronize library versions for correct installation via pip
Expand Down
2 changes: 1 addition & 1 deletion aeronet/__version__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
VERSION = (0, 2, 4)
VERSION = (0, 2, 5)

__version__ = '.'.join(map(str, VERSION))
2 changes: 1 addition & 1 deletion aeronet_convert/aeronet_convert/__version__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
VERSION = (0, 2, 4)
VERSION = (0, 2, 5)

__version__ = '.'.join(map(str, VERSION))
2 changes: 1 addition & 1 deletion aeronet_raster/aeronet_raster/__version__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
VERSION = (0, 2, 4)
VERSION = (0, 2, 5)

__version__ = '.'.join(map(str, VERSION))
2 changes: 1 addition & 1 deletion aeronet_vector/aeronet_vector/__version__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
VERSION = (0, 2, 4)
VERSION = (0, 2, 5)

__version__ = '.'.join(map(str, VERSION))
4 changes: 2 additions & 2 deletions aeronet_vector/aeronet_vector/feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def copy(self):
"""Returns a copy of feature"""
return Feature(shape(self.geometry), {k: v for k, v in self.properties.items()}, self.crs)

def simplify(self, tolerance: float, inplace: bool = True):
def simplify(self, tolerance: float, inplace: bool = False):
"""Simplifies geometry with Douglas-Pecker
Args:
tolerance (float): simplification tolerance
Expand All @@ -161,7 +161,7 @@ def simplify(self, tolerance: float, inplace: bool = True):
else:
return self.copy().simplify(tolerance, inplace=True)

def cast_property_to(self, key: str, new_type: type, inplace: bool = True):
def cast_property_to(self, key: str, new_type: type, inplace: bool = False):
"""Casts property to new type (e.g. str to int)
Args:
key (str): key of modified property
Expand Down
8 changes: 4 additions & 4 deletions aeronet_vector/aeronet_vector/featurecollection.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def _valid(features):
valid_features.append(f)
return valid_features

def apply(self, func: Callable, inplace: bool = True):
def apply(self, func: Callable, inplace: bool = False):
"""Applies function to collection geometries
Args:
func (Callable): function to apply
Expand All @@ -62,7 +62,7 @@ def apply(self, func: Callable, inplace: bool = True):
else:
return FeatureCollection([f.apply(func) for f in self.features], crs=self.crs)

def filter(self, func: Callable, inplace: bool = True):
def filter(self, func: Callable, inplace: bool = False):
"""Filters collection according to func
Args:
func (Callable): filtering function
Expand Down Expand Up @@ -280,7 +280,7 @@ def copy(self):
"""Returns a copy of collection"""
return FeatureCollection((f.copy() for f in self.features), crs=self.crs)

def simplify(self, tolerance: float, inplace: bool = True):
def simplify(self, tolerance: float, inplace: bool = False):
"""Simplifies geometries with Douglas-Pecker
Args:
tolerance (float): simplification tolerance
Expand All @@ -293,7 +293,7 @@ def simplify(self, tolerance: float, inplace: bool = True):
else:
return self.copy().simplify(tolerance, inplace=True)

def cast_property_to(self, key: str, new_type: type, inplace: bool = True):
def cast_property_to(self, key: str, new_type: type, inplace: bool = False):
"""Casts property to new type (e.g. str to int)
Args:
key (str): key of modified property
Expand Down

0 comments on commit b6c050e

Please sign in to comment.