Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if not massdef in self.mdef_dict:
raise ValueError (f"Halo density profile mass definition {massdef} not currently supported")
# Check if we have already an instance of the required object, if not create one
if not ((halo_profile_model == self.halo_profile_model) and (massdef == self.massdef) and (delta_mdef == self.delta_mdef)):
self.halo_profile_model = halo_profile_model
self.massdef = massdef
cur_cdelta = 0.0
cur_mdelta = 0.0
cur_values = False
if self.hdpm:
cur_cdelta = self.conc.c
cur_values = True
self.mdef = ccl.halos.MassDef (delta_mdef, self.mdef_dict[massdef])
self.conc = ccl.halos.ConcentrationConstant (self.mdef)
self.mdef.concentration = self.conc
self.hdpm = self.hdpm_dict[halo_profile_model] (self.conc, **self.hdpm_opts[halo_profile_model])
if cur_values:
self.conc.c = cur_cdelta