Skip to content

add check for duplicate ref_id, ann_id#296

Merged
jean-lucas merged 17 commits intomasterfrom
jean-lucas-ann-dup-ref
May 13, 2022
Merged

add check for duplicate ref_id, ann_id#296
jean-lucas merged 17 commits intomasterfrom
jean-lucas-ann-dup-ref

Conversation

@jean-lucas
Copy link
Contributor

@jean-lucas jean-lucas commented May 10, 2022

Provide check for duplicate (ref_id, ann_id) on annotation and predictions upload.

@jean-lucas jean-lucas self-assigned this May 10, 2022
@jean-lucas jean-lucas requested a review from ardila May 10, 2022 12:05
@jean-lucas jean-lucas requested a review from gatli May 11, 2022 11:46
Copy link
Contributor

@gatli gatli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except for nit regarding named Exception class.

tuple_count = Counter(tuple_ids)
duplicates = {key for key, value in tuple_count.items() if value > 1}
if len(duplicates) > 0:
raise ValueError(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make a named Exception class out of this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea

@jean-lucas jean-lucas merged commit 05173ab into master May 13, 2022
@jean-lucas jean-lucas deleted the jean-lucas-ann-dup-ref branch May 13, 2022 08:46
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.

2 participants