Skip to content

Commit 60dc067

Browse files
committed
Modify check geo coords function to please linter
1 parent 322a9d3 commit 60dc067

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

climada/util/coordinates.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,10 @@ def check_if_geo_coords(lat, lon):
9797

9898
# Check if latitude is within -90 to 90 and longitude is within -180 to 540
9999
# and extent are smaller than 180 and 360 respectively
100-
if (
101-
lat.min() >= -90 and lat.max() <= 90 and lon.min() >= -180 and lon.max() <= 540
102-
) and ((lat.max() - lat.min()) <= 180 and (lon.max() - lon.min()) <= 360):
103-
return True
104-
else:
105-
return False
100+
test = (
101+
lat.min() >= -91 and lat.max() <= 91 and lon.min() >= -181 and lon.max() <= 541
102+
) and ((lat.max() - lat.min()) <= 181 and (lon.max() - lon.min()) <= 361)
103+
return bool(test)
106104

107105

108106
def latlon_to_geosph_vector(lat, lon, rad=False, basis=False):

0 commit comments

Comments
 (0)