"git@developer.sourcefind.cn:OpenDAS/tilelang.git" did not exist on "2de566e798e2b6786255df395ce652d52f10af9e"
Unverified Commit 61ebfb00 authored by chicm-ms's avatar chicm-ms Committed by GitHub
Browse files

Fix database and datastore unit test (#490)

parent c39e688c
...@@ -250,7 +250,14 @@ class NNIDataStore implements DataStore { ...@@ -250,7 +250,14 @@ class NNIDataStore implements DataStore {
private mergeHyperParameters(hyperParamList: string[], newParamStr: string): string[] { private mergeHyperParameters(hyperParamList: string[], newParamStr: string): string[] {
const mergedHyperParams: any[] = []; const mergedHyperParams: any[] = [];
const newParam: any = JSON.parse(newParamStr); let newParam: any;
try {
newParam = JSON.parse(newParamStr);
} catch (err) {
this.log.error(`Hyper parameter needs to be in json format: ${newParamStr}`);
return hyperParamList;
}
for (const hyperParamStr of hyperParamList) { for (const hyperParamStr of hyperParamList) {
const hyperParam: any = JSON.parse(hyperParamStr); const hyperParam: any = JSON.parse(hyperParamStr);
mergedHyperParams.push(hyperParam); mergedHyperParams.push(hyperParam);
......
...@@ -64,10 +64,10 @@ const expParams2: ExperimentParams = { ...@@ -64,10 +64,10 @@ const expParams2: ExperimentParams = {
}; };
const profiles: ExperimentProfile[] = [ const profiles: ExperimentProfile[] = [
{ params: expParams1, id: '#1', execDuration: 0, startTime: Date.now(), endTime: undefined, revision: 1, maxSequenceId: 0 }, { params: expParams1, id: '#1', execDuration: 0, logDir: '/log', startTime: Date.now(), endTime: undefined, maxSequenceId: 0, revision: 1,},
{ params: expParams1, id: '#1', execDuration: 0, startTime: Date.now(), endTime: Date.now(), revision: 2, maxSequenceId: 0 }, { params: expParams1, id: '#1', execDuration: 0, logDir: '/log', startTime: Date.now(), endTime: Date.now(), maxSequenceId: 0, revision: 2 },
{ params: expParams2, id: '#2', execDuration: 0, startTime: Date.now(), endTime: Date.now(), revision: 2, maxSequenceId: 0 }, { params: expParams2, id: '#2', execDuration: 0, logDir: '/log', startTime: Date.now(), endTime: Date.now(), maxSequenceId: 0, revision: 2 },
{ params: expParams2, id: '#2', execDuration: 0, startTime: Date.now(), endTime: Date.now(), revision: 3, maxSequenceId: 0 } { params: expParams2, id: '#2', execDuration: 0, logDir: '/log', startTime: Date.now(), endTime: Date.now(), maxSequenceId: 0, revision: 3 }
]; ];
const events: TrialJobEventRecord[] = [ const events: TrialJobEventRecord[] = [
......
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