Unverified Commit 00ddf3aa authored by Lijiaoa's avatar Lijiaoa Committed by GitHub
Browse files

[bug bash] Rm default key from table column(because had "Default" column) (#2635)

parent 9c4a1c74
...@@ -414,17 +414,19 @@ class TableList extends React.Component<TableListProps, TableListState> { ...@@ -414,17 +414,19 @@ class TableList extends React.Component<TableListProps, TableListState> {
const tableSource: Array<TableRecord> = JSON.parse(JSON.stringify(this.props.tableSource)); const tableSource: Array<TableRecord> = JSON.parse(JSON.stringify(this.props.tableSource));
// parameter as table column // parameter as table column
const parameterStr: string[] = []; const parameterStr: string[] = [];
if (tableSource.length > 0) { if (!EXPERIMENT.isNestedExp()) {
const trialMess = TRIALS.getTrial(tableSource[0].id); if (tableSource.length > 0) {
const trial = trialMess.description.parameters; const trialMess = TRIALS.getTrial(tableSource[0].id);
const parameterColumn: string[] = Object.keys(trial); const trial = trialMess.description.parameters;
parameterColumn.forEach(value => { const parameterColumn: string[] = Object.keys(trial);
parameterStr.push(`${value} (search space)`); parameterColumn.forEach(value => {
}); parameterStr.push(`${value} (search space)`);
});
}
} }
// concat trial all final keys and remove dup "default" val, return list // concat trial all final keys and remove dup "default" val, return list
return (COLUMNPro.concat(parameterStr)).concat(Array.from(new Set(TRIALS.finalKeys()))); const finalKeysList = TRIALS.finalKeys().filter(item => item !== 'default');
return (COLUMNPro.concat(parameterStr)).concat(finalKeysList);
} }
// get IColumn[] // get IColumn[]
......
...@@ -14,6 +14,7 @@ function compareProfiles(profile1?: ExperimentProfile, profile2?: ExperimentProf ...@@ -14,6 +14,7 @@ function compareProfiles(profile1?: ExperimentProfile, profile2?: ExperimentProf
class Experiment { class Experiment {
private profileField?: ExperimentProfile = undefined; private profileField?: ExperimentProfile = undefined;
private statusField?: NNIManagerStatus = undefined; private statusField?: NNIManagerStatus = undefined;
private isNestedExperiment: boolean = false;
private isexperimentError: boolean = false; private isexperimentError: boolean = false;
private experimentErrorMessage: string = ''; private experimentErrorMessage: string = '';
private isStatusError: boolean = false; private isStatusError: boolean = false;
...@@ -31,6 +32,10 @@ class Experiment { ...@@ -31,6 +32,10 @@ class Experiment {
} }
} }
public isNestedExp(): boolean {
return this.isNestedExperiment;
}
public experimentError(): boolean { public experimentError(): boolean {
return this.isexperimentError; return this.isexperimentError;
} }
...@@ -114,7 +119,14 @@ class Experiment { ...@@ -114,7 +119,14 @@ class Experiment {
} }
get searchSpace(): object { get searchSpace(): object {
return JSON.parse(this.profile.params.searchSpace); const result = JSON.parse(this.profile.params.searchSpace);
for (const item in result) {
if (result[item]._value && typeof result[item]._value[0] === 'object') {
this.isNestedExperiment = true;
break;
}
}
return result;
} }
get logCollectionEnabled(): boolean { get logCollectionEnabled(): boolean {
......
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