Skip to content

Commit

Permalink
switch to teek (#62)
Browse files Browse the repository at this point in the history
* switch to `teek`

* Fix code style issues with oitnb

Co-authored-by: Lint Action <[email protected]>
  • Loading branch information
zacharyburnett and lint-action authored Jun 5, 2021
1 parent 8e313a3 commit 663d299
Show file tree
Hide file tree
Showing 4 changed files with 161 additions and 162 deletions.
8 changes: 5 additions & 3 deletions packetraven/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,9 @@ def retrieve_packets(

if database is not None:
for packets in new_packets.values():
database.send(packets)
database.send(
packet for packet in packets if packet.source != database.location
)

updated_callsigns = sorted(updated_callsigns)
for callsign in updated_callsigns:
Expand All @@ -494,7 +496,7 @@ def retrieve_packets(
f'{coordinate:.3f}°' for coordinate in packet_track.coordinates[-1, :2]
)
logger.info(
f'{callsign:8} - packet #{len(packet_track):<3} - ({coordinate_string}, {packet_track.coordinates[-1, 2]:9.2f}m)'
f'{callsign:9} - packet #{len(packet_track):<3} - ({coordinate_string}, {packet_track.coordinates[-1, 2]:9.2f}m)'
f'; packet time is {packet_time} ({humanize.naturaltime(current_time - packet_time)}, {packet_track.intervals[-1]:6.1f} s interval)'
f'; traveled {packet_track.overground_distances[-1]:6.1f} m ({packet_track.ground_speeds[-1]:5.1f} m/s) over the ground'
f', and {packet_track.ascents[-1]:6.1f} m ({packet_track.ascent_rates[-1]:5.1f} m/s) vertically, since the previous packet'
Expand All @@ -510,7 +512,7 @@ def retrieve_packets(
)
try:
message = (
f'{callsign:8} - '
f'{callsign:9} - '
f'altitude: {packet_track.altitudes[-1]:6.1f} m'
f'; avg. ascent rate: {numpy.mean(packet_track.ascent_rates[packet_track.ascent_rates > 0]):5.1f} m/s'
f'; avg. descent rate: {numpy.mean(packet_track.ascent_rates[packet_track.ascent_rates < 0]):5.1f} m/s'
Expand Down
2 changes: 1 addition & 1 deletion packetraven/connections/internet.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def insert(self, packets: [APRSPacket]):
for packet in packets:
if packet.crs != self.crs:
packet.transform_to(self.crs)
records = [self.__packet_record(packet) for packet in packets]
records = [self.__packet_record(packet) for packet in packets if packet not in self]
PostGresTable.insert(self, records)

def __contains__(self, packet: LocationPacket) -> bool:
Expand Down
Loading

0 comments on commit 663d299

Please sign in to comment.