@@ -122,7 +122,9 @@ def __init__(
122
122
) -> None :
123
123
# compute the r-dependent coefficient matrix $\tilde{\rho}$
124
124
nmax , lmax = pot ._Acos .shape [:2 ]
125
- rhoTilde = np .array ([pot ._rhoTilde (r , N = nmax , L = lmax ) for r in rgrid ]) # (R, N, L)
125
+ rhoTilde = np .array (
126
+ [pot ._rhoTilde (r , N = nmax , L = lmax ) for r in rgrid ],
127
+ ) # (R, N, L)
126
128
127
129
# ----------
128
130
# theta Qls
@@ -134,7 +136,13 @@ def __init__(
134
136
# phi Rm, Sm
135
137
# radial and inclination sums
136
138
137
- Rm , Sm = _phiRSms (rhoTilde , Acos = pot ._Acos , Asin = pot ._Asin , r = rgrid , theta = thetagrid )
139
+ Rm , Sm = _phiRSms (
140
+ rhoTilde ,
141
+ Acos = pot ._Acos ,
142
+ Asin = pot ._Asin ,
143
+ r = rgrid ,
144
+ theta = thetagrid ,
145
+ )
138
146
139
147
# ----------
140
148
# make samplers
@@ -184,8 +192,18 @@ def __init__(self, pot: SCFPotential, rgrid: NDArray64, **kw: T.Any) -> None:
184
192
# work in zeta, not r, since it is more numerically stable
185
193
zeta = zeta_of_r (rgrid )
186
194
# make splines for fast calculation
187
- self ._spl_cdf = InterpolatedUnivariateSpline (zeta , mgrid , ext = "raise" , bbox = [- 1 , 1 ])
188
- self ._spl_ppf = InterpolatedUnivariateSpline (mgrid , zeta , ext = "raise" , bbox = [0 , 1 ])
195
+ self ._spl_cdf = InterpolatedUnivariateSpline (
196
+ zeta ,
197
+ mgrid ,
198
+ ext = "raise" ,
199
+ bbox = [- 1 , 1 ],
200
+ )
201
+ self ._spl_ppf = InterpolatedUnivariateSpline (
202
+ mgrid ,
203
+ zeta ,
204
+ ext = "raise" ,
205
+ bbox = [0 , 1 ],
206
+ )
189
207
190
208
# TODO! make sure
191
209
# # store endpoint values to ensure CDF normalized to [0, 1]
@@ -479,7 +497,9 @@ def __init__(
479
497
# start by supersampling
480
498
Zetas , Xs , Phis = np .meshgrid (zetas , xs , self ._phi_interpolant , indexing = "ij" )
481
499
_cdfs = self ._spl_cdf ((Zetas .ravel (), Xs .ravel (), Phis .ravel ())).reshape (
482
- lR , lT , len (self ._phi_interpolant )
500
+ lR ,
501
+ lT ,
502
+ len (self ._phi_interpolant ),
483
503
)
484
504
# build reverse spline
485
505
ppfs = np .empty ((lR , lT , self ._ninterpolant ), dtype = np .float64 )
@@ -488,7 +508,9 @@ def __init__(
488
508
ppfs [i , j , :] = splev (qarr , spl , ext = 0 )
489
509
# interpolate
490
510
self ._spl_ppf = RegularGridInterpolator (
491
- (zetas , xs , self ._q_interpolant ), ppfs , bounds_error = False
511
+ (zetas , xs , self ._q_interpolant ),
512
+ ppfs ,
513
+ bounds_error = False ,
492
514
)
493
515
494
516
# /def
@@ -505,7 +527,12 @@ def _cdf(
505
527
506
528
# /def
507
529
508
- def cdf (self , phi : npt .ArrayLike , r : npt .ArrayLike , theta : npt .ArrayLike ) -> NDArray64 :
530
+ def cdf (
531
+ self ,
532
+ phi : npt .ArrayLike ,
533
+ r : npt .ArrayLike ,
534
+ theta : npt .ArrayLike ,
535
+ ) -> NDArray64 :
509
536
# TODO! make sure r, theta in right domain
510
537
cdf = self ._cdf (
511
538
phi ,
0 commit comments