From c3c18b1c8550ef946bb5da24b2440d06291c75b3 Mon Sep 17 00:00:00 2001 From: Jean-Pierre Martineau Date: Sun, 4 Oct 2026 17:16:08 -0400 Subject: [PATCH] Formatting for the map's memory budget and its tests Co-Authored-By: Claude Opus 5.5 (1M context) --- meshterm/services/basemap.py | 1 + tests/test_map.py | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/meshterm/services/basemap.py b/meshterm/services/basemap.py index 640c2c5..6e0ff16 100644 --- a/meshterm/services/basemap.py +++ b/meshterm/services/basemap.py @@ -124,6 +124,7 @@ def _memo_budget() -> int: return _MEMO_CEILING return max(_MEMO_FLOOR, min(_MEMO_CEILING, physical // _MEMO_SHARE)) + #: How long a failed TileJSON resolve stands before the source will ask again. The PicoCalc #: brings its Wi-Fi up some 40 seconds into the boot, well after the app it was started #: alongside can reach the menu — so "offline" asked once at open is a verdict on the diff --git a/tests/test_map.py b/tests/test_map.py index e7d2bb5..ef13a9a 100644 --- a/tests/test_map.py +++ b/tests/test_map.py @@ -243,10 +243,7 @@ def test_polygon_fill_lights_exactly_the_dots_a_scan_of_every_edge_would() -> No def reference(canvas: MapCanvas, rings, stipple: int) -> None: edges = [ - (x0, y0, x1, y1) - for ring in rings - for (x0, y0), (x1, y1) in pairwise(ring) - if y0 != y1 + (x0, y0, x1, y1) for ring in rings for (x0, y0), (x1, y1) in pairwise(ring) if y0 != y1 ] for y in range(0, canvas.dot_h, stipple): yc = y + 0.5 @@ -1288,7 +1285,9 @@ def test_basemap_source_holds_decoded_tiles_to_a_byte_budget(tmp_path: Path) -> tile = decode_tile(_FIXTURE.read_bytes()) one = resident_bytes(tile) - src = BasemapSource(tmp_path / "cache", tilejson_url="http://127.0.0.1:1/none", memo_bytes=one * 5 // 2) + src = BasemapSource( + tmp_path / "cache", tilejson_url="http://127.0.0.1:1/none", memo_bytes=one * 5 // 2 + ) for i in range(5): src._remember((14, i, 0), tile)