File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -811,17 +811,25 @@ def func(arr):
811
811
rnd = rng .random ()
812
812
# either write to random locations in the array, compute a ufunc, or
813
813
# re-initialize the array
814
- if rnd < 0.3333 :
814
+ if rnd < 0.25 :
815
815
num = np .random .randint (0 , arr .size )
816
816
arr [num ] = arr [num ] + "hello"
817
- elif rnd < 0.6666 :
818
- np .add (arr , arr )
817
+ elif rnd < 0.5 :
818
+ if rnd < 0.375 :
819
+ np .add (arr , arr )
820
+ else :
821
+ np .add (arr , arr , out = arr )
822
+ elif rnd < 0.75 :
823
+ if rnd < 0.875 :
824
+ np .multiply (arr , np .int64 (2 ))
825
+ else :
826
+ np .multiply (arr , np .int64 (2 ), out = arr )
819
827
else :
820
828
arr [:] = random_string_list
821
829
822
830
with concurrent .futures .ThreadPoolExecutor (max_workers = 8 ) as tpe :
823
831
arr = np .array (random_string_list , dtype = dtype )
824
- futures = [tpe .submit (func , arr ) for _ in range (100 )]
832
+ futures = [tpe .submit (func , arr ) for _ in range (500 )]
825
833
826
834
for f in futures :
827
835
f .result ()
You can’t perform that action at this time.
0 commit comments