Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
beat.core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
beat
beat.core
Commits
bd4578a3
Commit
bd4578a3
authored
6 years ago
by
Samuel GAIST
Browse files
Options
Downloads
Patches
Plain Diff
[test][test_experiment_loading] Code cleanup
parent
0f25f17e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!62
Code cleanup
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
beat/core/test/test_experiment_loading.py
+41
-31
41 additions, 31 deletions
beat/core/test/test_experiment_loading.py
with
41 additions
and
31 deletions
beat/core/test/test_experiment_loading.py
+
41
−
31
View file @
bd4578a3
...
...
@@ -46,85 +46,95 @@ def test_load_valid_experiment():
experiment
=
Experiment
(
prefix
,
"
user/integers_addition/1/integers_addition
"
)
assert
experiment
.
valid
,
"
\n
* %s
"
%
"
\n
*
"
.
join
(
experiment
.
errors
)
nose
.
tools
.
assert_true
(
experiment
.
valid
,
"
\n
* %s
"
%
"
\n
*
"
.
join
(
experiment
.
errors
)
)
nose
.
tools
.
eq_
(
experiment
.
label
,
"
user/user/integers_addition/1/integers_addition
"
)
assert
experiment
.
toolchain
.
valid
,
"
\n
* %s
"
%
"
\n
*
"
.
join
(
experiment
.
toolchain
.
errors
nose
.
tools
.
assert_true
(
experiment
.
toolchain
.
valid
,
"
\n
* %s
"
%
"
\n
*
"
.
join
(
experiment
.
toolchain
.
errors
),
)
nose
.
tools
.
eq_
(
experiment
.
toolchain
.
name
,
"
user/integers_addition/1
"
)
nose
.
tools
.
eq_
(
len
(
experiment
.
datasets
),
1
)
assert
"
integers
"
in
experiment
.
datasets
nose
.
tools
.
assert_true
(
"
integers
"
in
experiment
.
datasets
)
nose
.
tools
.
eq_
(
len
(
experiment
.
databases
),
1
)
nose
.
tools
.
eq_
(
len
(
experiment
.
blocks
),
1
)
nose
.
tools
.
eq_
(
len
(
experiment
.
analyzers
),
1
)
nose
.
tools
.
eq_
(
len
(
experiment
.
algorithms
),
2
)
assert
"
user/sum/1
"
in
experiment
.
algorithms
assert
experiment
.
algorithms
[
"
user/sum/1
"
].
valid
assert
"
user/integers_analysis/1
"
in
experiment
.
algorithms
assert
experiment
.
algorithms
[
"
user/integers_analysis/1
"
].
valid
nose
.
tools
.
assert_true
(
"
user/sum/1
"
in
experiment
.
algorithms
)
nose
.
tools
.
assert_true
(
experiment
.
algorithms
[
"
user/sum/1
"
].
valid
)
nose
.
tools
.
assert_true
(
"
user/integers_analysis/1
"
in
experiment
.
algorithms
)
nose
.
tools
.
assert_true
(
experiment
.
algorithms
[
"
user/integers_analysis/1
"
].
valid
)
def
test_load_one_dataset_two_blocks_toolchain
():
experiment
=
Experiment
(
prefix
,
"
user/integers_addition/2/integers_addition
"
)
assert
experiment
.
valid
,
"
\n
* %s
"
%
"
\n
*
"
.
join
(
experiment
.
errors
)
nose
.
tools
.
assert_true
(
experiment
.
valid
,
"
\n
* %s
"
%
"
\n
*
"
.
join
(
experiment
.
errors
)
)
nose
.
tools
.
eq_
(
experiment
.
label
,
"
user/user/integers_addition/2/integers_addition
"
)
assert
experiment
.
toolchain
.
valid
,
"
\n
* %s
"
%
"
\n
*
"
.
join
(
experiment
.
toolchain
.
errors
nose
.
tools
.
assert_true
(
experiment
.
toolchain
.
valid
,
"
\n
* %s
"
%
"
\n
*
"
.
join
(
experiment
.
toolchain
.
errors
),
)
nose
.
tools
.
eq_
(
experiment
.
toolchain
.
name
,
"
user/integers_addition/2
"
)
nose
.
tools
.
eq_
(
len
(
experiment
.
datasets
),
1
)
assert
"
integers
"
in
experiment
.
datasets
nose
.
tools
.
assert_true
(
"
integers
"
in
experiment
.
datasets
)
nose
.
tools
.
eq_
(
len
(
experiment
.
databases
),
1
)
nose
.
tools
.
eq_
(
len
(
experiment
.
blocks
),
2
)
nose
.
tools
.
eq_
(
len
(
experiment
.
analyzers
),
1
)
nose
.
tools
.
eq_
(
len
(
experiment
.
algorithms
),
2
)
assert
"
user/sum/1
"
in
experiment
.
algorithms
assert
experiment
.
algorithms
[
"
user/sum/1
"
].
valid
assert
"
user/integers_analysis/1
"
in
experiment
.
algorithms
assert
experiment
.
algorithms
[
"
user/integers_analysis/1
"
].
valid
nose
.
tools
.
assert_true
(
"
user/sum/1
"
in
experiment
.
algorithms
)
nose
.
tools
.
assert_true
(
experiment
.
algorithms
[
"
user/sum/1
"
].
valid
)
nose
.
tools
.
assert_true
(
"
user/integers_analysis/1
"
in
experiment
.
algorithms
)
nose
.
tools
.
assert_true
(
experiment
.
algorithms
[
"
user/integers_analysis/1
"
].
valid
)
def
test_load_two_datasets_three_blocks_toolchain
():
experiment
=
Experiment
(
prefix
,
"
user/integers_addition/3/integers_addition
"
)
assert
not
experiment
.
valid
nose
.
tools
.
assert_false
(
experiment
.
valid
)
nose
.
tools
.
eq_
(
experiment
.
label
,
"
user/user/integers_addition/3/integers_addition
"
)
assert
experiment
.
errors
[
0
].
find
(
"
mismatch in input/output
"
)
!=
-
1
nose
.
tools
.
assert_not_equal
(
experiment
.
errors
[
0
].
find
(
"
mismatch in input/output
"
),
-
1
)
assert
experiment
.
toolchain
.
valid
nose
.
tools
.
assert_true
(
experiment
.
toolchain
.
valid
)
nose
.
tools
.
eq_
(
experiment
.
toolchain
.
name
,
"
user/integers_addition/3
"
)
nose
.
tools
.
eq_
(
len
(
experiment
.
datasets
),
2
)
assert
"
integers1
"
in
experiment
.
datasets
assert
"
integers2
"
in
experiment
.
datasets
nose
.
tools
.
assert_true
(
"
integers1
"
in
experiment
.
datasets
)
nose
.
tools
.
assert_true
(
"
integers2
"
in
experiment
.
datasets
)
nose
.
tools
.
eq_
(
len
(
experiment
.
databases
),
1
)
nose
.
tools
.
eq_
(
len
(
experiment
.
blocks
),
3
)
nose
.
tools
.
eq_
(
len
(
experiment
.
analyzers
),
1
)
nose
.
tools
.
eq_
(
len
(
experiment
.
algorithms
),
2
)
assert
"
user/sum/1
"
in
experiment
.
algorithms
assert
experiment
.
algorithms
[
"
user/sum/1
"
].
valid
assert
"
user/integers_analysis/1
"
in
experiment
.
algorithms
assert
experiment
.
algorithms
[
"
user/integers_analysis/1
"
].
valid
nose
.
tools
.
assert_true
(
"
user/sum/1
"
in
experiment
.
algorithms
)
nose
.
tools
.
assert_true
(
experiment
.
algorithms
[
"
user/sum/1
"
].
valid
)
nose
.
tools
.
assert_true
(
"
user/integers_analysis/1
"
in
experiment
.
algorithms
)
nose
.
tools
.
assert_true
(
experiment
.
algorithms
[
"
user/integers_analysis/1
"
].
valid
)
def
test_no_description
():
experiment
=
Experiment
(
prefix
,
"
user/integers_addition/1/integers_addition
"
)
assert
experiment
.
valid
,
"
\n
* %s
"
%
"
\n
*
"
.
join
(
experiment
.
errors
)
assert
experiment
.
description
is
None
assert
experiment
.
documentation
is
None
nose
.
tools
.
assert_true
(
experiment
.
valid
,
"
\n
* %s
"
%
"
\n
*
"
.
join
(
experiment
.
errors
)
)
nose
.
tools
.
assert_is_none
(
experiment
.
description
)
nose
.
tools
.
assert_is_none
(
experiment
.
documentation
)
description
=
"
This is my descriptor
"
experiment
.
description
=
description
assert
isinstance
(
experiment
.
description
,
six
.
string_types
)
nose
.
tools
.
assert_true
(
isinstance
(
experiment
.
description
,
six
.
string_types
)
)
nose
.
tools
.
eq_
(
experiment
.
description
,
description
)
...
...
@@ -133,10 +143,10 @@ def test_export():
name
=
"
user/integers_addition/1/integers_addition
"
obj
=
Experiment
(
prefix
,
name
)
assert
obj
.
valid
,
"
\n
* %s
"
%
"
\n
*
"
.
join
(
obj
.
errors
)
nose
.
tools
.
assert_true
(
obj
.
valid
,
"
\n
* %s
"
%
"
\n
*
"
.
join
(
obj
.
errors
)
)
obj
.
export
(
tmp_prefix
)
# load from tmp_prefix and validates
exported
=
Experiment
(
tmp_prefix
,
name
)
assert
exported
.
valid
,
"
\n
* %s
"
%
"
\n
*
"
.
join
(
exported
.
errors
)
nose
.
tools
.
assert_true
(
exported
.
valid
,
"
\n
* %s
"
%
"
\n
*
"
.
join
(
exported
.
errors
)
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment