backend: fix mypy errors in geometry stub
- empty_buildings: dict → dict[str, Any] (mypy strict needs type args) - drop unused `# type: ignore[arg-type]` on strategy= (mypy now narrows the loop variable to Literal[...] from a tuple of literals)
This commit is contained in:
parent
d0909e6200
commit
08a63f611d
1 changed files with 4 additions and 2 deletions
|
|
@ -5,12 +5,14 @@ Stage 1b: greedy filling of rectangular MKD with 3 strategies. STRtree for colli
|
||||||
Performance target: <=10s per variant; fallback acceptance 15s.
|
Performance target: <=10s per variant; fallback acceptance 15s.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from typing import Any
|
||||||
|
|
||||||
from app.schemas.concept import TEAP, ConceptInput, ConceptVariant, FinancialModel
|
from app.schemas.concept import TEAP, ConceptInput, ConceptVariant, FinancialModel
|
||||||
|
|
||||||
|
|
||||||
def generate_stub(payload: ConceptInput) -> list[ConceptVariant]:
|
def generate_stub(payload: ConceptInput) -> list[ConceptVariant]:
|
||||||
"""Placeholder returning 3 empty variants. Replaced in Stage 1b."""
|
"""Placeholder returning 3 empty variants. Replaced in Stage 1b."""
|
||||||
empty_buildings: dict = {"type": "FeatureCollection", "features": []}
|
empty_buildings: dict[str, Any] = {"type": "FeatureCollection", "features": []}
|
||||||
empty_teap = TEAP(
|
empty_teap = TEAP(
|
||||||
built_area_sqm=0.0,
|
built_area_sqm=0.0,
|
||||||
total_floor_area_sqm=0.0,
|
total_floor_area_sqm=0.0,
|
||||||
|
|
@ -26,7 +28,7 @@ def generate_stub(payload: ConceptInput) -> list[ConceptVariant]:
|
||||||
for strategy in ("max_area", "max_insolation", "balanced"):
|
for strategy in ("max_area", "max_insolation", "balanced"):
|
||||||
strategies.append(
|
strategies.append(
|
||||||
ConceptVariant(
|
ConceptVariant(
|
||||||
strategy=strategy, # type: ignore[arg-type]
|
strategy=strategy,
|
||||||
buildings_geojson=empty_buildings,
|
buildings_geojson=empty_buildings,
|
||||||
teap=empty_teap,
|
teap=empty_teap,
|
||||||
financial=empty_financial,
|
financial=empty_financial,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue