Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the correlation matrix computation in Stouffers and Reports #901

Merged
merged 2 commits into from
Aug 21, 2024

Conversation

JulioAPeraza
Copy link
Collaborator

@JulioAPeraza JulioAPeraza commented Aug 21, 2024

Closes None.

Changes proposed in this pull request:

  • Fix the correlation matrix computation in Stouffers and Reports

Summary by Sourcery

Fix the correlation matrix computation in the Stouffers and Reports modules by streamlining the calculation process and eliminating redundant code.

Bug Fixes:

  • Correct the computation of the correlation matrix in the Stouffers and Reports modules by simplifying the logic and removing unnecessary loops.

@JulioAPeraza JulioAPeraza added the bug Issues noting problems and PRs fixing those problems. label Aug 21, 2024
Copy link
Contributor

sourcery-ai bot commented Aug 21, 2024

Reviewer's Guide by Sourcery

This pull request fixes the correlation matrix computation in the Stouffers method and Reports. The main changes involve simplifying the correlation matrix calculation by using numpy's corrcoef function directly on the input data, rather than iterating through data bags. This change affects both the nimare/reports/base.py and nimare/meta/ibma.py files.

File-Level Changes

Files Changes
nimare/reports/base.py
nimare/meta/ibma.py
Simplified correlation matrix computation by using np.corrcoef directly on input data
nimare/reports/base.py
nimare/meta/ibma.py
Removed unnecessary iteration over data bags for correlation calculation
nimare/reports/base.py
nimare/meta/ibma.py
Eliminated the need for pre-allocating a zero matrix for correlation

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

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 @JulioAPeraza - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider adding a comment about the expected shape of the input data (self.inputs_['z_maps'] and self.results.estimator.inputs_[key_maps]) to improve clarity and maintainability.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

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 to tell me if it was helpful.

Copy link

codecov bot commented Aug 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.23%. Comparing base (c1cd2d7) to head (9f24cb6).
Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #901      +/-   ##
==========================================
- Coverage   88.24%   88.23%   -0.02%     
==========================================
  Files          48       48              
  Lines        6389     6382       -7     
==========================================
- Hits         5638     5631       -7     
  Misses        751      751              

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


🚨 Try these New Features:

Copy link
Member

@jdkent jdkent left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for removing the flaky test

@jdkent jdkent merged commit 2c9b52a into neurostuff:main Aug 21, 2024
23 checks passed
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.

2 participants