"""공통 픽스처. wntr 동봉 Net3.inp를 개발용 데이터로 사용 (§7).""" from __future__ import annotations import pytest import wntr from blocksys.config import Config from blocksys.graph import apply_hard_constraints, build_weighted_graph from blocksys.io import load_network from blocksys.validate import baseline_simulation NET3_PATH = wntr.library.model_library.get_filepath("Net3") @pytest.fixture(scope="session") def cfg() -> Config: c = Config() c.hydraulics.duration_hours = 6 # 테스트 속도를 위해 24 -> 6시간으로 단축 c.hydraulics.timestep_minutes = 60 return c @pytest.fixture(scope="session") def bundle(): return load_network(NET3_PATH) @pytest.fixture(scope="session") def baseline(bundle, cfg): return baseline_simulation(bundle.wn, cfg) @pytest.fixture(scope="session") def weighted_graph(bundle, baseline, cfg): Gw = build_weighted_graph(bundle.graph, baseline, cfg) return apply_hard_constraints(Gw, cfg)