Skip to content

Commit

Permalink
Merge pull request #194 from geopandas/clean/add-kwarg-null-value
Browse files Browse the repository at this point in the history
Always use kwargs when calling _series_unary_op()
  • Loading branch information
kjordahl committed Apr 30, 2015
2 parents 45748f6 + bc3dc90 commit 6163bc9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions geopandas/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ def _invalidate_sindex(self):
@property
def area(self):
"""Return the area of each geometry in the GeoSeries"""
return _series_unary_op(self, 'area', np.nan)
return _series_unary_op(self, 'area', null_value=np.nan)

@property
def geom_type(self):
"""Return the geometry type of each geometry in the GeoSeries"""
return _series_unary_op(self, 'geom_type', None)
return _series_unary_op(self, 'geom_type', null_value=None)

@property
def type(self):
Expand All @@ -110,22 +110,22 @@ def type(self):
@property
def length(self):
"""Return the length of each geometry in the GeoSeries"""
return _series_unary_op(self, 'length', np.nan)
return _series_unary_op(self, 'length', null_value=np.nan)

@property
def is_valid(self):
"""Return True for each valid geometry, else False"""
return _series_unary_op(self, 'is_valid')
return _series_unary_op(self, 'is_valid', null_value=False)

@property
def is_empty(self):
"""Return True for each empty geometry, False for non-empty"""
return _series_unary_op(self, 'is_empty')
return _series_unary_op(self, 'is_empty', null_value=False)

@property
def is_simple(self):
"""Return True for each simple geometry, else False"""
return _series_unary_op(self, 'is_simple', False)
return _series_unary_op(self, 'is_simple', null_value=False)

@property
def is_ring(self):
Expand Down Expand Up @@ -168,7 +168,7 @@ def exterior(self):
def interiors(self):
"""Return the interior rings of each polygon"""
# TODO: return empty list or None for non-polygons
return _series_unary_op(self, 'interiors')
return _series_unary_op(self, 'interiors', null_value=False)

def representative_point(self):
"""Return a GeoSeries of points guaranteed to be in each geometry"""
Expand Down

0 comments on commit 6163bc9

Please sign in to comment.