diff --git a/.github/workflows/build_check.yml b/.github/workflows/build_check.yml index 783785782..b3944dfed 100644 --- a/.github/workflows/build_check.yml +++ b/.github/workflows/build_check.yml @@ -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 @@ -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 diff --git a/clmm/__init__.py b/clmm/__init__.py index 5a49715b9..16e6b9fec 100644 --- a/clmm/__init__.py +++ b/clmm/__init__.py @@ -27,4 +27,4 @@ ) from .utils import compute_radial_averages, convert_units, make_bins -__version__ = "1.16.7" +__version__ = "1.16.8" diff --git a/clmm/theory/parent_class.py b/clmm/theory/parent_class.py index 280bd2243..a2870b12d 100644 --- a/clmm/theory/parent_class.py +++ b/clmm/theory/parent_class.py @@ -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""" @@ -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""" @@ -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, @@ -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):