Skip to content

Commit

Permalink
ci: fix metadata drawer e2e (#851)
Browse files Browse the repository at this point in the history
Follow up from #839 that fixes the metadata drawer E2E by passing the
correct test data based on the ground truth status.


https://github.com/chanzuckerberg/cryoet-data-portal/actions/runs/9862017314
  • Loading branch information
codemonkey800 authored Jul 9, 2024
1 parent 91337ec commit b2deb9f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions frontend/packages/data-portal/e2e/metadataDrawer/utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { translations } from 'e2e/constants'
import { DeepPartial } from 'utility-types'

import {
Expand Down Expand Up @@ -110,6 +111,9 @@ export function getAnnotationTestMetdata(
): DrawerTestMetadata {
const file = (annotation.files ?? []).at(0)

const getGroundTruthField = <T>(value: T) =>
annotation.ground_truth_status ? translations.notApplicable : value

return {
annotationId: annotation.id,
annotationAuthors: annotation.authors?.map((author) => author.name),
Expand All @@ -126,9 +130,13 @@ export function getAnnotationTestMetdata(
objectShapeType: file?.shape_type,
objectState: annotation.object_state,
objectDescription: annotation.object_description,

// Ground truth annotations show N/A for precision and recall because they
// represent the correct or true labels for a dataset. Non ground truth
// annotations have these fields because they are compared against a ground
// truth annotation.
precision: getGroundTruthField(annotation.confidence_precision ?? '--'),
recall: getGroundTruthField(annotation.confidence_recall ?? '--'),
groundTruthStatus: getBoolString(annotation.ground_truth_status),
groundTruthUsed: annotation.ground_truth_used,
precision: annotation.confidence_precision,
recall: annotation.confidence_recall,
}
}

0 comments on commit b2deb9f

Please sign in to comment.