1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-02-21 20:38:57 +00:00

daq: Fixed channel merging

Fixed channel merging when setting merge to True.
Channel merges done by setting a mapping manually were not affected by this bug.
This commit is contained in:
Sebastian Goscik 2016-03-21 10:59:42 +00:00
parent 3531dd6d07
commit 15ced50640

View File

@ -310,7 +310,10 @@ class Daq(Instrument):
if isinstance(self.merge_channels, bool): if isinstance(self.merge_channels, bool):
if self.merge_channels: if self.merge_channels:
# Create a dict of potential prefixes and a list of their suffixes # Create a dict of potential prefixes and a list of their suffixes
grouped_suffixes = {label[:-1]: label for label in sorted(self.labels) if len(label) > 1} grouped_suffixes = defaultdict(list)
for label in sorted(self.labels):
if len(label) > 1:
grouped_suffixes[label[:-1]].append(label)
# Only merge channels if more than one channel has the same prefix and the prefixes # Only merge channels if more than one channel has the same prefix and the prefixes
# are consecutive letters starting with 'a'. # are consecutive letters starting with 'a'.
self.label_map = {} self.label_map = {}