Skip to content

Commit

Permalink
Update virial massdef
Browse files Browse the repository at this point in the history
  • Loading branch information
hsinfan1996 committed Aug 6, 2023
1 parent ea68986 commit 48de643
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions clmm/theory/ccl.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,8 @@ def _update_halo_density_profile(self):
"""updates halo density profile with set internal properties"""
# prepare mdef object
if self.massdef == "virial":
self.mdef = ccl.halos.MassDef("vir", self.mdef_dict[self.massdef])
else:
self.mdef = ccl.halos.MassDef(self.delta_mdef, self.mdef_dict[self.massdef])
self.__delta_mdef = "vir"
self.mdef = ccl.halos.MassDef(self.delta_mdef, self.mdef_dict[self.massdef])
# setting concentration (also updates hdpm)
self.cdelta = self.cdelta if self.hdpm else 4.0 # ccl always needs an input concentration

Expand Down
4 changes: 2 additions & 2 deletions tests/test_theory_parent.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ def test_instantiate(modeling_data):

if theo.be_nick in ["nc", "ccl"]:
mod.set_halo_density_profile(massdef="virial")
assert_equal(mod.massdef, "virial")
assert_equal(mod.delta_mdef, "vir")

# reset
mod.massdef = "mean"

mod.massdef = "virial"
assert_equal(mod.massdef, "virial")
assert_equal(mod.delta_mdef, "vir")

if theo.be_nick == "nc":
import gi
Expand Down

0 comments on commit 48de643

Please sign in to comment.