Skip to content

feat(services): F2D annotations slice 6 — EvaluationResult endpoints#39

Merged
frapercan merged 1 commit intodevelopfrom
feat/f2d-annotations-cafa-eval-extract
May 8, 2026
Merged

feat(services): F2D annotations slice 6 — EvaluationResult endpoints#39
frapercan merged 1 commit intodevelopfrom
feat/f2d-annotations-cafa-eval-extract

Conversation

@frapercan
Copy link
Copy Markdown
Owner

EvaluationResult-related endpoints (list, metrics TSV, artifacts ZIP, delete) move to the service. Router 711 → 683 LOC. Local-first: ruff/flake8/mypy clean, 1160 pytest pass.

Migrates the EvaluationResult-related endpoints into the service:

- ``evaluation_result_to_dict(r)`` ORM ↔ dict serialiser.
- ``list_evaluation_results_data(session, eval_id)`` for the list
  endpoint; raises ``EntityNotFoundError`` when the EvaluationSet
  does not resolve.
- ``get_eval_result_with_keys(session, eval_id, result_id)`` packs
  the "fetch row + cross-check eval_set ownership + extract artifact
  keys" pattern shared by metrics + artifacts + delete endpoints.
  Raises ``EntityNotFoundError("EvaluationResult")`` for the
  combined 404 path.
- ``delete_eval_result_collect_keys`` does the DB delete in the
  service; the router does the ArtifactStore cleanup post-session
  (same split as ``delete_evaluation_set_collect_keys``).
- ``render_evaluation_metrics_tsv(result, aspect_codes)`` is the
  TSV row generator; the router passes ``ASPECT_CAFA_CODES`` so the
  service stays free of the domain layer.

Three router endpoints reduce to thin shims:
``download_evaluation_metrics``, ``download_evaluation_artifacts``,
``list_evaluation_results``, ``delete_evaluation_result``.

Sizes: annotations router 711 → 683 LOC. Local-first verified:
ruff + flake8 + mypy clean, 1160 pytest passed.
@frapercan frapercan enabled auto-merge (squash) May 8, 2026 00:44
@frapercan frapercan merged commit b03b077 into develop May 8, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant