Skip to content

Commit

Permalink
more pbar logic cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
phobson committed Mar 25, 2024
1 parent acd9cc1 commit 5ddb266
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 4 additions & 2 deletions wqio/datacollections.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ def __init__(
**{self.cencol: dataframe[self.qualcol].isin(self.ndval)}
).reset_index()

self.pbarfxn = tqdm if (self.showpbar and tqdm) else utils.misc.no_op

@cache_readonly
def tidy(self):
if self.useros:
Expand Down Expand Up @@ -510,7 +512,7 @@ def comparison_stat_twoway(self, statfxn, statname=None, paired=False, **statopt
rescol,
statfxn,
statname=statname,
pbarfxn=tqdm if self.showpbar else None,
pbarfxn=self.pbarfxn,
**statopts,
)
return pandas.DataFrame.from_records(results).set_index(index_cols)
Expand All @@ -524,7 +526,7 @@ def comparison_stat_allway(self, statfxn, statname, control=None, **statopts):
statfxn,
statname=statname,
control=control,
pbarfxn=tqdm if self.showpbar else None,
pbarfxn=self.pbarfxn,
**statopts,
)
return pandas.DataFrame.from_records(results).set_index(self.groupcols_comparison)
Expand Down
4 changes: 0 additions & 4 deletions wqio/utils/numutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,8 +667,6 @@ def _comp_stat_generator(
comp_stats : pandas.DataFrame
"""
if not pbarfxn:
pbarfxn = misc.no_op

groupcols = validate.at_least_empty_list(groupcols)
if statname is None:
Expand Down Expand Up @@ -765,8 +763,6 @@ def _paired_stat_generator(
comp_stats : pandsa.DataFrame
"""
if not pbarfxn:
pbarfxn = misc.no_op

groupcols = validate.at_least_empty_list(groupcols)
if statname is None:
Expand Down

0 comments on commit 5ddb266

Please sign in to comment.