diff options
| author | Alex Schofield <git@ajschof.me> | 2026-05-04 23:21:18 +0100 |
|---|---|---|
| committer | Alex Schofield <git@ajschof.me> | 2026-05-04 23:21:18 +0100 |
| commit | dbdc06cab87218246ee567dc180b09cd483a950e (patch) | |
| tree | ab4a3176fa9bf8caaabefe054fab701e246eb2a4 | |
| parent | 962e2e57fe16e51b03e9fbd6d4b9de626e01b49b (diff) | |
| download | fuelnearme-dbdc06cab87218246ee567dc180b09cd483a950e.tar.gz fuelnearme-dbdc06cab87218246ee567dc180b09cd483a950e.zip | |
ruff auto fix (UP035/UP006/F401)
| -rw-r--r-- | fnme/cli.py | 4 | ||||
| -rw-r--r-- | fnme/data.py | 2 | ||||
| -rw-r--r-- | fnme/station.py | 10 |
3 files changed, 7 insertions, 9 deletions
diff --git a/fnme/cli.py b/fnme/cli.py index 3d7d72e..7c0d49d 100644 --- a/fnme/cli.py +++ b/fnme/cli.py @@ -1,6 +1,6 @@ import argparse import sys -from typing import Any, Dict, List +from typing import Any from tabulate import tabulate @@ -36,7 +36,7 @@ def _fmt_price(v: float | None) -> str: return f"{v:.2f}" if v is not None else "N/A" -def output_stations(stations: List[Dict[str, Any]]) -> None: +def output_stations(stations: list[dict[str, Any]]) -> None: if not stations: print("[*] No stations found.") return diff --git a/fnme/data.py b/fnme/data.py index 17f30c5..11497ce 100644 --- a/fnme/data.py +++ b/fnme/data.py @@ -1,6 +1,4 @@ -import os from pathlib import Path -from typing import Optional import pandas as pd import requests diff --git a/fnme/station.py b/fnme/station.py index 6f5427a..75afc6f 100644 --- a/fnme/station.py +++ b/fnme/station.py @@ -1,5 +1,5 @@ import math -from typing import Any, Dict, List, Tuple +from typing import Any import numpy as np import pandas as pd @@ -10,7 +10,7 @@ _PRICE_KEYS = ("e5_price", "e10_price", "diesel_price") def _bounding_box( - dframe: pd.DataFrame, loc: Tuple[float, float], rad: int + dframe: pd.DataFrame, loc: tuple[float, float], rad: int ) -> pd.DataFrame: lat, lon = loc deg_lat = rad / 69.0 @@ -26,7 +26,7 @@ def _bounding_box( def _haversine_miles( - loc: Tuple[float, float], lat2: np.ndarray, lon2: np.ndarray + loc: tuple[float, float], lat2: np.ndarray, lon2: np.ndarray ) -> np.ndarray: R = 3958.8 lat1, lon1 = np.radians(loc[0]), np.radians(loc[1]) @@ -45,8 +45,8 @@ def _pence_to_pounds(col: pd.Series) -> pd.Series: def process_stations( - dframe: pd.DataFrame, rad: int, loc: Tuple[float, float] -) -> List[Dict[str, Any]]: + dframe: pd.DataFrame, rad: int, loc: tuple[float, float] +) -> list[dict[str, Any]]: df = _bounding_box(dframe, loc, rad).copy() |
