Skip to content

Fix #81: add parallel option to headgrid for steady and transient models#83

Merged
dbrakenhoff merged 10 commits intodevfrom
headgrid_parallel
Apr 3, 2026
Merged

Fix #81: add parallel option to headgrid for steady and transient models#83
dbrakenhoff merged 10 commits intodevfrom
headgrid_parallel

Conversation

@dbrakenhoff
Copy link
Copy Markdown
Contributor

  • 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
@dbrakenhoff dbrakenhoff requested review from Copilot and mbakker7 April 2, 2026 12:34
@dbrakenhoff dbrakenhoff self-assigned this Apr 2, 2026
@dbrakenhoff dbrakenhoff added the enhancement New feature or request label Apr 2, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_progress parameters to headgrid (steady + transient) and deprecate printrow.
  • Update steady/transient contour plotting helpers to forward parallel to headgrid.
  • Add a parallel optional dependency group (via tqdm) in pyproject.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.

dbrakenhoff and others added 8 commits April 2, 2026 15:23
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>
@mbakker7
Copy link
Copy Markdown
Contributor

mbakker7 commented Apr 2, 2026

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 headgrid on transient and specify show_progress=True, I get Error displaying widget: model not found.

So that it also works in Jupyter Notebooks
Copy link
Copy Markdown
Contributor

@mbakker7 mbakker7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for putting this PR together so quickly.
I think it is ready to go.

@dbrakenhoff dbrakenhoff merged commit ea7b68b into dev Apr 3, 2026
11 checks passed
@dbrakenhoff dbrakenhoff deleted the headgrid_parallel branch April 3, 2026 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement multi-processing for computing a headgrid of the solution

3 participants