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

DOC: add section on setting random number seeds #9123

Merged
merged 1 commit into from
Aug 30, 2017

Conversation

tacaswell
Copy link
Member

Document using 19680801 as the preferred random seed.

@tacaswell tacaswell added this to the 2.1 (next point release) milestone Aug 30, 2017
@afvincent
Copy link
Contributor

Minor remark FWIW, shouldn´t we promote fixing the PRNG seed in examples as well? I think that @NelleV (or maybe @choldgraf, I don´t remember clearly 🐑) did some work a while ago to ensure that 19680801 was used as the seed for the PRNGs in every files where a call to a random function was made (not only the test-related ones). Do we want to make this clear in the docs too?

@tacaswell
Copy link
Member Author

I think the samples are uniformly change but most of the tests are not (because it would require re-generating test images). I decided against mentioning the examples here as this is a section on tests.

Copy link
Contributor

@afvincent afvincent left a comment

Choose a reason for hiding this comment

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

Apart from what I think may be a typo, LGTM :).


Random data can is a very convenient way to generate data for examples,
however the randomness is problematic for testing (as the tests
must be deterministic!). To work around this set the seed in the test.
Copy link
Contributor

@afvincent afvincent Aug 30, 2017

Choose a reason for hiding this comment

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

"in the tests ?": typo or correct English?

Copy link
Member Author

Choose a reason for hiding this comment

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

tweaked a bit. The seed needs to be set in each test, just just once.

@afvincent
Copy link
Contributor

Fair enough about restricting the mention to the tests in a doc section about testing.

@dstansby dstansby merged commit a67b232 into matplotlib:master Aug 30, 2017
@tacaswell tacaswell deleted the doc_test_random branch August 30, 2017 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants