Skip to content

Commit

Permalink
Minor cleanup in getPlots()
Browse files Browse the repository at this point in the history
  • Loading branch information
StokesMIDE committed Apr 9, 2024
1 parent f5b7c39 commit e1005f9
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions idelib/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,18 +487,21 @@ def getPlots(self, subchannels=True, plots=True, debug=True, sort=True,
sources (typically internally-used data) are 1; and sources
greater than 1 generally contain data for diagnostic purposes.
"""
result = []
test = lambda x: debug or not x.name.startswith("DEBUG")
def test(x):
return debug or not x.name.startswith("DEBUG")

if plots:
result = [x for x in self.plots.values() if test(x)]
else:
result = []

if subchannels:
for c in self._channels.values():
for i in range(len(c.subchannels)):
subc = c.getSubChannel(i)
if subc.visibility > visibility:
if not test(subc) or subc.visibility > visibility:
continue
if debug or not str(subc.name).startswith("DEBUG"):
result.append(subc)
result.append(subc)
if sort:
result.sort(key=lambda x: x.displayName)
return result
Expand Down

0 comments on commit e1005f9

Please sign in to comment.