Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
nni
Commits
61ebfb00
Unverified
Commit
61ebfb00
authored
Dec 21, 2018
by
chicm-ms
Committed by
GitHub
Dec 21, 2018
Browse files
Fix database and datastore unit test (#490)
parent
c39e688c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
src/nni_manager/core/nniDataStore.ts
src/nni_manager/core/nniDataStore.ts
+8
-1
src/nni_manager/core/test/sqlDatabase.test.ts
src/nni_manager/core/test/sqlDatabase.test.ts
+4
-4
No files found.
src/nni_manager/core/nniDataStore.ts
View file @
61ebfb00
...
@@ -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
);
...
...
src/nni_manager/core/test/sqlDatabase.test.ts
View file @
61ebfb00
...
@@ -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
[]
=
[
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment