Fix #81: add parallel option to headgrid for steady and transient models#83
Fix #81: add parallel option to headgrid for steady and transient models#83dbrakenhoff merged 10 commits intodevfrom
Conversation
dbrakenhoff
commented
Apr 2, 2026
- use tqdm.thread_map for parallel + optional progressbar
- deprecate printrow in favor of show_progress
- add tqdm to optional dependencies
- use parallel in some examples to speed up computations and test implementation
- use tqdm.thread_map for parallel + optional progressbar - deprecate printrow in favor of show_progress - add tqdm to optional dependencies - use parallel in some examples to speed up computations and test implementation
There was a problem hiding this comment.
Pull request overview
This PR adds an optional parallel execution path for computing headgrid in both steady and transient models (and wires it into contour plotting), while introducing a show_progress option and deprecating printrow. It also adds tqdm as an optional dependency to support the parallel/progress implementation.
Changes:
- Add
parallel/show_progressparameters toheadgrid(steady + transient) and deprecateprintrow. - Update steady/transient contour plotting helpers to forward
paralleltoheadgrid. - Add a
paralleloptional dependency group (viatqdm) inpyproject.toml.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
timflow/transient/plots.py |
Adds parallel option to contour plotting and forwards it to headgrid. |
timflow/transient/model.py |
Implements parallelized headgrid path with thread_map, adds show_progress, deprecates printrow. |
timflow/steady/plots.py |
Adds parallel option to steady contour plotting and forwards it to headgrid. |
timflow/steady/model.py |
Implements parallelized headgrid path with thread_map, adds show_progress, deprecates printrow. |
pyproject.toml |
Adds tqdm under a new parallel optional dependency group and reformats pytest markers. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…warning and improve some docstrings
|
This looks nice. For the horizontalwell notebook, the contour function gets a speed up of 3 times (on my Mac with just a few cores). What doesn't work yet is the progress bar. When I do a |
So that it also works in Jupyter Notebooks
mbakker7
left a comment
There was a problem hiding this comment.
Thanks for putting this PR together so quickly.
I think it is ready to go.