Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Iara Ota committed Sep 9, 2024
1 parent 6f17148 commit 25efc5d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion gwsumm/plot/builtin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions gwsumm/tabs/builtin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)

Expand Down
10 changes: 6 additions & 4 deletions gwsumm/tabs/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit 25efc5d

Please sign in to comment.