Skip to content

Commit

Permalink
tweak tqdm import guard
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielYang59 committed Oct 20, 2024
1 parent 6f7fdbd commit 0c9d844
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/monty/multiprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

try:
from tqdm.autonotebook import tqdm
except ImportError:
tqdm = None
except ImportError as exc:
raise ImportError("tqdm must be installed for this function.") from exc


def imap_tqdm(nprocs: int, func: Callable, iterable: Iterable, *args, **kwargs) -> list:
Expand All @@ -28,8 +28,6 @@ def imap_tqdm(nprocs: int, func: Callable, iterable: Iterable, *args, **kwargs)
Returns:
Results of Pool.imap.
"""
if tqdm is None:
raise ImportError("tqdm must be installed for this function.")
data = []
with Pool(nprocs) as pool:
try:
Expand Down

0 comments on commit 0c9d844

Please sign in to comment.