Skip to content

Commit

Permalink
Reformat HinetPy/utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman committed Jul 7, 2024
1 parent f01eb41 commit 6808e9b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions HinetPy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,7 @@ def point_inside_box(
return False
if minlongitude and longitude < minlongitude:
return False
if maxlongitude and longitude > maxlongitude:
return False
return True
return not (maxlongitude and longitude > maxlongitude)


def haversine(lat1: float, lon1: float, lat2: float, lon2: float) -> float:
Expand Down Expand Up @@ -164,9 +162,9 @@ def point_inside_circular(
True
"""
radius = haversine(lat1, lon1, lat2, lon2)
if (minradius and radius < minradius) or (maxradius and radius > maxradius):
return False
return True
return not (
(minradius and radius < minradius) or (maxradius and radius > maxradius)
)


def to_datetime(value: str | datetime | date) -> datetime:
Expand Down

0 comments on commit 6808e9b

Please sign in to comment.