pyronear / pyronear/pyro-annotator

Group label not re-derived when validating after members are classified

Open
#253 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
0
Forks
1
Avg merge
1d 2h
Merged PRs (30d)
2

Description

Problem

Sequence-group label propagation only fires in one direction: propagate_group_label (in annotation_api/src/app/api/api_v1/endpoints/sequence_annotations.py) runs when a member annotation is saved to SEQ_ANNOTATION_DONE, and bails silently if the group is not yet validated:

group = await session.get(SequenceGroup, seq.sequence_group_id)
if group is None or not group.is_validated:
    return None

Meanwhile PATCH /api/v1/sequence_groups/{id} only flips is_validated — it never re-derives the group label from members that already reached SEQ_ANNOTATION_DONE.

So the classify-then-validate ordering strands the group: the annotator classifies a member sequence first (no propagation — group not validated, no warning either), then validates the group (no re-derivation), and the group sits at "to label + validated" indefinitely until some member annotation happens to be re-saved.

Steps to reproduce

  1. Take a group with is_validated = false and no label.
  2. Classify one of its member sequences to SEQ_ANNOTATION_DONE.
  3. Validate the group on /classify/groups/:id.
  4. The group stays unlabeled (smoke_type / false_positive_type both null) with no path forward from the UI.

Proposed fix

When the PATCH flips is_validated to true, re-derive the group label from existing member annotations at SEQ_ANNOTATION_DONE (reusing the derivation + conflict rules already in propagate_group_label, including the refuse-to-clobber-conflicting-labels behavior) and fan it out to unlocked members, same as the annotation-save path.

Related

  • PR #252 fixed the UI side only (tooltips on /classify/groups now explain that validation confirms the grouping and that propagation requires a validated group).
  • If the backend behavior changes, sweep the related copy — the "label propagates once confirmed" phrasing is shared by the Reviewed column tooltip, the Label column tooltip, the page's info popover, and the group page instructions.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in annotation_api/src/app/api/api_v1/endpoints/sequence_annotations.py and trace propagate_group_label, then inspect the PATCH /api/v1/sequence_groups/{id} handler. Reuse the existing derivation, conflict, and unlocked-member behavior when validation changes; done means classify-then-validate derives the group label and the related UI copy remains accurate.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, typescript
Domain
api, backend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.