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):
811811 rnd = rng .random ()
812812 # either write to random locations in the array, compute a ufunc, or
813813 # re-initialize the array
814- if rnd < 0.3333 :
814+ if rnd < 0.25 :
815815 num = np .random .randint (0 , arr .size )
816816 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 )
819827 else :
820828 arr [:] = random_string_list
821829
822830 with concurrent .futures .ThreadPoolExecutor (max_workers = 8 ) as tpe :
823831 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 )]
825833
826834 for f in futures :
827835 f .result ()
You can’t perform that action at this time.
0 commit comments