@@ -23,22 +23,12 @@ def test_random_rand(shape, seed):
23
23
else :
24
24
assert np .allclose (sp .to_numpy (sp_data ), np_data )
25
25
26
- # @pytest.mark.parametrize("low,high", [(0, 1), (4, 10), (-100, 100)])
27
- # def test_random_uniform(low, high, shape, seed):
28
- # sp.random.seed(seed)
29
- # sp_data = sp.random.uniform(low, high, shape)
30
-
31
- # np.random.seed(seed)
32
- # np_data = np.random.uniform(low, high, shape)
33
-
34
- # print('np', np_data)
35
- # print('sp', sp_data)
26
+ @pytest .mark .parametrize ("low,high" , [(0 , 1 ), (4 , 10 ), (- 100 , 100 )])
27
+ def test_random_uniform (low , high , shape , seed ):
28
+ sp .random .seed (seed )
29
+ sp_data = sp .random .uniform (low , high , shape )
36
30
37
- # # if isinstance(np_data, float):
38
- # # assert isinstance(sp_data, float) and sp_data == np_data
39
- # # else:
40
- # # assert np.allclose(sp.to_numpy(sp_data), np_data)
31
+ np .random .seed (seed )
32
+ np_data = np .random .uniform (low , high , shape )
41
33
42
- sp .init ()
43
- test_random_uniform (0 , 1 , (), 0 )
44
- sp .fini ()
34
+ assert np .allclose (sp .to_numpy (sp_data ), np_data )
0 commit comments