From 25efc5d5ccd4739fca5a432795aa35a97d51d100 Mon Sep 17 00:00:00 2001 From: Iara Ota Date: Mon, 9 Sep 2024 15:36:14 -0500 Subject: [PATCH] fix lint --- gwsumm/plot/builtin.py | 2 +- gwsumm/tabs/builtin.py | 4 ++-- gwsumm/tabs/data.py | 10 ++++++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/gwsumm/plot/builtin.py b/gwsumm/plot/builtin.py index fbfef9f6..9d1bf8f4 100644 --- a/gwsumm/plot/builtin.py +++ b/gwsumm/plot/builtin.py @@ -103,7 +103,7 @@ def add_state_segments(self, ax, visible=None, **kwargs): # as a segment in the time series plot. if isinstance(self.statebar, SummaryState) and ( state is None or (state.name.lower() == ALLSTATE)): - state = self.statebar + state = self.statebar if self.pargs.pop('no-state-segments', False): visible = False diff --git a/gwsumm/tabs/builtin.py b/gwsumm/tabs/builtin.py index 8d6f41f3..f6b6870a 100644 --- a/gwsumm/tabs/builtin.py +++ b/gwsumm/tabs/builtin.py @@ -597,7 +597,7 @@ class StateTab(PlotTab): """ type = 'state' - def __init__(self, name, states=list(),statebar=None, **kwargs): + def __init__(self, name, states=list(), statebar=None, **kwargs): """Initialise a new `Tab`. """ if kwargs.get('mode', None) is None: @@ -710,7 +710,7 @@ def from_ini(cls, cp, section, *args, **kwargs): # if a list is given, consider just the first element kwargs.setdefault( 'statebar', [re_quote.sub('', s).strip() for s in - cp.get(section, 'statebar').split(',')][0]) + cp.get(section, 'statebar').split(',')][0]) else: kwargs.setdefault('statebar', None) diff --git a/gwsumm/tabs/data.py b/gwsumm/tabs/data.py index 3228334a..048838ef 100644 --- a/gwsumm/tabs/data.py +++ b/gwsumm/tabs/data.py @@ -287,8 +287,8 @@ def from_ini(cls, cp, section, plotdir='plots', **kwargs): mods.setdefault('all-data', True) if type_: plot = PlotClass.from_ini(cp, pdef, start, end, sources, - state=None, statebar=job.statebar, - outdir=plotdir, **mods) + state=None, outdir=plotdir, + statebar=job.statebar, **mods) else: plot = PlotClass(sources, start, end, state=None, statebar=job.statebar, outdir=plotdir, @@ -359,9 +359,11 @@ def process(self, config=ConfigParser(), nproc=1, **stateargs): segdb_error=stateargs.get('segdb_error', 'raise'), datafind_error=stateargs.get('datafind_error', 'raise'), nproc=nproc, nds=stateargs.get('nds', None)) - vprint(f"States finalised [{len(self.states) + len([self.statebar])} total]\n" ) + vprint(f"States finalised [{len(self.states) + len([self.statebar])}" + " total]\n" ) for state in self.states + [self.statebar]: - vprint(f" {state.name}: {len(state.active)} segments | {abs(state.active)} seconds") + vprint(f" {state.name}: {len(state.active)} segments" + " | {abs(state.active)} seconds") if state is self.defaultstate: vprint(" [DEFAULT]") vprint('\n')