Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.core
Commits
58656e80
Commit
58656e80
authored
Mar 15, 2019
by
Samuel GAIST
Browse files
[experiment] Code cleanup
parent
765f49d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
beat/core/experiment.py
View file @
58656e80
...
...
@@ -231,9 +231,9 @@ class Experiment(object):
if
data
is
None
:
# loads prototype and validates it
experiment_data
,
self
.
errors
=
prototypes
.
load
(
"experiment"
)
assert
not
self
.
errors
,
"
\n
* %s"
%
"
\n
*"
.
join
(
self
.
errors
)
assert
not
self
.
errors
,
"
\n
* %s"
%
"
\n
*"
.
join
(
self
.
errors
)
# nosec
toolchain_data
,
self
.
errors
=
prototypes
.
load
(
"toolchain"
)
assert
not
self
.
errors
,
"
\n
* %s"
%
"
\n
*"
.
join
(
self
.
errors
)
assert
not
self
.
errors
,
"
\n
* %s"
%
"
\n
*"
.
join
(
self
.
errors
)
# nosec
elif
isinstance
(
data
,
(
tuple
,
list
)):
# the user has passed a tuple
...
...
@@ -477,7 +477,7 @@ class Experiment(object):
self
.
errors
.
append
(
"/loop/%s/nb_slots: you have set the number "
"of slots for algorithm `%s' to %d, but it is not "
"splittable"
%
(
a
nalyzer
name
,
thisalgo
.
name
,
loop
[
"nb_slots"
])
"splittable"
%
(
a
lgo
name
,
thisalgo
.
name
,
loop
[
"nb_slots"
])
)
# check parameter consistence
...
...
@@ -740,7 +740,7 @@ class Experiment(object):
from_dtype
=
self
.
algorithms
[
block
[
"algorithm"
]].
output_map
[
algout
]
from_name
=
"block"
else
:
self
.
errors
.
append
(
"Unknown endpoint %s"
%
to
_endpt
[
0
])
self
.
errors
.
append
(
"Unknown endpoint %s"
%
from
_endpt
[
0
])
continue
to_endpt
=
connection
[
"to"
].
split
(
"."
,
1
)
...
...
@@ -869,7 +869,7 @@ class Experiment(object):
# for the grouping properties for the inputs
# create channel groups
chain_
in
=
collections
.
Counter
(
input_connections
)
chain_
groups
=
collections
.
Counter
(
input_connections
)
# now check the algorithm for conformance
algo_groups
=
self
.
algorithms
[
self
.
analyzers
[
name
][
"algorithm"
]].
groups
...
...
@@ -926,7 +926,7 @@ class Experiment(object):
)
# makes sure we don't have multiple incomming connections
assert
len
(
_connections
)
==
len
(
connections
),
(
assert
len
(
_connections
)
==
len
(
connections
),
(
# nosec
"detected multiple input "
"connections for block `%s' on experiment `%s'"
%
(
name
,
self
.
label
)
)
...
...
@@ -975,7 +975,6 @@ class Experiment(object):
# then go one by one generating the input **and** output hashes
# until all is done.
block_config
=
self
.
blocks
[
block
]
retval
[
algo_endpt
]
=
{
"from"
:
"%s.%s"
%
(
block
,
output
),
"channel"
:
channel
,
...
...
@@ -1181,8 +1180,6 @@ class Experiment(object):
def
dot_diagram
(
self
):
"""Returns a dot diagram representation of the experiment"""
from
.drawing
import
create_port_table
title
=
"Experiment: %s"
%
self
.
label
def
__label_callback
(
type
,
name
):
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment