FastAPI app that parses CMM inspection reports (PDF/Excel/CSV), computes SPC metrics (Cp/Cpk/Pp/Ppk, control limits, Shapiro-Wilk), generates interactive Plotly charts, and provides AI-powered quality summaries via Azure OpenAI with graceful fallback. Includes 21 passing tests covering parsers, SPC calculations, and API endpoints.
14 lines
317 B
Python
14 lines
317 B
Python
from fastapi import APIRouter, HTTPException
|
|
|
|
from app.services.batch import get_batch
|
|
|
|
router = APIRouter()
|
|
|
|
|
|
@router.get("/results/{batch_id}")
|
|
async def get_results(batch_id: str):
|
|
batch = get_batch(batch_id)
|
|
if batch is None:
|
|
raise HTTPException(404, "Batch not found")
|
|
return batch.to_dict()
|