Skip to content

Commit

Permalink
gwsumm: fixed list/iter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmmacleod committed Mar 19, 2019
1 parent 312f21f commit 4d39739
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gwsumm/plot/guardian.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def draw(self):
valid = SegmentList([self.span])

# plot segments
for y, (flag, label) in enumerate(zip(self.flags, labels)[::-1]):
for y, (flag, label) in enumerate(list(zip(self.flags, labels))[::-1]):
inreq = str(flag) + REQUESTSTUB
nominal = str(flag) + NOMINALSTUB
segs = get_segments([flag, inreq, nominal], validity=valid,
Expand Down
6 changes: 3 additions & 3 deletions gwsumm/plot/segments.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def draw(self):

# plot segments
for i, (flag, pargs) in enumerate(
zip(self.flags, plotargs)[::-1]):
list(zip(self.flags, plotargs))[::-1]):
label = re_quote.sub('', pargs.pop('label', str(flag)))
if (self.fileformat == 'svg' and not str(flag) in label and
ax.get_insetlabels()):
Expand Down Expand Up @@ -417,7 +417,7 @@ def _parse_labels(self, defaults=[]):
to set the bit names from the various channels as the defaults
in stead of the channel names
"""
chans = zip(*self.get_channel_groups())[0]
chans = list(zip(*self.get_channel_groups()))[0]
labels = list(self.pargs.pop('labels', defaults))
if isinstance(labels, string_types):
labels = labels.split(',')
Expand Down Expand Up @@ -506,7 +506,7 @@ def draw(self):
labels = [labels]
while len(labels) < len(flags):
labels.append(None)
for flag, label in zip(flags, labels)[::-1]:
for flag, label in list(zip(flags, labels))[::-1]:
kwargs = pargs.copy()
if label is not None:
kwargs['label'] = label
Expand Down
2 changes: 1 addition & 1 deletion gwsumm/tabs/builtin.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ def scaffold_plots(self, plots=None, state=None, layout=None,
layout[i] = (l, None)
else:
raise ValueError("Cannot parse layout element '%s'." % l)
while sum(zip(*layout)[0]) < len(plots):
while sum(list(zip(*layout))[0]) < len(plots):
layout.append(layout[-1])
l = i = 0
fancyboxargs.setdefault('data-fancybox-group', 1)
Expand Down
2 changes: 1 addition & 1 deletion gwsumm/tabs/fscan.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def write_state_html(self, state):
# reverse frequency order
spectrograms = self.plots[::2]
spectra = self.plots[1::2]
for pair in zip(spectrograms, spectra, freqs)[::-1]:
for pair in list(zip(spectrograms, spectra, freqs))[::-1]:
f = pair[-1]
page.div(class_='row', id="%s-%s" % (f[0], f[1]))
for p in pair[:2]:
Expand Down

0 comments on commit 4d39739

Please sign in to comment.