mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-20 14:27:42 +00:00
ruff fixes
This commit is contained in:
@@ -84,7 +84,7 @@ def get_activity_ref_info(activity_name, ref_id):
|
||||
activity_ref.latitude = ll[0]
|
||||
activity_ref.longitude = ll[1]
|
||||
except Exception:
|
||||
logger.warning("Invalid lat/lon received for WAB/WAI reference")
|
||||
logger.warning("Invalid lat/lon received for WAB/WAI reference", exc_info=True)
|
||||
return activity_ref
|
||||
|
||||
elif activity_name.upper() == ActivityName.BOTA:
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
import logging
|
||||
import re
|
||||
from math import floor
|
||||
from math import floor, isnan
|
||||
|
||||
from pyproj import Transformer
|
||||
from shapely.geometry import Point, Polygon
|
||||
@@ -156,7 +156,7 @@ def lat_lon_for_grid_sw_corner_plus_size(grid):
|
||||
lat -= 90.0
|
||||
|
||||
# Return None values on maths errors
|
||||
if any(x != x for x in [lat, lon, lat_cell_size, lon_cell_size]):
|
||||
if any(isnan(x) for x in [lat, lon, lat_cell_size, lon_cell_size]):
|
||||
return None, None, None, None
|
||||
|
||||
return lat, lon, lat_cell_size, lon_cell_size
|
||||
|
||||
Reference in New Issue
Block a user