Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Install prereq and NumCosmo using conda
run: |
echo "$CONDA/bin" >> $GITHUB_PATH
conda install -c conda-forge gobject-introspection pygobject 'numcosmo<=0.22.0' cmake swig setuptools_scm sphinx sphinx_rtd_theme nbconvert pandoc ipython
conda install -c conda-forge gobject-introspection pygobject 'numcosmo<=0.22.0' cmake swig setuptools_scm sphinx=8.2.3 sphinx_rtd_theme nbconvert pandoc ipython
- name: Install prereq using pip
run: |
pip install -r requirements.txt
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
- name: Install prereq and NumCosmo using conda
run: |
echo "$CONDA/bin" >> $GITHUB_PATH
conda install -c conda-forge gobject-introspection pygobject 'numcosmo<=0.22.0' cmake swig setuptools_scm sphinx sphinx_rtd_theme nbconvert pandoc ipython
conda install -c conda-forge gobject-introspection pygobject 'numcosmo<=0.22.0' cmake swig setuptools_scm
- name: Install prereq using pip
run: |
pip install -r requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion clmm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@
)
from .utils import compute_radial_averages, convert_units, make_bins

__version__ = "1.16.7"
__version__ = "1.16.8"
21 changes: 15 additions & 6 deletions clmm/theory/parent_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,19 @@ def __init__(self, validate_input=True, z_inf=1000):
self.mdef_dict = {}
self.hdpm_dict = {}

self.validate_input = validate_input
self.cosmo_class = lambda *args: None

self.z_inf = z_inf
self.__validate_input = True
self.validate_input = validate_input

# 1. Object properties

@property
def validate_input(self):
"""Input format check"""
return self.__validate_input

@property
def mdelta(self):
"""Mass of cluster"""
Expand Down Expand Up @@ -116,6 +122,13 @@ def halo_profile_model(self):

# 1.a Object properties setter

@validate_input.setter
def validate_input(self, validate_input):
"""Set input format check"""
self.__validate_input = validate_input
if self.cosmo is not None:
self.cosmo.validate_input = validate_input

@mdelta.setter
def mdelta(self, mdelta):
"""Set mass of cluster"""
Expand Down Expand Up @@ -205,10 +218,6 @@ def _eval_excess_surface_density(self, r_proj, z_cl):

# 3. Functions that can be used by all subclasses

def _set_cosmo(self, cosmo):
r"""Sets the cosmology to the internal cosmology object"""
self.cosmo = cosmo if cosmo is not None else self.cosmo_class()

def _eval_2halo_term_generic(
self,
sph_harm_ord,
Expand Down Expand Up @@ -491,7 +500,7 @@ def set_cosmo(self, cosmo):
if self.cosmo_class() is None:
raise NotImplementedError
validate_argument(locals(), "cosmo", self.cosmo_class, none_ok=True)
self._set_cosmo(cosmo)
self.cosmo = cosmo if cosmo is not None else self.cosmo_class()
self.cosmo.validate_input = self.validate_input

def set_halo_density_profile(self, halo_profile_model="nfw", massdef="mean", delta_mdef=200):
Expand Down
Loading