Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(frontend): Change from name to display_name for visualization. Fix #6346 #6347

Merged
merged 2 commits into from
Aug 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions frontend/src/components/tabs/MetricsTab.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ describe('MetricsTab with confidenceMetrics', () => {
const execution = buildBasicExecution().setLastKnownState(Execution.State.COMPLETE);
const artifactType = buildClassificationMetricsArtifactType();
const artifact = buildClassificationMetricsArtifact();
artifact.getCustomPropertiesMap().set('name', new Value().setStringValue('metrics'));
artifact.getCustomPropertiesMap().set('display_name', new Value().setStringValue('metrics'));
artifact.getCustomPropertiesMap().set(
'confidenceMetrics',
new Value().setStructValue(
Expand Down Expand Up @@ -149,7 +149,7 @@ describe('MetricsTab with confidenceMetrics', () => {
const execution = buildBasicExecution().setLastKnownState(Execution.State.COMPLETE);
const artifactType = buildClassificationMetricsArtifactType();
const artifact = buildClassificationMetricsArtifact();
artifact.getCustomPropertiesMap().set('name', new Value().setStringValue('metrics'));
artifact.getCustomPropertiesMap().set('display_name', new Value().setStringValue('metrics'));
artifact.getCustomPropertiesMap().set(
'confidenceMetrics',
new Value().setStructValue(
Expand Down Expand Up @@ -189,7 +189,7 @@ describe('MetricsTab with confidenceMetrics', () => {
const execution = buildBasicExecution().setLastKnownState(Execution.State.COMPLETE);
const artifactType = buildClassificationMetricsArtifactType();
const artifact = buildClassificationMetricsArtifact();
artifact.getCustomPropertiesMap().set('name', new Value().setStringValue('metrics'));
artifact.getCustomPropertiesMap().set('display_name', new Value().setStringValue('metrics'));
artifact.getCustomPropertiesMap().set(
'confidenceMetrics',
new Value().setStructValue(
Expand Down Expand Up @@ -220,7 +220,7 @@ describe('MetricsTab with confusionMatrix', () => {
const execution = buildBasicExecution().setLastKnownState(Execution.State.COMPLETE);
const artifactType = buildClassificationMetricsArtifactType();
const artifact = buildClassificationMetricsArtifact();
artifact.getCustomPropertiesMap().set('name', new Value().setStringValue('metrics'));
artifact.getCustomPropertiesMap().set('display_name', new Value().setStringValue('metrics'));
artifact.getCustomPropertiesMap().set(
'confusionMatrix',
new Value().setStructValue(
Expand Down Expand Up @@ -254,7 +254,7 @@ describe('MetricsTab with confusionMatrix', () => {
const execution = buildBasicExecution().setLastKnownState(Execution.State.COMPLETE);
const artifactType = buildClassificationMetricsArtifactType();
const artifact = buildClassificationMetricsArtifact();
artifact.getCustomPropertiesMap().set('name', new Value().setStringValue('metrics'));
artifact.getCustomPropertiesMap().set('display_name', new Value().setStringValue('metrics'));
artifact.getCustomPropertiesMap().set(
'confusionMatrix',
new Value().setStructValue(
Expand Down Expand Up @@ -290,7 +290,7 @@ describe('MetricsTab with confusionMatrix', () => {
const execution = buildBasicExecution().setLastKnownState(Execution.State.COMPLETE);
const artifactType = buildClassificationMetricsArtifactType();
const artifact = buildClassificationMetricsArtifact();
artifact.getCustomPropertiesMap().set('name', new Value().setStringValue('metrics'));
artifact.getCustomPropertiesMap().set('display_name', new Value().setStringValue('metrics'));
artifact.getCustomPropertiesMap().set(
'confusionMatrix',
new Value().setStructValue(
Expand Down Expand Up @@ -323,7 +323,7 @@ describe('MetricsTab with Scalar Metrics', () => {
it('shows Scalar Metrics', async () => {
const execution = buildBasicExecution().setLastKnownState(Execution.State.COMPLETE);
const artifact = buildMetricsArtifact();
artifact.getCustomPropertiesMap().set('name', new Value().setStringValue('metrics'));
artifact.getCustomPropertiesMap().set('display_name', new Value().setStringValue('metrics'));
artifact.getCustomPropertiesMap().set('double', new Value().setDoubleValue(123.456));
artifact.getCustomPropertiesMap().set('int', new Value().setIntValue(123));
artifact.getCustomPropertiesMap().set(
Expand Down
12 changes: 6 additions & 6 deletions frontend/src/components/viewers/MetricsVisualizations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ function getVerifiedClassificationMetricsArtifacts(
.map(artifact => ({
name: artifact
.getCustomPropertiesMap()
.get('name')
.get('display_name')
?.getStringValue(),
customProperties: artifact.getCustomPropertiesMap(),
artifact: artifact,
Expand Down Expand Up @@ -180,7 +180,7 @@ function getVerifiedMetricsArtifacts(
return metricsArtifacts.filter(x =>
x
.getCustomPropertiesMap()
.get('name')
.get('display_name')
?.getStringValue(),
);
}
Expand Down Expand Up @@ -231,7 +231,7 @@ interface ConfidenceMetricsSectionProps {

function ConfidenceMetricsSection({ artifact }: ConfidenceMetricsSectionProps) {
const customProperties = artifact.getCustomPropertiesMap();
const name = customProperties.get('name')?.getStringValue();
const name = customProperties.get('display_name')?.getStringValue();

const confidenceMetrics = customProperties
.get('confidenceMetrics')
Expand Down Expand Up @@ -318,7 +318,7 @@ const CONFUSION_MATRIX_DEFINITION =

function ConfusionMatrixSection({ artifact }: ConfusionMatrixProps) {
const customProperties = artifact.getCustomPropertiesMap();
const name = customProperties.get('name')?.getStringValue();
const name = customProperties.get('display_name')?.getStringValue();

const confusionMatrix = customProperties
.get('confusionMatrix')
Expand Down Expand Up @@ -403,14 +403,14 @@ interface ScalarMetricsSectionProps {
}
function ScalarMetricsSection({ artifact }: ScalarMetricsSectionProps) {
const customProperties = artifact.getCustomPropertiesMap();
const name = customProperties.get('name')?.getStringValue();
const name = customProperties.get('display_name')?.getStringValue();
const data = customProperties
.getEntryList()
.map(([key]) => ({
key,
value: JSON.stringify(getMetadataValue(customProperties.get(key))),
}))
.filter(metric => metric.key !== 'name');
.filter(metric => metric.key !== 'display_name');

if (data.length === 0) {
return null;
Expand Down