2
2
# @Author: gviejo
3
3
# @Date: 2022-03-30 11:16:30
4
4
# @Last Modified by: Guillaume Viejo
5
- # @Last Modified time: 2024-01-26 15:09:42
5
+ # @Last Modified time: 2024-01-26 15:23:20
6
6
7
7
"""Tests of tuning curves for `pynapple` package."""
8
8
@@ -36,7 +36,7 @@ def test_compute_discrete_tuning_curves_with_strings():
36
36
def test_compute_discrete_tuning_curves_error ():
37
37
dict_ep = { "0" :nap .IntervalSet (start = 0 , end = 50 ),
38
38
"1" :nap .IntervalSet (start = 50 , end = 100 )}
39
- with pytest .raises (RuntimeError ) as e_info :
39
+ with pytest .raises (AssertionError ) as e_info :
40
40
nap .compute_discrete_tuning_curves ([1 ,2 ,3 ], dict_ep )
41
41
assert str (e_info .value ) == "group should be a TsGroup."
42
42
@@ -45,9 +45,9 @@ def test_compute_discrete_tuning_curves_error():
45
45
"1" :nap .IntervalSet (start = 50 , end = 100 )}
46
46
k = [1 ,2 ,3 ]
47
47
dict_ep ["2" ] = k
48
- with pytest .raises (RuntimeError ) as e_info :
48
+ with pytest .raises (AssertionError ) as e_info :
49
49
nap .compute_discrete_tuning_curves (tsgroup , dict_ep )
50
- assert str (e_info .value ) == "dict_ep argument should contain only IntervalSet. \n Key 2 in dict_ep is not an IntervalSet"
50
+ assert str (e_info .value ) == "dict_ep argument should contain only IntervalSet. Key 2 in dict_ep is not an IntervalSet"
51
51
52
52
def test_compute_1d_tuning_curves ():
53
53
tsgroup = nap .TsGroup ({0 : nap .Ts (t = np .arange (0 , 100 ))})
@@ -61,7 +61,7 @@ def test_compute_1d_tuning_curves():
61
61
62
62
def test_compute_1d_tuning_curves_error ():
63
63
feature = nap .Tsd (t = np .arange (0 , 100 , 0.1 ), d = np .arange (0 , 100 , 0.1 ) % 1.0 )
64
- with pytest .raises (RuntimeError ) as e_info :
64
+ with pytest .raises (AssertionError ) as e_info :
65
65
nap .compute_1d_tuning_curves ([1 ,2 ,3 ], feature , nb_bins = 10 )
66
66
assert str (e_info .value ) == "group should be a TsGroup."
67
67
@@ -110,15 +110,15 @@ def test_compute_2d_tuning_curves_error():
110
110
(np .repeat (np .arange (0 , 100 ), 10 ), np .tile (np .arange (0 , 100 ), 10 ))
111
111
).T
112
112
features = nap .TsdFrame (t = np .arange (0 , 200 , 0.1 ), d = np .vstack ((tmp , tmp [::- 1 ])))
113
- with pytest .raises (RuntimeError ) as e_info :
113
+ with pytest .raises (AssertionError ) as e_info :
114
114
nap .compute_2d_tuning_curves ([1 ,2 ,3 ], features , 10 )
115
115
assert str (e_info .value ) == "group should be a TsGroup."
116
116
117
117
tsgroup = nap .TsGroup (
118
118
{0 : nap .Ts (t = np .arange (0 , 100 , 10 )), 1 : nap .Ts (t = np .array ([50 , 149 ]))}
119
119
)
120
120
features = nap .TsdFrame (t = np .arange (100 ), d = np .random .rand (100 , 3 ))
121
- with pytest .raises (RuntimeError ) as e_info :
121
+ with pytest .raises (AssertionError ) as e_info :
122
122
nap .compute_2d_tuning_curves (tsgroup , features , 10 )
123
123
assert str (e_info .value ) == "feature should have 2 columns only."
124
124
0 commit comments