diff --git a/src/groundlight/binary_labels.py b/src/groundlight/binary_labels.py index a0f615b4..de3216a1 100644 --- a/src/groundlight/binary_labels.py +++ b/src/groundlight/binary_labels.py @@ -15,19 +15,25 @@ class Label(str, Enum): YES = "YES" NO = "NO" - UNSURE = "UNSURE" + UNCLEAR = "UNCLEAR" -VALID_DISPLAY_LABELS = {Label.YES, Label.NO, Label.UNSURE} +VALID_DISPLAY_LABELS = {Label.YES, Label.NO, Label.UNCLEAR} class DeprecatedLabel(str, Enum): PASS = "PASS" FAIL = "FAIL" NEEDS_REVIEW = "NEEDS_REVIEW" + UNSURE = "__UNSURE" -DEPRECATED_LABEL_NAMES = {DeprecatedLabel.PASS, DeprecatedLabel.FAIL, DeprecatedLabel.NEEDS_REVIEW} +DEPRECATED_LABEL_NAMES = { + DeprecatedLabel.PASS, + DeprecatedLabel.FAIL, + DeprecatedLabel.NEEDS_REVIEW, + DeprecatedLabel.UNSURE, +} def convert_internal_label_to_display( @@ -47,8 +53,8 @@ def convert_internal_label_to_display( return Label.YES if upper in {Label.NO, DeprecatedLabel.FAIL}: return Label.NO - if upper in {Label.UNSURE, DeprecatedLabel.NEEDS_REVIEW}: - return Label.UNSURE + if upper in {Label.UNCLEAR, DeprecatedLabel.NEEDS_REVIEW, DeprecatedLabel.UNSURE}: + return Label.UNCLEAR logger.warning(f"Unrecognized internal label {label} - leaving it alone as a string.") return label diff --git a/test/integration/test_groundlight.py b/test/integration/test_groundlight.py index 59301161..397bad91 100644 --- a/test/integration/test_groundlight.py +++ b/test/integration/test_groundlight.py @@ -337,7 +337,7 @@ def test_add_label_names(gl: Groundlight, image_query_yes: ImageQuery, image_que # We may want to support something like this in the future, but not yet with pytest.raises(ValueError): - gl.add_label(iqid_yes, Label.UNSURE) + gl.add_label(iqid_yes, Label.UNCLEAR) def test_label_conversion_produces_strings():