Skip to content

Comments

Improve orbit parallelisation#180

Merged
TomWagg merged 5 commits intomainfrom
pickle
Jan 20, 2026
Merged

Improve orbit parallelisation#180
TomWagg merged 5 commits intomainfrom
pickle

Conversation

@TomWagg
Copy link
Owner

@TomWagg TomWagg commented Jan 20, 2026

This pull request introduces significant improvements to the multiprocessing logic in the Population class and refactors the test suite to use temporary directories for file I/O, ensuring better resource management and test isolation. Additionally, the package version is incremented to reflect these updates.

Key changes:

Multiprocessing improvements in Population (cogsworth/pop.py):

  • Refactored multiprocessing pool management by introducing _ensure_pool and _close_pool methods, which handle pool creation and teardown based on configuration changes, reducing resource leaks and potential deadlocks.
  • Added a global configuration dictionary (_GLOBAL) and helper functions (_init_pool, _orbit_worker) to streamline passing arguments to worker processes, improving clarity and efficiency of parallel orbit integration.
  • Updated the initialization of the pool configuration state in the Population constructor.

Test suite improvements:

  • Refactored all tests that previously wrote files to the working directory to use tempfile.TemporaryDirectory, ensuring that test artifacts are cleaned up automatically and tests are isolated from one another. This change affects both population and SFH tests.

Version update:

  • Bumped the package version from 3.5.0 to 3.5.1 to reflect these enhancements. ([cogsworth/_version.pyL1-R1](https://github.com/TomWagg/cogsworth/pull/180/files#diff-7683603b1d7af0f11b667ea5dc58350b01f89264fc6e92b967121be8bcf81d5eL1-R1))

@TomWagg TomWagg self-assigned this Jan 20, 2026
@TomWagg TomWagg added the enhancement New feature or request label Jan 20, 2026
@codecov
Copy link

codecov bot commented Jan 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (a7cb0de) to head (d210790).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #180   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           15        15           
  Lines         2068      2077    +9     
=========================================
+ Hits          2068      2077    +9     

☔ 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.

@TomWagg TomWagg merged commit 847fbce into main Jan 20, 2026
3 checks passed
@TomWagg TomWagg deleted the pickle branch January 30, 2026 19:45
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.

1 participant