diff --git a/src/kbmod/reprojection.py b/src/kbmod/reprojection.py index 9657df41c..565f4d1b2 100644 --- a/src/kbmod/reprojection.py +++ b/src/kbmod/reprojection.py @@ -8,7 +8,6 @@ from kbmod import is_interactive from kbmod.search import KB_NO_DATA, PSF, ImageStack, LayeredImage, RawImage from kbmod.work_unit import WorkUnit -from kbmod.tqdm_utils import TQDMUtils from kbmod.wcs_utils import append_wcs_to_hdu_header from astropy.io import fits import os @@ -17,6 +16,7 @@ # The number of executors to use in the parallel reprojecting function. MAX_PROCESSES = 8 +_DEFAULT_TQDM_BAR = "{l_bar}{bar}| {n_fmt}/{total_fmt} [{elapsed}]" def reproject_image(image, original_wcs, common_wcs): @@ -197,7 +197,7 @@ def _reproject_work_unit( stack = ImageStack() for obstime_index, o_i in tqdm( enumerate(zip(unique_obstimes, unique_obstime_indices)), - bar_format=TQDMUtils.DEFAULT_TQDM_BAR_FORMAT, + bar_format=_DEFAULT_TQDM_BAR, desc="Reprojecting", disable=not show_progress, ): @@ -406,7 +406,7 @@ def _reproject_work_unit_in_parallel( tqdm( concurrent.futures.as_completed(future_reprojections), total=len(future_reprojections), - bar_format=TQDMUtils.DEFAULT_TQDM_BAR_FORMAT, + bar_format=_DEFAULT_TQDM_BAR, desc="Reprojecting", disable=not show_progress, ) @@ -538,7 +538,7 @@ def reproject_lazy_work_unit( tqdm( concurrent.futures.as_completed(future_reprojections), total=len(future_reprojections), - bar_format=TQDMUtils.DEFAULT_TQDM_BAR_FORMAT, + bar_format=_DEFAULT_TQDM_BAR, desc="Reprojecting", disable=not show_progress, ) diff --git a/src/kbmod/tqdm_utils.py b/src/kbmod/tqdm_utils.py deleted file mode 100644 index f3d34d8c3..000000000 --- a/src/kbmod/tqdm_utils.py +++ /dev/null @@ -1,4 +0,0 @@ -class TQDMUtils: - """Holds configuration for TQDM progress bars.""" - - DEFAULT_TQDM_BAR_FORMAT = "{l_bar}{bar}| {n_fmt}/{total_fmt} [{elapsed}]" diff --git a/src/kbmod/work_unit.py b/src/kbmod/work_unit.py index bf9e932bb..b28902488 100644 --- a/src/kbmod/work_unit.py +++ b/src/kbmod/work_unit.py @@ -23,7 +23,9 @@ wcs_to_dict, ) from kbmod.reprojection_utils import invert_correct_parallax -from kbmod.tqdm_utils import TQDMUtils + + +_DEFAULT_WORKUNIT_TQDM_BAR = "{l_bar}{bar}| {n_fmt}/{total_fmt} [{elapsed}]" logger = Logging.getLogger(__name__) @@ -311,7 +313,7 @@ def from_fits(cls, filename, show_progress=None): # Read in all the image files. for i in tqdm( range(num_images), - bar_format=TQDMUtils.DEFAULT_TQDM_BAR_FORMAT, + bar_format=_DEFAULT_WORKUNIT_TQDM_BAR, desc="Loading images", disable=not show_progress, ): @@ -340,7 +342,7 @@ def from_fits(cls, filename, show_progress=None): constituent_images = [] for i in tqdm( range(n_constituents), - bar_format=TQDMUtils.DEFAULT_TQDM_BAR_FORMAT, + bar_format=_DEFAULT_WORKUNIT_TQDM_BAR, desc="Loading WCS", disable=not show_progress, ):