- SPipe_server_2026-10-30.zip 내용을 풀어서 등록 (압축 파일은 올리지 않음) - README에 데모 v2 서버 업데이트 순서 추가, 저장소에 없는 문서 목차 정리 - 패치내역을 docs/로 이동, _worklog.md 추가 - 임시 파일(backend/temp.*)과 API 키가 든 파일은 제외
38 lines
1.0 KiB
Python
38 lines
1.0 KiB
Python
"""공통 픽스처. 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)
|