Bears-R-Us / arkouda

Arkouda (αρκούδα): Interactive Data Analytics at Supercomputing Scale :bear:
Other
234 stars 87 forks source link

Test multiple calls to a generator with different dtypes/functions affect results #3427

Open stress-tess opened 1 month ago

stress-tess commented 1 month ago

Multiple calls to a generator with different dtypes/functions should affect the results (i.e. the state for the generators of all dtypes is moved forward)

I'd like for us to add a test to make sure we capture this duplicated calls to a generator with different dtypes and make sure the state is carried over. psuedo code demonstrating the concept I'm getting at:

rng = ak.random.default_rng(18)
int_pda = rng.integers(-(2**32), 2**32, 10)
second_call_float_pda = rng.uniform(-(2**32), 2**32, 10)

rng = ak.random.default_rng(18)
first_call_float_pda = rng.uniform(-(2**32), 2**32, 10)

assert first_call_float_pda != second_call_float_pda

based on: https://github.com/Bears-R-Us/arkouda/pull/3230#discussion_r1651567928 Originally posted by @stress-tess in https://github.com/Bears-R-Us/arkouda/issues/3320#issuecomment-2223122286

drculhane commented 1 month ago

Take a look at this and see if it captures some of what you have in mind:

https://github.com/drculhane/placeHolders/blob/ec9f2a575bd519c08002352a88ad428648da3073/rng_test.py