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

[ENH] Add avg_method to plot_surf_stat_map #4298

Merged
merged 7 commits into from Mar 8, 2024
Merged

Conversation

Remi-Gau
Copy link
Collaborator

@Remi-Gau Remi-Gau commented Feb 29, 2024

Changes proposed in this pull request:

  • add avg_method parameter to plot_surf_stat_map
  • throw warnings when using plotly and passing an unimplemented parameter to one of the surface plotting function to avoid users being confused why some parameters have no effect.
    • this required setting the default of a few parameters to None in the function declaration and using the original default when using the matplotlib engine.
    • this should now be reflected in the doc strings

Copy link
Contributor

👋 @Remi-Gau Thanks for creating a PR!

Until this PR is ready for review, you can include the [WIP] tag in its title, or leave it as a github draft.

Please make sure it is compliant with our contributing guidelines. In particular, be sure it checks the boxes listed below.

  • PR has an interpretable title.
  • PR links to Github issue with mention Closes #XXXX (see our documentation on PR structure)
  • Code is PEP8-compliant (see our documentation on coding style)
  • Changelog or what's new entry in doc/changes/latest.rst (see our documentation on PR structure)

For new features:

  • There is at least one unit test per new function / class (see our documentation on testing)
  • The new feature is demoed in at least one relevant example.

For bug fixes:

  • There is at least one test that would fail under the original bug conditions.

We will review it as quick as possible, feel free to ping us with questions if needed.

Copy link

codecov bot commented Feb 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.13%. Comparing base (abb80ff) to head (e4624ac).
Report is 23 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4298      +/-   ##
==========================================
+ Coverage   91.85%   92.13%   +0.27%     
==========================================
  Files         144      143       -1     
  Lines       16419    16452      +33     
  Branches     3434     3451      +17     
==========================================
+ Hits        15082    15158      +76     
+ Misses        792      749      -43     
  Partials      545      545              
Flag Coverage Δ
macos-latest_3.10_test_plotting 91.92% <100.00%> (?)
macos-latest_3.11_test_plotting ?
macos-latest_3.12_test_plotting 91.92% <100.00%> (?)
macos-latest_3.8_test_plotting 91.88% <100.00%> (?)
macos-latest_3.9_test_plotting 91.89% <100.00%> (?)
ubuntu-latest_3.10_test_plotting 91.92% <100.00%> (+0.07%) ⬆️
ubuntu-latest_3.11_test_plotting 91.92% <100.00%> (?)
ubuntu-latest_3.12_test_plotting 91.92% <100.00%> (?)
ubuntu-latest_3.12_test_pre 91.92% <100.00%> (?)
ubuntu-latest_3.8_test_min 68.81% <0.00%> (?)
ubuntu-latest_3.8_test_plot_min 91.59% <42.85%> (?)
ubuntu-latest_3.8_test_plotting 91.88% <100.00%> (?)
ubuntu-latest_3.9_test_plotting 91.89% <100.00%> (?)
windows-latest_3.10_test_plotting 91.90% <100.00%> (?)
windows-latest_3.11_test_plotting 91.90% <100.00%> (?)
windows-latest_3.12_test_plotting 91.90% <100.00%> (?)
windows-latest_3.8_test_plotting 91.86% <100.00%> (?)
windows-latest_3.9_test_plotting 91.87% <100.00%> (?)

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

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

@Remi-Gau Remi-Gau marked this pull request as draft March 4, 2024 10:02
@Remi-Gau Remi-Gau changed the title [WIP][FIX] fix colobar symmetric with plotly [ENH] Add avg_method to plot_surf_stat_map Mar 7, 2024
@Remi-Gau Remi-Gau marked this pull request as ready for review March 7, 2024 15:18
@Remi-Gau Remi-Gau requested a review from bthirion March 7, 2024 20:53
@Remi-Gau
Copy link
Collaborator Author

Remi-Gau commented Mar 7, 2024

@bthirion
Am not sure we can consider this PR as bug fix. What do you think?
If not a bug fix, am tempted to say we wait to merge this.

Copy link
Member

@bthirion bthirion left a comment

Choose a reason for hiding this comment

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

LGTM overall, thx !

Alpha level of the :term:`mesh` (not the stat_map).
Will default to ``"auto"`` of ``None`` is passed.
Copy link
Member

Choose a reason for hiding this comment

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

So, why not keeping auto as a default ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Let me specify this to say this will happen only when using the matplotlib engine.

nilearn/plotting/surf_plotting.py Outdated Show resolved Hide resolved
nilearn/plotting/surf_plotting.py Outdated Show resolved Hide resolved
Co-authored-by: bthirion <bertrand.thirion@inria.fr>
Copy link
Member

@bthirion bthirion left a comment

Choose a reason for hiding this comment

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

The change LGTM, thx.

@Remi-Gau Remi-Gau merged commit 351b058 into nilearn:main Mar 8, 2024
32 of 33 checks passed
@Remi-Gau Remi-Gau deleted the fix/4296 branch March 8, 2024 21:01
@Remi-Gau Remi-Gau restored the fix/4296 branch March 8, 2024 21:01
@Remi-Gau Remi-Gau deleted the fix/4296 branch March 8, 2024 21:01
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.

None yet

2 participants