1
0
mirror of https://github.com/craigerl/aprsd.git synced 2024-11-24 08:58:49 -05:00

Cleanup test failures

This commit is contained in:
Hemna 2024-10-18 12:25:16 -04:00
parent c12c42b876
commit 14c0a699cb
3 changed files with 7 additions and 10 deletions

View File

@ -60,7 +60,6 @@ class PacketCollector:
except Exception as e:
LOG.error(f"Error in monitor {name} (tx): {e}")
def flush(self):
"""Call flush on the objects. This is used to flush out any data."""
for name in self.monitors:

View File

@ -101,7 +101,6 @@ def log(packet, tx: Optional[bool] = False, header: Optional[bool] = True) -> No
if header:
if tx:
via_color = "red"
# arrow = f"<{via_color}>-></{via_color}>"
arrow = f"<{via_color}>\u2192</{via_color}>"
logit.append(
f"<red>TX\u2191</red> "
@ -111,7 +110,6 @@ def log(packet, tx: Optional[bool] = False, header: Optional[bool] = True) -> No
)
else:
via_color = "fg #1AA730"
#arrow = f"<{via_color}>-></{via_color}>"
arrow = f"<{via_color}>\u2192</{via_color}>"
f"<{via_color}><-</{via_color}>"
logit.append(

View File

@ -175,18 +175,18 @@ def load_entry_points(group):
def calculate_initial_compass_bearing(start, end):
if (type(start) != tuple) or (type(end) != tuple):
if (type(start) != tuple) or (type(end) != tuple): # noqa: E721
raise TypeError("Only tuples are supported as arguments")
lat1 = math.radians(float(start[0]))
lat2 = math.radians(float(end[0]))
diffLong = math.radians(float(end[1]) - float(start[1]))
diff_long = math.radians(float(end[1]) - float(start[1]))
x = math.sin(diffLong) * math.cos(lat2)
x = math.sin(diff_long) * math.cos(lat2)
y = math.cos(lat1) * math.sin(lat2) - (
math.sin(lat1)
* math.cos(lat2) * math.cos(diffLong)
* math.cos(lat2) * math.cos(diff_long)
)
initial_bearing = math.atan2(x, y)
@ -202,17 +202,17 @@ def calculate_initial_compass_bearing(start, end):
def degrees_to_cardinal(bearing, full_string=False):
if full_string:
DIRECTIONS = [
directions = [
"North", "North-Northeast", "Northeast", "East-Northeast", "East", "East-Southeast",
"Southeast", "South-Southeast", "South", "South-Southwest", "Southwest", "West-Southwest",
"West", "West-Northwest", "Northwest", "North-Northwest", "North",
]
else:
DIRECTIONS = [
directions = [
"N", "NNE", "NE", "ENE", "E", "ESE",
"SE", "SSE", "S", "SSW", "SW", "WSW",
"W", "WNW", "NW", "NNW", "N",
]
cardinal = DIRECTIONS[round(bearing / 22.5)]
cardinal = directions[round(bearing / 22.5)]
return cardinal