@@ -15,23 +15,29 @@ from scipy.special import (
1515)
1616
1717_Float1_D : TypeAlias = onp .Array [onp .AtLeast1D [Any ], np .float64 ]
18+ _Float2_D : TypeAlias = onp .Array [onp .AtLeast2D [Any ], np .float64 ]
1819_Float3_D : TypeAlias = onp .Array [onp .AtLeast3D [Any ], np .float64 ]
1920_Complex0D : TypeAlias = onp .Array0D [np .complex128 ]
2021_Complex2D : TypeAlias = onp .Array2D [np .complex128 ]
22+ _Complex1_D : TypeAlias = onp .Array [onp .AtLeast1D [Any ], np .complex128 ]
23+ _Complex3_D : TypeAlias = onp .Array [onp .AtLeast3D [Any ], np .complex128 ]
2124
2225_i64_1d : onp .Array1D [np .int64 ]
2326_f64_1d : onp .Array1D [np .float64 ]
27+ _f64_2d : onp .Array2D [np .float64 ]
2428
2529# legendre_p
2630assert_type (legendre_p (1 , 1.0 ), onp .Array1D [np .float64 ])
2731assert_type (legendre_p (1 , np .float32 (1.0 )), onp .Array1D [np .float64 ])
32+ assert_type (legendre_p (1 , _f64_2d ), _Float2_D )
2833assert_type (legendre_p (1 , 1.0 , diff_n = True ), onp .Array1D [np .float64 ])
2934assert_type (legendre_p (1 , 1.0 , diff_n = 1 ), onp .Array1D [np .float64 ])
3035
3136# legendre_p_all
3237assert_type (legendre_p_all (3 , 1.0 ), _Float3_D )
3338assert_type (legendre_p_all (n = 3 , z = np .float32 (1.0 )), _Float3_D )
3439assert_type (legendre_p_all (3 , _f64_1d ), _Float3_D )
40+ assert_type (legendre_p_all (3 , _f64_2d ), _Float3_D )
3541assert_type (legendre_p_all (3 , 1.0 , diff_n = True ), _Float3_D )
3642assert_type (legendre_p_all (3 , 1.0 , diff_n = 2 ), _Float3_D )
3743
@@ -40,35 +46,41 @@ assert_type(assoc_legendre_p(3, 2, 1.0), _Float1_D)
4046assert_type (assoc_legendre_p (n = 3 , m = 2 , z = np .float32 (1.0 )), _Float1_D )
4147assert_type (assoc_legendre_p (_i64_1d , 2 , 1.0 ), _Float1_D )
4248assert_type (assoc_legendre_p (3 , _i64_1d , _f64_1d ), _Float1_D )
49+ assert_type (assoc_legendre_p (3 , 2 , _f64_2d ), _Float1_D )
4350assert_type (assoc_legendre_p (3 , 2 , 1.0 , branch_cut = 3 , norm = True , diff_n = 1 ), _Float1_D )
4451assert_type (assoc_legendre_p (3 , 2 , _f64_1d , branch_cut = _i64_1d , diff_n = 2 ), _Float1_D )
4552
4653# assoc_legendre_p_all
47- assert_type (assoc_legendre_p_all (3 , 2 , 1.0 ), onp .Array3D [np .float64 ])
48- assert_type (assoc_legendre_p_all (n = 3 , m = 2 , z = np .float32 (1.0 )), onp .Array3D [np .float64 ])
49- assert_type (assoc_legendre_p_all (3 , 2 , 1.0 , branch_cut = 3 , norm = True , diff_n = 1 ), onp .Array3D [np .float64 ])
50- assert_type (assoc_legendre_p_all (3 , 2 , np .float64 (1.0 ), branch_cut = 2 , diff_n = 2 ), onp .Array3D [np .float64 ])
54+ assert_type (assoc_legendre_p_all (3 , 2 , 1.0 ), _Float3_D )
55+ assert_type (assoc_legendre_p_all (n = 3 , m = 2 , z = np .float32 (1.0 )), _Float3_D )
56+ assert_type (assoc_legendre_p_all (n = 3 , m = 2 , z = _f64_1d ), _Float3_D )
57+ assert_type (assoc_legendre_p_all (3 , 2 , 1.0 , branch_cut = 3 , norm = True , diff_n = 1 ), _Float3_D )
58+ assert_type (assoc_legendre_p_all (3 , 2 , np .float64 (1.0 ), branch_cut = 2 , diff_n = 2 ), _Float3_D )
5159
5260# sph_legendre_p
5361assert_type (sph_legendre_p (3 , 2 , 1.0 ), onp .Array1D [np .float64 ])
5462assert_type (sph_legendre_p (n = 3 , m = 2 , theta = np .float32 (1.0 )), onp .Array1D [np .float64 ])
63+ assert_type (sph_legendre_p (n = 3 , m = 2 , theta = _f64_1d ), _Float2_D )
5564assert_type (sph_legendre_p (3 , 2 , 1.0 , diff_n = True ), onp .Array1D [np .float64 ])
5665assert_type (sph_legendre_p (3 , 2 , 1.0 , diff_n = 2 ), onp .Array1D [np .float64 ])
5766
5867# sph_legendre_p_all
5968assert_type (sph_legendre_p_all (3 , 2 , 1.0 ), onp .Array3D [np .float64 ])
6069assert_type (sph_legendre_p_all (n = 3 , m = 2 , theta = np .float32 (1.0 )), onp .Array3D [np .float64 ])
70+ assert_type (sph_legendre_p_all (n = 3 , m = 2 , theta = _f64_1d ), _Float3_D )
6171assert_type (sph_legendre_p_all (3 , 2 , 1.0 , diff_n = True ), onp .Array3D [np .float64 ])
6272assert_type (sph_legendre_p_all (3 , 2 , 1.0 , diff_n = 2 ), onp .Array3D [np .float64 ])
6373
6474# sph_harm_y
6575assert_type (sph_harm_y (3 , 2 , 1.0 , 2.0 ), _Complex0D )
6676assert_type (sph_harm_y (n = 3 , m = 2 , theta = np .float32 (1.0 ), phi = np .float32 (2.0 )), _Complex0D )
77+ assert_type (sph_harm_y (3 , 2 , 1.0 , _f64_1d ), _Complex1_D )
6778assert_type (sph_harm_y (3 , 2 , 1.0 , 2.0 , diff_n = False ), _Complex0D )
6879assert_type (sph_harm_y (3 , 2 , 1.0 , 2.0 , diff_n = 0 ), _Complex0D )
6980
7081# sph_harm_y_all
7182assert_type (sph_harm_y_all (3 , 2 , 1.0 , 2.0 ), _Complex2D )
7283assert_type (sph_harm_y_all (n = 3 , m = 2 , theta = np .float32 (1.0 ), phi = np .float32 (2.0 )), _Complex2D )
84+ assert_type (sph_harm_y_all (3 , 2 , 1.0 , _f64_1d ), _Complex3_D )
7385assert_type (sph_harm_y_all (3 , 2 , 1.0 , 2.0 , diff_n = False ), _Complex2D )
7486assert_type (sph_harm_y_all (3 , 2 , 1.0 , 2.0 , diff_n = 0 ), _Complex2D )
0 commit comments