diff options
author | Sebastian Berg <sebastianb@nvidia.com> | 2023-02-10 13:34:45 +0100 |
---|---|---|
committer | Sebastian Berg <sebastianb@nvidia.com> | 2023-02-14 20:19:28 +0100 |
commit | c1fa0d981258063e00e8976c41d34a6b94b12516 (patch) | |
tree | 6ce24a148c4cef4863f6962b03372fb0d103246d /numpy/array_api/tests/test_indexing_functions.py | |
parent | 482d3fadbfe23a1d2a2bb179e90369e0d08b11be (diff) | |
download | numpy-c1fa0d981258063e00e8976c41d34a6b94b12516.tar.gz |
API: Add `rng.spawn()`, `bit_gen.spawn()`, and `bit_gen.seed_seq`
This makes the seed sequence interface more public facing by:
1. Adding `BitGenerator.seed_seq` to give clear access to `_seed_seq`
2. Add `spawn()` to both the generator and the bit generator as
convenience methods for spawning new instances.
I somewhat remember that we always meant to consider making this
more public and adding such convenient methods, but did not do
so originally.
So, now, I do wonder whether it is time to make this fully public?
It would be nice to follow up at some point with a bit of best practices.
This also doesn't add it to the `RandomState`, although doing it via
`RandomState._bit_generator` is of course valid.
Can we define as this kind of access as stable enough that downstream
libraries could use it? I fear that backcompat with `RandomState`
might make adopting newer things like spawning hard for libraries?
Diffstat (limited to 'numpy/array_api/tests/test_indexing_functions.py')
0 files changed, 0 insertions, 0 deletions