From cfe0227ca67e4ce551655d54dbee03de724d7969 Mon Sep 17 00:00:00 2001 From: Felix Pankratz Date: Fri, 25 Jul 2025 19:50:10 +0200 Subject: [PATCH] cleanup --- kglobe.py | 10 +++------- terminalplotter.py | 3 --- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/kglobe.py b/kglobe.py index a4577ce..38799c1 100644 --- a/kglobe.py +++ b/kglobe.py @@ -7,21 +7,16 @@ import numpy as np import math import subprocess import re -import requests import argparse import asyncio -import os import IP2Location from datetime import timezone, datetime from terminalplotter import TerminalPlotter -# TODO: Color arches based on latency +# DONE: Color arches based on latency # TODO: Text info (num hops etc.) # TODO: Mouse support -# DONE: Interactive globe (spin w/ keys) -# DONE: Image spacing -# DONE: Async rendering? EXAMPLE_ROUTE = [ (47.996, 7.849), # freiburg @@ -33,8 +28,8 @@ EXAMPLE_ROUTE = [ ] -# Convert lat/lon to Cartesian coordinates def latlon_to_xyz(lat: float, lon: float, radius=1.0): + '''Convert lat/lon to Cartesian coordinates''' lat_rad = np.radians(lat) lon_rad = np.radians(lon) x = radius * np.cos(lat_rad) * np.cos(lon_rad) @@ -71,6 +66,7 @@ def generate_arch(p1, p2, height_factor=0.2, n_points=100): def traceroute(target: str): + '''Run traceroute and look up the coordinates in geo database''' database = IP2Location.IP2Location("IP2LOCATION-LITE-DB5.BIN", "SHARED_MEMORY") # Run traceroute command diff --git a/terminalplotter.py b/terminalplotter.py index 88c6dd9..bc2afe5 100644 --- a/terminalplotter.py +++ b/terminalplotter.py @@ -6,9 +6,6 @@ import termios import tty import vtk from vtk.util import numpy_support -import numpy as np -from io import BytesIO -from PIL import Image import pyvista as pv