Commit 58656e80 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[experiment] Code cleanup

parent 765f49d0
......@@ -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" % (analyzername, thisalgo.name, loop["nb_slots"])
"splittable" % (algoname, 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):
......
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