Skip to content

Commit

Permalink
Replace explicit test with a try/except
Browse files Browse the repository at this point in the history
  • Loading branch information
mraspaud committed Oct 8, 2019
1 parent 304322a commit 0687994
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pyresample/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -700,9 +700,10 @@ def _compute_uniform_shape(self):
g = Geod(ellps='WGS84')

def notnull(arr):
if isinstance(arr, DataArray):
try:
return arr.where(arr.notnull(), drop=True)
return arr[np.isfinite(arr)]
except AttributeError:
return arr[np.isfinite(arr)]

leftlons = notnull(self.lons[:, 0])
rightlons = notnull(self.lons[:, -1])
Expand Down

0 comments on commit 0687994

Please sign in to comment.