Address code review feedback: remove unused code and fix imports

Co-authored-by: kuhyx <147418882+kuhyx@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-01-07 17:09:06 +00:00
parent e739b1b227
commit e1afa45b66
2 changed files with 1 additions and 27 deletions

View File

@ -4,6 +4,7 @@ from __future__ import annotations
from pathlib import Path
import matplotlib.pyplot as plt
import pytest
try:
@ -71,14 +72,10 @@ class TestCreateDistrictMap:
fig = create_district_map(district)
assert fig is not None
# Clean up
import matplotlib.pyplot as plt
plt.close(fig)
def test_creates_figure_for_all_districts(self) -> None:
"""Test that we can create maps for all districts."""
import matplotlib.pyplot as plt
for district in WARSAW_DISTRICTS:
fig = create_district_map(district)
assert fig is not None

View File

@ -22,8 +22,6 @@ Output:
from __future__ import annotations
import argparse
import base64
from io import BytesIO
from pathlib import Path
import sys
from typing import TYPE_CHECKING, NamedTuple
@ -136,27 +134,6 @@ def create_district_map(district: District, *, highlight_only: bool = True) -> F
return fig
def generate_district_image_base64(district: District) -> str:
"""Generate a base64-encoded PNG image of the district map.
Args:
district: The district to visualize.
Returns:
Base64-encoded PNG image string.
"""
fig = create_district_map(district)
# Save to bytes buffer
buf = BytesIO()
fig.savefig(buf, format="png", bbox_inches="tight", dpi=150)
plt.close(fig)
buf.seek(0)
# Encode to base64
return base64.b64encode(buf.read()).decode("utf-8")
def save_district_image(district: District, output_dir: Path) -> Path:
"""Save a district map image to a file.