File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -791,9 +791,6 @@ def _rng_from_bitgen(bitgen):
791
791
792
792
793
793
def _shuffle (bit_generator , x , axis = 0 ):
794
- state_data = bit_generator .state
795
- bit_generator = type (bit_generator )()
796
- bit_generator .state = state_data
797
794
state = _rng_from_bitgen (bit_generator )
798
795
return state .shuffle (x , axis = axis )
799
796
Original file line number Diff line number Diff line change @@ -403,6 +403,14 @@ def test_permutation(generator_class):
403
403
r2 = b .permutation (x )
404
404
assert_eq (r1 , r2 )
405
405
406
+ # Ensure subsequent `permutation` calls return a different result
407
+ # See https://github.com/dask/dask/issues/12029
408
+ r3 = a .permutation (x )
409
+ r4 = b .permutation (x )
410
+ assert_eq (r3 , r4 )
411
+ with pytest .raises (AssertionError ):
412
+ assert_eq (r1 , r3 )
413
+
406
414
x = generator_class ().permutation (100 )
407
415
assert x .shape == (100 ,)
408
416
You can’t perform that action at this time.
0 commit comments