from fastapi import APIRouter, HTTPException from ..models.model_c import CVInput from ..logic.calc_c import calculate_all_c router = APIRouter() @router.post("/calculate/c") def calc_c(input: CVInput): cathode_name = input.cathode_name # Q–V match check if len(input.V_qv) != len(input.Q_qv): raise HTTPException(400, "V_qv and Q_qv must have the same length") return calculate_all_c(cathode_name, input.dict())