Unverified Commit bf8be1e7 authored by Yuge Zhang's avatar Yuge Zhang Committed by GitHub
Browse files

Merge pull request #2837 from microsoft/v1.8

Merge v1.8 back to master
parents 320407b1 e06a9dda
...@@ -112,10 +112,10 @@ class Trial implements TableObj { ...@@ -112,10 +112,10 @@ class Trial implements TableObj {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const duration = (endTime - this.info.startTime!) / 1000; const duration = (endTime - this.info.startTime!) / 1000;
let accuracy; let accuracy;
if(this.acc !== undefined && this.acc.default !== undefined){ if (this.acc !== undefined && this.acc.default !== undefined) {
if(typeof this.acc.default === 'number'){ if (typeof this.acc.default === 'number') {
accuracy = JSON5.parse(this.acc.default); accuracy = JSON5.parse(this.acc.default);
}else { } else {
accuracy = this.acc.default; accuracy = this.acc.default;
} }
} }
...@@ -245,7 +245,7 @@ class Trial implements TableObj { ...@@ -245,7 +245,7 @@ class Trial implements TableObj {
} }
public finalKeys(): string[] { public finalKeys(): string[] {
if(this.acc !== undefined){ if (this.acc !== undefined) {
return Object.keys(this.acc); return Object.keys(this.acc);
} else { } else {
return []; return [];
...@@ -304,11 +304,16 @@ class Trial implements TableObj { ...@@ -304,11 +304,16 @@ class Trial implements TableObj {
} }
private renderNumber(val: any): string { private renderNumber(val: any): string {
if(typeof val === 'number'){ if (typeof val === 'number') {
if (isNaNorInfinity(val)) { if (isNaNorInfinity(val)) {
return `${val}`; // show 'NaN' or 'Infinity' return `${val}`; // show 'NaN' or 'Infinity'
} else {
if (this.accuracy === undefined) {
return `${formatAccuracy(val)} (LATEST)`;
} else { } else {
return `${formatAccuracy(val)} (FINAL)`; return `${formatAccuracy(val)} (FINAL)`;
}
} }
} else { } else {
// show other types, such as {tensor: {data: }} // show other types, such as {tensor: {data: }}
...@@ -317,8 +322,8 @@ class Trial implements TableObj { ...@@ -317,8 +322,8 @@ class Trial implements TableObj {
} }
public formatLatestAccuracy(): string { // TODO: this should be private public formatLatestAccuracy(): string { // TODO: this should be private
if(this.status === 'SUCCEEDED'){ if (this.status === 'SUCCEEDED') {
return (this.accuracy === undefined ? '--': this.renderNumber(this.accuracy)); return (this.accuracy === undefined ? '--' : this.renderNumber(this.accuracy));
} else { } else {
if (this.accuracy !== undefined) { if (this.accuracy !== undefined) {
return this.renderNumber(this.accuracy); return this.renderNumber(this.accuracy);
......
...@@ -2,16 +2,21 @@ ...@@ -2,16 +2,21 @@
/* decide modal size */ /* decide modal size */
.ms-Dialog-main{ .ms-Dialog-main{
width: 50%; width: 50%;
overflow: hidden; min-width: 450px;
}
.ms-Modal-scrollableContent{
overflow-x: hidden;
} }
/* compare-md: table style */ /* compare-md: table style */
.flex{
display: flex;
}
&-table{ &-table{
width: 92%; width: 92%;
margin: 0 auto; margin: 0 auto;
margin-bottom: 20px; margin-bottom: 20px;
border: 1px solid transparent; border: 1px solid transparent;
overflow: auto; overflow: auto hidden;
color: #333; color: #333;
tr{ tr{
line-height: 30px; line-height: 30px;
......
...@@ -10,7 +10,7 @@ kubeflow: ...@@ -10,7 +10,7 @@ kubeflow:
kubeflowConfig: kubeflowConfig:
operator: tf-operator operator: tf-operator
apiVersion: v1alpha2 apiVersion: v1
storage: azureStorage storage: azureStorage
keyVault: keyVault:
vaultName: vaultName:
......
...@@ -3,7 +3,9 @@ ...@@ -3,7 +3,9 @@
import os import os
import json import json
import shutil
from .constants import NNICTL_HOME_DIR from .constants import NNICTL_HOME_DIR
from .command_utils import print_error
class Config: class Config:
'''a util class to load and save config''' '''a util class to load and save config'''
...@@ -77,7 +79,13 @@ class Experiments: ...@@ -77,7 +79,13 @@ class Experiments:
def remove_experiment(self, expId): def remove_experiment(self, expId):
'''remove an experiment by id''' '''remove an experiment by id'''
if expId in self.experiments: if expId in self.experiments:
self.experiments.pop(expId) fileName = self.experiments.pop(expId).get('fileName')
if fileName:
logPath = os.path.join(NNICTL_HOME_DIR, fileName)
try:
shutil.rmtree(logPath)
except FileNotFoundError:
print_error('{0} does not exist.'.format(logPath))
self.write_file() self.write_file()
def get_all_experiments(self): def get_all_experiments(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment