-
Notifications
You must be signed in to change notification settings - Fork 12
set rng per test #268
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
set rng per test #268
Conversation
ultraplot/tests/test_1dplots.py
Outdated
# using the same seed | ||
from .conftest import SEED | ||
|
||
np.random.seed(SEED) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need a threading lock since we are modifying a global.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't thread lock the layout within networkx, so this is fine as is I think as no two threads are accessing that function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let me think of a better way to do this; otherwise we need to lock all functions that call graph
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use loadscope
on the other PR https://pytest-xdist.readthedocs.io/en/stable/distribution.html#running-tests-across-multiple-cpus
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think it is fixed now if we pass on seed explicitly to the functions that use rngs
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
From my viewing of the results, the results only differ in the random data. This PR and #266 would self correct as it would clean up the mess on main. |
To ease the transition of #266 this PR adds just the changes to the tests and the local rng generator.