forked from yeatmanlab/pyAFQ
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disabling progress bars for sphinx-gallery
- Loading branch information
1 parent
d778f8a
commit 9ccb90d
Showing
2 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
def _no_tqdm(iterable, *args, **kwargs): | ||
""" | ||
replacement for tqdm that just passes back the iterable to silence `tqdm` | ||
""" | ||
return iterable | ||
|
||
|
||
def _no_progressbar(progress, total_length): | ||
""" | ||
no-op calls to update the `fetcher` progress bar | ||
""" | ||
return | ||
|
||
|
||
def reset_progressbars(gallery_conf, fname): | ||
""" | ||
monkey patch to disable various progress bar output for examples. the | ||
progress bar updates pollutes sphinx gallery output. using this monkey | ||
patch from the spinx-build will leave the progress bars in place for other | ||
uses. | ||
""" | ||
|
||
# disable tqdm | ||
import AFQ.data as afd | ||
import AFQ._fixes as fixes | ||
import AFQ.segmentation as seg | ||
import AFQ.viz.utils as utils | ||
|
||
afd.tqdm = _no_tqdm | ||
fixes.tqdm = _no_tqdm | ||
seg.tqdm = _no_tqdm | ||
utils.tqdm = _no_tqdm | ||
|
||
# disable update_progressbar | ||
from dipy.data import fetcher | ||
|
||
fetcher.update_progressbar = _no_progressbar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters