Skip to content

Conversation

@jdkent
Copy link
Member

@jdkent jdkent commented Jan 6, 2026

Closes # .

Changes proposed in this pull request:

Summary by Sourcery

New Features:

  • Expose an n_jobs parameter on PermutedOLS to control parallel execution of the underlying permutation test.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Jan 6, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds an n_jobs parameter to the PermutedOLS IBMA estimator and threads it through to the underlying permuted_ols model fitting call, enabling configurable parallelism instead of a hard-coded single job.

Class diagram for updated PermutedOLS IBMA estimator

classDiagram
    class IBMAEstimator

    class PermutedOLS {
        +bool two_sided
        +int n_jobs
        +dict parameters_
        +__init__(two_sided, n_jobs, kwargs)
        +_generate_description()
        +_fit_model(beta_maps, n_perm)
    }

    PermutedOLS --|> IBMAEstimator
Loading

File-Level Changes

Change Details Files
Expose a configurable n_jobs parameter on the PermutedOLS estimator and use it when calling permuted_ols to control parallelism.
  • Extend PermutedOLS.init signature to accept an n_jobs argument with default 1.
  • Store the provided n_jobs value on the instance during initialization.
  • Replace the hard-coded n_jobs=1 argument in _fit_model with the instance’s n_jobs attribute when calling permuted_ols.
nimare/meta/ibma.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • Consider adding basic validation or normalization for n_jobs (e.g., handling None, -1, or non-positive values) before passing it through to permuted_ols to avoid surprising runtime errors.
  • Since n_jobs is now a first-class estimator parameter, ensure it is consistently surfaced wherever estimator parameters are inspected or serialized (e.g., get_params/set_params or any internal config dicts) so it behaves like the existing options.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider adding basic validation or normalization for `n_jobs` (e.g., handling `None`, `-1`, or non-positive values) before passing it through to `permuted_ols` to avoid surprising runtime errors.
- Since `n_jobs` is now a first-class estimator parameter, ensure it is consistently surfaced wherever estimator parameters are inspected or serialized (e.g., `get_params`/`set_params` or any internal config dicts) so it behaves like the existing options.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@jdkent jdkent added the bug Issues noting problems and PRs fixing those problems. label Jan 6, 2026
@jdkent jdkent merged commit 761cd9c into neurostuff:main Jan 6, 2026
19 of 20 checks passed
@codecov
Copy link

codecov bot commented Jan 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.27%. Comparing base (db37ecb) to head (fc3e705).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #962      +/-   ##
==========================================
+ Coverage   88.26%   88.27%   +0.01%     
==========================================
  Files          49       49              
  Lines        6926     6994      +68     
==========================================
+ Hits         6113     6174      +61     
- Misses        813      820       +7     

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

@jdkent jdkent added this to Planning Jan 7, 2026
@jdkent jdkent moved this to Done in Planning Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issues noting problems and PRs fixing those problems.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant