1919 # length of time and current array must equal
2020 ([1 , 2 , 4 ], [1 , 2 , 10 ], [9 ], True ),
2121 # missing I_gaba at t=9
22- ([1 , 2 , 10 ], [1 , 2 , 4 ], [ 9 ] , False ),
22+ ([1 , 2 , 10 ], [1 , 2 , 4 ], 9 , False ),
2323 ([3 , 2 , 1 ], [3 , 2 , 1 ], [2 ], False ), # Non-increasing order, should fail
2424 ([], [], [], False ), # Empty arrays, should fail
2525 ([1 , 5 , 9 , 12 , 17 ], [1 , 3 , 5 , 9 , 12 ], [8 , 11 ], True ),
2626 ([1 , 5 , 9 , 12 , 17 ], [1 , 3 , 5 , 9 , 12 ], [], False ),
2727 ([2 , 4 , 6 , 23 , 25 ], [7 , 10 , 15 , 21 , 25 ], [12 , 20 , 24 ], True ),
2828 ([2 , 3 , 4 , 5 , 6 ], [50 , 60 , 70 , 80 , 90 ], [70 , 100 ], False ),
2929 ([0 ], [6 ], [6 ], True ),
30- ([6 ], [6 ], [6 ], False ),
31- ([6 ], [0 ], [6 ], False ),
30+ (0 , 6 , 6 , True ),
31+ ([6 ], 6 , [6 ], False ),
32+ (6 , [0 ], [6 ], False ),
3233 ],
3334)
3435def test_calculate (t_ampa , t_gaba , t_eval , success , n_elec , seed ):
3536 rng = np .random .default_rng (seed )
3637 # Dummy data for currents and coordinates
3738 n_src = 3
3839 n_elec = 2
39- I_ampa = np .arange (len (t_ampa ))
40+ I_ampa = np .arange (np . size (t_ampa ))
4041 I_ampa = I_ampa [:, np .newaxis ] + np .arange (n_src )
41- I_gaba = - np .arange (len (t_gaba )) - 2
42+ I_gaba = - np .arange (np . size (t_gaba )) - 2
4243 I_gaba = I_gaba [:, np .newaxis ] - np .arange (n_src )
4344
4445 source_coords = rng .uniform (- 10 , 10 , (n_src , 3 ))
@@ -47,7 +48,7 @@ def test_calculate(t_ampa, t_gaba, t_eval, success, n_elec, seed):
4748 calc = wslfp .from_xyz_coords (elec_coords , source_coords , strict_boundaries = True )
4849 if success :
4950 lfp_values = calc .calculate (t_eval , t_ampa , I_ampa , t_gaba , I_gaba )
50- assert lfp_values .shape == (len (t_eval ), n_elec )
51+ assert lfp_values .shape == (np . size (t_eval ), n_elec )
5152 # increasing could be negative or positive
5253 # can't use np.abs since normalization can put values on either side of 0
5354 assert np .all (
0 commit comments