Skip to content

Commit ea48f99

Browse files
author
NiekWielders
committed
use of inheritance and test fix
1 parent c271d85 commit ea48f99

2 files changed

Lines changed: 6 additions & 21 deletions

File tree

autogalaxy/profiles/mass/dark/cnfw_mcr.py

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
from autogalaxy.profiles.mass.dark.cnfw import (cNFW, cNFWSph)
44
from autogalaxy.profiles.mass.dark.cnfw_mcr_scatter import (
5+
cNFWMCRScatterLudlow,
56
cNFWMCRScatterLudlowSph,
67
)
78

89
from autogalaxy.profiles.mass.dark import mcr_util
910

10-
class cNFWMCRLudlow(cNFW):
11+
class cNFWMCRLudlow(cNFWMCRScatterLudlow):
1112
def __init__(
1213
self,
1314
centre: Tuple[float, float] = (0.0, 0.0),
@@ -17,32 +18,16 @@ def __init__(
1718
redshift_object: float = 0.5,
1819
redshift_source: float = 1.0,
1920
):
20-
self.mass_at_200 = mass_at_200
21-
self.f_c = f_c
22-
self.redshift_object = redshift_object
23-
self.redshift_source = redshift_source
24-
25-
(
26-
kappa_s,
27-
scale_radius,
28-
core_radius,
29-
radius_at_200,
30-
) = mcr_util.kappa_s_scale_radius_and_core_radius_for_ludlow(
21+
super().__init__(
22+
centre=centre,
23+
ell_comps=ell_comps,
3124
mass_at_200=mass_at_200,
3225
scatter_sigma=0.0,
3326
f_c=f_c,
3427
redshift_object=redshift_object,
3528
redshift_source=redshift_source,
3629
)
3730

38-
super().__init__(
39-
centre=centre,
40-
ell_comps=ell_comps,
41-
kappa_s=kappa_s,
42-
scale_radius=scale_radius,
43-
core_radius=core_radius,
44-
)
45-
4631
class cNFWMCRLudlowSph(cNFWMCRScatterLudlowSph):
4732
def __init__(
4833
self,

test_autogalaxy/profiles/mass/dark/test_nfw_mcr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ def test__same_as_above_but_cored_nfw():
315315

316316
assert mp.axis_ratio() == cnfw_kappa_s.axis_ratio()
317317

318-
assert mp.angle() == 0.0
318+
assert mp.angle() == cnfw_kappa_s.angle()
319319

320320
assert mp.scale_radius == pytest.approx(0.21158, 1.0e-4)
321321

0 commit comments

Comments
 (0)