Skip to content

replace tqdm and async progress with richpool (resolves #76) - #77

Open
sahiljhawar wants to merge 1 commit into
GFZ:mainfrom
sahiljhawar:richpool-impl
Open

replace tqdm and async progress with richpool (resolves #76)#77
sahiljhawar wants to merge 1 commit into
GFZ:mainfrom
sahiljhawar:richpool-impl

Conversation

@sahiljhawar

Copy link
Copy Markdown
Contributor

Replace multiprocessing.Pool and manual tqdm-polling with richpool

Swaps every Pool/map_async + manual tqdm-polling progress bar for richpool.p_map (parallel) or richpool.t_map/make_progress (sequential) across interp_functions.py, bin_and_interpolate_to_model_grid.py, and magnetic_field_functions.py. Removes the now-dead show_process_bar_for_map_async helper and its unreachable isinstance(result, Exception) checks. worker exceptions already propagate through p_map the same way they did through Pool.map_async(...).get(). Adds richpool as a dependency in pyproject.toml.

Resolves #76.

@sahiljhawar
sahiljhawar requested review from DoctorRabbit55 and a lite review from Copilot and removed request for Copilot August 14, 2026 08:58
@DoctorRabbit55

Copy link
Copy Markdown
Collaborator

Thanks, Sahil! Can you please verify that this is equally fast as before? I had bad experiences with p_tqdm regarding speed in the past

@sahiljhawar

Copy link
Copy Markdown
Contributor Author

I have checked locally. the speed change is negligible.

@DoctorRabbit55

Copy link
Copy Markdown
Collaborator

I think this is a better way to generate the progress bar for parallel tasks, but I would rather keep tqdm for simple for loops, as it does not require wrapping your loop into a function.

@sahiljhawar

Copy link
Copy Markdown
Contributor Author

just want to make it consistent :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

try richpool

2 participants