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

[MAINT] move user facing functions out of private modules #4166

Merged
merged 11 commits into from Jan 5, 2024

Conversation

Remi-Gau
Copy link
Collaborator

@Remi-Gau Remi-Gau commented Dec 16, 2023

Changes proposed in this pull request:

  • make _get_clusters_table module public
  • move copy_img out of nilearn._utils.niimg

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 Dec 16, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (434f0be) 92.00% compared to head (52ff9cb) 92.02%.
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4166      +/-   ##
==========================================
+ Coverage   92.00%   92.02%   +0.01%     
==========================================
  Files         145      144       -1     
  Lines       16378    16374       -4     
  Branches     3431     3427       -4     
==========================================
- Hits        15069    15068       -1     
+ Misses        768      766       -2     
+ Partials      541      540       -1     
Flag Coverage Δ
macos-latest_3.10_test_plotting 91.80% <100.00%> (+0.01%) ⬆️
macos-latest_3.11_test_plotting 91.80% <100.00%> (+0.01%) ⬆️
macos-latest_3.12_test_plotting 91.80% <100.00%> (+0.01%) ⬆️
macos-latest_3.8_test_plotting 91.76% <100.00%> (+0.01%) ⬆️
macos-latest_3.9_test_plotting 91.77% <100.00%> (?)
ubuntu-latest_3.10_test_plotting 91.80% <100.00%> (+0.01%) ⬆️
ubuntu-latest_3.11_test_plotting 91.80% <100.00%> (+0.01%) ⬆️
ubuntu-latest_3.12_test_plotting 91.80% <100.00%> (+0.01%) ⬆️
ubuntu-latest_3.12_test_pre 91.80% <100.00%> (+0.01%) ⬆️
ubuntu-latest_3.8_test_min 68.98% <90.00%> (+<0.01%) ⬆️
ubuntu-latest_3.8_test_plot_min 91.52% <100.00%> (+0.01%) ⬆️
ubuntu-latest_3.8_test_plotting 91.76% <100.00%> (+0.01%) ⬆️
ubuntu-latest_3.9_test_plotting 91.77% <100.00%> (+0.01%) ⬆️
windows-latest_3.10_test_plotting 91.78% <100.00%> (+0.01%) ⬆️
windows-latest_3.11_test_plotting 91.78% <100.00%> (+0.01%) ⬆️
windows-latest_3.12_test_plotting 91.78% <100.00%> (+0.01%) ⬆️
windows-latest_3.8_test_plotting 91.74% <100.00%> (+0.01%) ⬆️
windows-latest_3.9_test_plotting 91.74% <100.00%> (+0.01%) ⬆️

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.

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, aside codecov complaints

@Remi-Gau
Copy link
Collaborator Author

will add a test for the deprecation warning to help the coverage

@Remi-Gau
Copy link
Collaborator Author

  • @bthirion for this PR do you think that this should be mentioned in the changelog like in the previous PRs

- :bdg-dark:`Code` Remove leading underscore from non private functions to align with PEP8 (:gh:`4086` by `Rémi Gau`_).
- :bdg-dark:`Code` Make ``decoding/proximal_operator`` explicitly private to align with PEP8 (:gh:`4153` by `Rémi Gau`_).
- :bdg-dark:`Code` Make private functions public when used outside of their module ``nilearn.interface`` to align with PEP8 (:gh:`4168` by `Rémi Gau`_).

Technically users should not be importing from those private modules and there is a warning if they do but I think it can be nice to mention it in the changelog

@bthirion
Copy link
Member

Yes, put it in the changelog.
Thx !

nilearn/_utils/niimg.py Outdated Show resolved Hide resolved
Comment on lines 94 to 99
def test_copy_warning(img_3d_zeros_eye):
with pytest.warns(
DeprecationWarning,
match="Import this function from 'nilearn.image.copy_img'",
):
niimg.copy_img(img_3d_zeros_eye)
Copy link
Member

Choose a reason for hiding this comment

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

LGTM you just forgot to remove this test

Copy link
Collaborator Author

@Remi-Gau Remi-Gau Jan 4, 2024

Choose a reason for hiding this comment

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

If I had to pay for every extra ci workflows that has to run because of my absent mindedness... I'd be coding from under a bridge most of the time...

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, aside the test to be removed. Thx !

@Remi-Gau Remi-Gau merged commit 1374eee into nilearn:main Jan 5, 2024
32 checks passed
@Remi-Gau Remi-Gau deleted the make_func_public branch January 5, 2024 14:33
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

3 participants