From b7907a2df7aa7b063e9fe82056a4a7f75ec69ec6 Mon Sep 17 00:00:00 2001 From: Michel Aguena Date: Sun, 30 Nov 2025 18:01:52 +0100 Subject: [PATCH 1/5] make CLMModeling.validate_input an attribute --- clmm/theory/parent_class.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/clmm/theory/parent_class.py b/clmm/theory/parent_class.py index 280bd2243..8e24ac425 100644 --- a/clmm/theory/parent_class.py +++ b/clmm/theory/parent_class.py @@ -82,13 +82,20 @@ 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): + """Mass of cluster""" + return self.__validate_input + @property def mdelta(self): """Mass of cluster""" @@ -116,6 +123,13 @@ def halo_profile_model(self): # 1.a Object properties setter + @validate_input.setter + def validate_input(self, validate_input): + """Mass of cluster""" + 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""" From 1efe19d727584c8f1a1a2aa74306945d1a83b198 Mon Sep 17 00:00:00 2001 From: Michel Aguena Date: Sun, 30 Nov 2025 18:04:54 +0100 Subject: [PATCH 2/5] rm CLMModeling._set_cosmo --- clmm/theory/parent_class.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/clmm/theory/parent_class.py b/clmm/theory/parent_class.py index 8e24ac425..600a8c4bf 100644 --- a/clmm/theory/parent_class.py +++ b/clmm/theory/parent_class.py @@ -88,7 +88,6 @@ def __init__(self, validate_input=True, z_inf=1000): self.__validate_input = True self.validate_input = validate_input - # 1. Object properties @property @@ -219,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, @@ -505,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): From fa1a2594ee67776b86199aea59c868a299a79bfa Mon Sep 17 00:00:00 2001 From: Michel Aguena Date: Wed, 3 Dec 2025 16:54:58 +0100 Subject: [PATCH 3/5] update docstrings --- clmm/theory/parent_class.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clmm/theory/parent_class.py b/clmm/theory/parent_class.py index 600a8c4bf..a2870b12d 100644 --- a/clmm/theory/parent_class.py +++ b/clmm/theory/parent_class.py @@ -92,7 +92,7 @@ def __init__(self, validate_input=True, z_inf=1000): @property def validate_input(self): - """Mass of cluster""" + """Input format check""" return self.__validate_input @property @@ -124,7 +124,7 @@ def halo_profile_model(self): @validate_input.setter def validate_input(self, validate_input): - """Mass of cluster""" + """Set input format check""" self.__validate_input = validate_input if self.cosmo is not None: self.cosmo.validate_input = validate_input From 2698b889aa29a1c707e28d2d6a50a054fea54c9f Mon Sep 17 00:00:00 2001 From: Michel Aguena Date: Wed, 3 Dec 2025 16:55:26 +0100 Subject: [PATCH 4/5] update version --- clmm/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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" From 5225d29dce229edc20a03f3d964ba4f20f995fed Mon Sep 17 00:00:00 2001 From: Michel Aguena Date: Wed, 3 Dec 2025 17:15:54 +0100 Subject: [PATCH 5/5] fix sphinx version to 8.2.3 --- .github/workflows/build_check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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