Re: Seed in examples
Pamphile Roy <[email protected]>
| Newsgroups | gmane.comp.python.scientific.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi everyone, As promised, here is the followup. The PR is in, which means you can now use again seed in examples. BUT, still prefer high entropy seeds. e.g. generated with: np.random.SeedSequence().entropy If you don’t put any seed, the previous magic number is being used. In both cases, the HTML is not going to render any seed as advertised. I opened a DOC PR to explain this. https://github.com/scipy/scipy/pull/18023 Cheers, Pamphile > On 20.02.2023, at 15:19, Pamphile Roy <[email protected]> wrote: > > Hi everyone, > > The current guidelines around seeding in examples is to not use plain >>> rng = np.random.default_rng() > This is great to present a clean HTML without seed that users would copy past. In the background we add a seed when running doctests. This part is painful for contributors as we either need to fail the CI first or go get the seed to have the correct output. > > In the following PR, I propose some numpydoc magic that would ease our job. We would be able to put a seed, but the HTML would still be free of it. Best of both worlds. > > https://github.com/scipy/scipy/pull/17945 > > Feel free to join the discussion. I will send a follow up if this gets merge to give updated guidelines. The current behaviour stays in place regardless if you would not want to care. > > Cheers, > Pamphile _______________________________________________ SciPy-Dev mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/scipy-dev.python.org/ Member address: [email protected]