Skip to content

Standardize 'multiprocessing' deferred import#3702

Merged
mrmundt merged 2 commits intoPyomo:mainfrom
jsiirola:defer-multiprocessing
Aug 14, 2025
Merged

Standardize 'multiprocessing' deferred import#3702
mrmundt merged 2 commits intoPyomo:mainfrom
jsiirola:defer-multiprocessing

Conversation

@jsiirola
Copy link
Copy Markdown
Member

Fixes # .

Summary/Motivation:

Pyomo generally has deferred the import of the multiprocessing module to speed up import of pyomo.environ. Recent changes in GDP (#3641) changed that and caused multiprocessing to be unconditionally imported. This restores the previous behavior (and centralizes the deferred import into pyomo.common.dependencies.

Changes proposed in this PR:

  • Add multiprocessing to the list of deferred imports in pyomo.common.dependencies
  • Standardize import of multiprocessing to use deferred import

Legal Acknowledgement

By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@codecov
Copy link
Copy Markdown

codecov bot commented Aug 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.20%. Comparing base (756c2c1) to head (65ce9f7).
⚠️ Report is 1008 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3702   +/-   ##
=======================================
  Coverage   89.20%   89.20%           
=======================================
  Files         892      892           
  Lines      103018   103016    -2     
=======================================
+ Hits        91894    91896    +2     
+ Misses      11124    11120    -4     
Flag Coverage Δ
builders 26.72% <100.00%> (+<0.01%) ⬆️
default 85.77% <100.00%> (?)
expensive 34.07% <100.00%> (?)
linux 86.95% <100.00%> (-1.98%) ⬇️
linux_other 86.95% <100.00%> (+<0.01%) ⬆️
osx 83.22% <100.00%> (-0.05%) ⬇️
win 85.15% <100.00%> (-0.01%) ⬇️
win_other 85.15% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mrmundt mrmundt merged commit df215bf into Pyomo:main Aug 14, 2025
57 of 65 checks passed
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.

3 participants