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

[experiment] Code cleanup

parent 765f49d0
...@@ -231,9 +231,9 @@ class Experiment(object): ...@@ -231,9 +231,9 @@ class Experiment(object):
if data is None: # loads prototype and validates it if data is None: # loads prototype and validates it
experiment_data, self.errors = prototypes.load("experiment") 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") 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 elif isinstance(data, (tuple, list)): # the user has passed a tuple
...@@ -477,7 +477,7 @@ class Experiment(object): ...@@ -477,7 +477,7 @@ class Experiment(object):
self.errors.append( self.errors.append(
"/loop/%s/nb_slots: you have set the number " "/loop/%s/nb_slots: you have set the number "
"of slots for algorithm `%s' to %d, but it is not " "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 # check parameter consistence
...@@ -740,7 +740,7 @@ class Experiment(object): ...@@ -740,7 +740,7 @@ class Experiment(object):
from_dtype = self.algorithms[block["algorithm"]].output_map[algout] from_dtype = self.algorithms[block["algorithm"]].output_map[algout]
from_name = "block" from_name = "block"
else: else:
self.errors.append("Unknown endpoint %s" % to_endpt[0]) self.errors.append("Unknown endpoint %s" % from_endpt[0])
continue continue
to_endpt = connection["to"].split(".", 1) to_endpt = connection["to"].split(".", 1)
...@@ -869,7 +869,7 @@ class Experiment(object): ...@@ -869,7 +869,7 @@ class Experiment(object):
# for the grouping properties for the inputs # for the grouping properties for the inputs
# create channel groups # create channel groups
chain_in = collections.Counter(input_connections) chain_groups = collections.Counter(input_connections)
# now check the algorithm for conformance # now check the algorithm for conformance
algo_groups = self.algorithms[self.analyzers[name]["algorithm"]].groups algo_groups = self.algorithms[self.analyzers[name]["algorithm"]].groups
...@@ -926,7 +926,7 @@ class Experiment(object): ...@@ -926,7 +926,7 @@ class Experiment(object):
) )
# makes sure we don't have multiple incomming connections # makes sure we don't have multiple incomming connections
assert len(_connections) == len(connections), ( assert len(_connections) == len(connections), ( # nosec
"detected multiple input " "detected multiple input "
"connections for block `%s' on experiment `%s'" % (name, self.label) "connections for block `%s' on experiment `%s'" % (name, self.label)
) )
...@@ -975,7 +975,6 @@ class Experiment(object): ...@@ -975,7 +975,6 @@ class Experiment(object):
# then go one by one generating the input **and** output hashes # then go one by one generating the input **and** output hashes
# until all is done. # until all is done.
block_config = self.blocks[block]
retval[algo_endpt] = { retval[algo_endpt] = {
"from": "%s.%s" % (block, output), "from": "%s.%s" % (block, output),
"channel": channel, "channel": channel,
...@@ -1181,8 +1180,6 @@ class Experiment(object): ...@@ -1181,8 +1180,6 @@ class Experiment(object):
def dot_diagram(self): def dot_diagram(self):
"""Returns a dot diagram representation of the experiment""" """Returns a dot diagram representation of the experiment"""
from .drawing import create_port_table
title = "Experiment: %s" % self.label title = "Experiment: %s" % self.label
def __label_callback(type, name): 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