Skip to content

Conversation

@jsiirola
Copy link
Member

Fixes # .

Summary/Motivation:

This PR updates the PauseGC context manager so that it works correctly in nested contexts.

Changes proposed in this PR:

  • Update PauseGC to restore the original state of the garbage collector on context manager exit
  • Add a "pseudo stack" for tracking nested instances of the PauseGC context manager
  • Update tests to verify nested operation

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

codecov bot commented Aug 25, 2022

Codecov Report

Merging #2507 (1a0ce99) into main (fb050d2) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #2507   +/-   ##
=======================================
  Coverage   86.00%   86.01%           
=======================================
  Files         715      715           
  Lines       80117    80130   +13     
=======================================
+ Hits        68908    68921   +13     
  Misses      11209    11209           
Flag Coverage Δ
linux 83.44% <100.00%> (+<0.01%) ⬆️
osx 73.76% <100.00%> (+<0.01%) ⬆️
other 83.62% <100.00%> (+<0.01%) ⬆️
win 80.60% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
pyomo/common/gc_manager.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@jsiirola jsiirola merged commit 6fe7155 into Pyomo:main Aug 26, 2022
@jsiirola jsiirola deleted the pause-gc-stack branch August 26, 2022 00:51
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.

2 participants