@@ -275,7 +275,9 @@ def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs):
275275 """
276276 ellip = self ._ellip (xp )
277277 factor = self .b0
278- zis = _ci05 (x = grid .array [:, 1 ], y = grid .array [:, 0 ], eps = ellip , rcore = self .ra , xp = xp )
278+ zis = _ci05 (
279+ x = grid .array [:, 1 ], y = grid .array [:, 0 ], eps = ellip , rcore = self .ra , xp = xp
280+ )
279281
280282 # This is in axes aligned to the major/minor axis
281283 deflection_x = zis .real
@@ -287,17 +289,13 @@ def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs):
287289 xp = xp ,
288290 ** kwargs ,
289291 )
290-
292+
291293 def _convergence (self , radii , xp = np ):
292294
293295 radsq = radii * radii
294296 a = self .ra
295297
296- return (
297- self .b0
298- / 2
299- * (1 / xp .sqrt (a ** 2 + radsq ))
300- )
298+ return self .b0 / 2 * (1 / xp .sqrt (a ** 2 + radsq ))
301299
302300 @aa .grid_dec .to_array
303301 @aa .grid_dec .transform
@@ -316,14 +314,14 @@ def convergence_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs):
316314 """
317315 ellip = self ._ellip (xp )
318316 grid_radii = xp .sqrt (
319- grid .array [:, 1 ] ** 2 / (1 + ellip ) ** 2 + grid .array [:, 0 ] ** 2 / (1 - ellip ) ** 2
317+ grid .array [:, 1 ] ** 2 / (1 + ellip ) ** 2
318+ + grid .array [:, 0 ] ** 2 / (1 - ellip ) ** 2
320319 )
321320 # Compute the convergence and deflection of a *circular* profile
322- kappa = self ._convergence (grid_radii ,xp )
321+ kappa = self ._convergence (grid_radii , xp )
323322
324323 return kappa
325324
326-
327325 @aa .grid_dec .transform
328326 def analytical_hessian_2d_from (self , grid : "aa.type.Grid2DLike" , xp = np , ** kwargs ):
329327 """
@@ -340,7 +338,12 @@ def analytical_hessian_2d_from(self, grid: "aa.type.Grid2DLike", xp=np, **kwargs
340338 ellip = self ._ellip ()
341339
342340 hessian_xx , hessian_xy , hessian_yx , hessian_yy = _mdci05 (
343- x = grid .array [:, 1 ], y = grid .array [:, 0 ], eps = ellip , rcore = self .ra , b0 = self .b0 , xp = xp
341+ x = grid .array [:, 1 ],
342+ y = grid .array [:, 0 ],
343+ eps = ellip ,
344+ rcore = self .ra ,
345+ b0 = self .b0 ,
346+ xp = xp ,
344347 )
345348
346349 return hessian_yy , hessian_xy , hessian_yx , hessian_xx
@@ -433,7 +436,7 @@ def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs):
433436 eps = ellip ,
434437 rcore = self .ra ,
435438 rcut = self .rs ,
436- xp = xp
439+ xp = xp ,
437440 )
438441
439442 # This is in axes aligned to the major/minor axis
@@ -476,11 +479,12 @@ def convergence_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs):
476479 """
477480 ellip = self ._ellip (xp )
478481 grid_radii = xp .sqrt (
479- grid .array [:, 1 ] ** 2 / (1 + ellip ) ** 2 + grid .array [:, 0 ] ** 2 / (1 - ellip ) ** 2
482+ grid .array [:, 1 ] ** 2 / (1 + ellip ) ** 2
483+ + grid .array [:, 0 ] ** 2 / (1 - ellip ) ** 2
480484 )
481- kappa = self ._convergence (grid_radii ,xp )
485+ kappa = self ._convergence (grid_radii , xp )
482486 return kappa
483-
487+
484488 @aa .grid_dec .transform
485489 def analytical_hessian_2d_from (self , grid : "aa.type.Grid2DLike" , xp = np , ** kwargs ):
486490 """
@@ -499,10 +503,20 @@ def analytical_hessian_2d_from(self, grid: "aa.type.Grid2DLike", xp=np, **kwargs
499503
500504 t05 = self .rs / (self .rs - self .ra )
501505 g05c_a , g05c_b , g05c_c , g05c_d = _mdci05 (
502- x = grid .array [:, 1 ], y = grid .array [:, 0 ], eps = ellip , rcore = self .ra , b0 = self .b0 , xp = xp
506+ x = grid .array [:, 1 ],
507+ y = grid .array [:, 0 ],
508+ eps = ellip ,
509+ rcore = self .ra ,
510+ b0 = self .b0 ,
511+ xp = xp ,
503512 )
504513 g05cut_a , g05cut_b , g05cut_c , g05cut_d = _mdci05 (
505- x = grid .array [:, 1 ], y = grid .array [:, 0 ], eps = ellip , rcore = self .rs , b0 = self .b0 , xp = xp
514+ x = grid .array [:, 1 ],
515+ y = grid .array [:, 0 ],
516+ eps = ellip ,
517+ rcore = self .rs ,
518+ b0 = self .b0 ,
519+ xp = xp ,
506520 )
507521
508522 # Compute Hessian matrix components
@@ -619,7 +633,7 @@ def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs):
619633 xp = xp ,
620634 ** kwargs ,
621635 )
622-
636+
623637 @aa .grid_dec .to_array
624638 @aa .grid_dec .transform
625639 def convergence_2d_from (self , grid : aa .type .Grid2DLike , xp = np , ** kwargs ):
0 commit comments