Skip to content

Overhaul random state management #512

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

Merged
merged 2 commits into from
Aug 25, 2023

Conversation

kachayev
Copy link
Collaborator

Types of changes

This is rather lengthy follow-up for #510. Hopefully I found all cases to update:

  • manual seeding is removed from tests
  • tests are now using local random state generators rather than global state
  • functions that rely on randomization except random_state arguments now

Motivation and context / Related issue

To make reproducibility easier.

How has this been tested (if it applies)

Test cases are updated accordingly. It's interesting that previously for some of them (specifically suites from test_gromov) required explicit seeding for tests to work. Now they rely on random_state passed into functions and don't break because of global state.

PR checklist

  • I have read the CONTRIBUTING document.
  • The documentation is up-to-date with the changes I made (check build artifacts).
  • All tests passed, and additional code has been covered with new tests.
  • I have added the PR and Issue fix to the RELEASES.md file.

I guess new parameters added to the API should be mentioned in the RELEASE file.

@codecov
Copy link

codecov bot commented Aug 24, 2023

Codecov Report

Merging #512 (5385e35) into master (98e3187) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #512   +/-   ##
=======================================
  Coverage   96.05%   96.05%           
=======================================
  Files          65       65           
  Lines       13666    13679   +13     
=======================================
+ Hits        13127    13140   +13     
  Misses        539      539           

@agramfort agramfort merged commit 20cc202 into PythonOT:master Aug 25, 2023
@agramfort
Copy link
Collaborator

thx @kachayev !

@kachayev kachayev deleted the fix-random-state-overall branch August 25, 2023 07:54
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.

2 participants