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] Use rng fixture instead of check_random_state #4063

Merged
merged 3 commits into from Oct 19, 2023

Conversation

Remi-Gau
Copy link
Collaborator

@Remi-Gau Remi-Gau commented Oct 17, 2023

@github-actions
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.

@codecov
Copy link

codecov bot commented Oct 17, 2023

Codecov Report

Merging #4063 (4a853bf) into main (96755a4) will not change coverage.
Report is 4 commits behind head on main.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #4063   +/-   ##
=======================================
  Coverage   91.60%   91.60%           
=======================================
  Files         143      143           
  Lines       16072    16072           
  Branches     3339     3339           
=======================================
  Hits        14722    14722           
  Misses        804      804           
  Partials      546      546           
Flag Coverage Δ
macos-latest_3.10 91.49% <ø> (ø)
macos-latest_3.11 91.49% <ø> (ø)
macos-latest_3.12 91.49% <ø> (ø)
macos-latest_3.8 91.45% <ø> (ø)
macos-latest_3.9 91.46% <ø> (ø)
ubuntu-latest_3.10 91.49% <ø> (ø)
ubuntu-latest_3.11 91.49% <ø> (ø)
ubuntu-latest_3.12 91.49% <ø> (ø)
ubuntu-latest_3.8 91.45% <ø> (ø)
ubuntu-latest_3.9 91.46% <ø> (ø)
windows-latest_3.10 ?
windows-latest_3.11 ?
windows-latest_3.12 ?
windows-latest_3.8 91.39% <ø> (ø)
windows-latest_3.9 ?

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

Files Coverage Δ
nilearn/mass_univariate/permuted_least_squares.py 85.78% <ø> (ø)

... and 4 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@Remi-Gau Remi-Gau marked this pull request as ready for review October 17, 2023 13:09
@@ -443,12 +436,11 @@ def test_permuted_ols_with_covar_with_intercept_in_confonding_vars(


def test_permuted_ols_with_multiple_constants_and_covars(
design, random_state=RANDOM_STATE
design, rng, random_state=RANDOM_STATE
Copy link
Member

Choose a reason for hiding this comment

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

Do we still need random_state here ?

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 double check if permuted_ols could directly accept the rng and not just a seed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK I could remove this and also remove any use of RANDOM_STATE as a global in this test module.

But made realized the doc string of permuted_ols was not clear all types that random_state could take so I updated that.

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, thx.

@Remi-Gau Remi-Gau merged commit 9fcc19d into nilearn:main Oct 19, 2023
32 checks passed
@Remi-Gau Remi-Gau deleted the check_random_state branch October 19, 2023 09:20
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.

use rng fixture
2 participants