Skip to content

Add pool parameter support to Emcee model (Fix #95)#113

Merged
georgebv merged 4 commits intogeorgebv:masterfrom
jultou-raa:master
Feb 19, 2026
Merged

Add pool parameter support to Emcee model (Fix #95)#113
georgebv merged 4 commits intogeorgebv:masterfrom
jultou-raa:master

Conversation

@jultou-raa
Copy link
Contributor

Add support for the pool parameter in the Emcee model, allowing users to leverage parallel processing capabilities of emcee.EnsembleSampler.

This enhancement enables faster chain computations, which is beneficial for large datasets or complex models.

Changes:

  • src/pyextremes/models/model_emcee.py: Updated Emcee class to accept pool argument in __init__ and pass it to emcee.EnsembleSampler in fit.
  • src/pyextremes/models/models.py: Updated get_model function signature and docstring.
  • src/pyextremes/eva.py: Updated EVA.fit_model method signature and docstring.
  • tests/models/test_model_emcee.py: Added a test case test_fit_with_pool to ensure pool is correctly passed to the sampler.
  • Formatted code with ruff and ensured PEP8 compliance.

Fixes #95

Add support for the `pool` parameter in the `Emcee` model, allowing users to leverage parallel processing capabilities of `emcee.EnsembleSampler`.

This enhancement enables faster chain computations, which is beneficial for large datasets or complex models.

Changes:
- `src/pyextremes/models/model_emcee.py`: Updated `Emcee` class to accept `pool` argument in `__init__` and pass it to `emcee.EnsembleSampler` in `fit`.
- `src/pyextremes/models/models.py`: Updated `get_model` function signature and docstring.
- `src/pyextremes/eva.py`: Updated `EVA.fit_model` method signature and docstring.
- `tests/models/test_model_emcee.py`: Added a test case `test_fit_with_pool` to ensure `pool` is correctly passed to the sampler.
- Formatted code with `ruff` and ensured PEP8 compliance.
@jultou-raa jultou-raa changed the title Add pool parameter support to Emcee model (#1) Add pool parameter support to Emcee model (#95) Feb 16, 2026
@jultou-raa jultou-raa changed the title Add pool parameter support to Emcee model (#95) Add pool parameter support to Emcee model (Fix #95) Feb 16, 2026
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This fix is not related to the #95 fix, but is linked to a ruff tool check error

Copy link
Owner

@georgebv georgebv left a comment

Choose a reason for hiding this comment

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

Thank you! My only comment is about typing.

@codecov
Copy link

codecov bot commented Feb 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (5f2799c) to head (305872f).
⚠️ Report is 6 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #113   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           19        19           
  Lines          896       901    +5     
=========================================
+ Hits           896       901    +5     

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

- Created `src/pyextremes/typing.py` with `PoolType` Protocol.
- Updated `src/pyextremes/eva.py` to use `PoolType` in `fit_model` overload.
- Updated `src/pyextremes/models/model_emcee.py` to use `PoolType` in `__init__` and `fit`.
- Updated `src/pyextremes/models/models.py` to use `PoolType` in `get_model` overload.
- Ran ruff and pytest.
@jultou-raa
Copy link
Contributor Author

Hi @georgebv , thanks for your review and comments. I've updated the codebase based on your feedback. Please let me know if the changes are correct for you now.

- Delete [src/pyextremes/typing.py] to simplify package structure.
- Move [PoolType] protocol to [src/pyextremes/models/model_emcee.py] where it is primarily utilized.
- Update internal imports in [src/pyextremes/models/models.py] and [src/pyextremes/eva.py].
- Ensure PEP 8/20 compliance by co-locating typing definitions with their primary consumers.
@jultou-raa jultou-raa requested a review from georgebv February 17, 2026 18:14
georgebv
georgebv previously approved these changes Feb 18, 2026
@georgebv
Copy link
Owner

@jultou-raa looks like the linter is complaining, we should be good to merge once it passes

@jultou-raa
Copy link
Contributor Author

@jultou-raa looks like the linter is complaining, we should be good to merge once it passes

Sorry I did not activate the select I option when I checked. Now test should pass.

@georgebv georgebv merged commit 3d60cf8 into georgebv:master Feb 19, 2026
22 of 24 checks passed
@georgebv
Copy link
Owner

@jultou-raa thank you, released in https://github.com/georgebv/pyextremes/releases/tag/v2.5.0

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.

Feature Request: Add Support for pool Parameter in emcee Ensemble Sampler

2 participants