Skip to content

Commit

Permalink
fix process state prints
Browse files Browse the repository at this point in the history
  • Loading branch information
Iara Ota committed Sep 9, 2024
1 parent 83ba19f commit a85b0ea
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions gwsumm/tabs/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,9 @@ def finalize_states(self, config=ConfigParser(), segdb_error='raise',
for state in self.states:
state.fetch(config=config, segdb_error=segdb_error, **kwargs)
# finilize statebar
if self.statebar:
self.statebar.fetch(config=config, segdb_error=segdb_error, **kwargs)
if self.statebar is not None:
self.statebar.fetch(config=config, segdb_error=segdb_error,

Check warning on line 342 in gwsumm/tabs/data.py

View check run for this annotation

Codecov / codecov/patch

gwsumm/tabs/data.py#L342

Added line #L342 was not covered by tests
**kwargs)


def process(self, config=ConfigParser(), nproc=1, **stateargs):
Expand All @@ -365,12 +366,16 @@ def process(self, config=ConfigParser(), nproc=1, **stateargs):
nproc=nproc, nds=stateargs.get('nds', None))
vprint(f"States finalised [{len(self.states) + len([self.statebar])}"
" total]\n")
for state in self.states + [self.statebar]:
for state in self.states:
vprint(f" {state.name}: {len(state.active)} segments"
" | {abs(state.active)} seconds")
f" | {abs(state.active)} seconds")
if state is self.defaultstate:
vprint(" [DEFAULT]")
vprint('\n')
if self.statebar is not None:
vprint(f" {self.statebar.name}: {len(self.statebar.active)}"

Check warning on line 376 in gwsumm/tabs/data.py

View check run for this annotation

Codecov / codecov/patch

gwsumm/tabs/data.py#L376

Added line #L376 was not covered by tests
f" segments | {abs(state.active)} seconds")
vprint('\n')

Check warning on line 378 in gwsumm/tabs/data.py

View check run for this annotation

Codecov / codecov/patch

gwsumm/tabs/data.py#L378

Added line #L378 was not covered by tests

# pre-process requests for 'all-data' plots
all_data = any([(p.all_data & p.new) for p in self.plots])
Expand Down

0 comments on commit a85b0ea

Please sign in to comment.