From c835c4916e70131f804b5dc777b92601cc015f42 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Fri, 12 May 2023 14:00:40 +0800 Subject: [PATCH 01/64] Update for CCL v3 --- clmm/cosmology/ccl.py | 2 +- clmm/theory/ccl.py | 16 +++++++--------- tests/test_mockdata.py | 2 ++ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/clmm/cosmology/ccl.py b/clmm/cosmology/ccl.py index 3ad9950bb..62d1237a3 100644 --- a/clmm/cosmology/ccl.py +++ b/clmm/cosmology/ccl.py @@ -106,7 +106,7 @@ def _eval_sigma_crit_core(self, z_len, z_src): a_len = self.get_a_from_z(z_len) a_src = self.get_a_from_z(z_src) - return self.be_cosmo.sigma_critical(a_len, a_src)*self.cor_factor + return self.be_cosmo.sigma_critical(a_lens=a_len, a_source=a_src)*self.cor_factor def _eval_linear_matter_powerspectrum(self, k_vals, redshift): return ccl.linear_matter_power( diff --git a/clmm/theory/ccl.py b/clmm/theory/ccl.py index 09e71f24b..53c06be78 100644 --- a/clmm/theory/ccl.py +++ b/clmm/theory/ccl.py @@ -88,9 +88,6 @@ def _update_halo_density_profile(self): """"updates halo density profile with set internal properties""" # prepare mdef object self.mdef = ccl.halos.MassDef(self.delta_mdef, self.mdef_dict[self.massdef]) - # adjust it for ccl version > 2.6.1 - if parse(ccl.__version__) >= parse('2.6.2dev7'): - ccl.UnlockInstance.Funlock(type(self.mdef), "_concentration_init", True) # setting concentration (also updates hdpm) self.cdelta = self.cdelta if self.hdpm else 4.0 # ccl always needs an input concentration @@ -104,10 +101,11 @@ def _get_mass(self): def _set_concentration(self, cdelta): """"set concentration. Also sets/updates hdpm""" - self.conc = ccl.halos.ConcentrationConstant(c=cdelta, mdef=self.mdef) - self.mdef._concentration_init(self.conc) + self.conc = ccl.halos.ConcentrationConstant(c=cdelta, mass_def=self.mdef) + with ccl.UnlockInstance(self.mdef): + self.mdef.concentration = self.conc self.hdpm = self.hdpm_dict[self.halo_profile_model]( - self.conc, **self.hdpm_opts[self.halo_profile_model]) + concentration=self.conc, **self.hdpm_opts[self.halo_profile_model]) self.hdpm.update_precision_fftlog( padding_lo_fftlog=1e-4, padding_hi_fftlog=1e3) @@ -127,7 +125,7 @@ def _get_einasto_alpha(self, z_cl=None): a_cl = 1 # a_cl does not matter in this case else: a_cl = self.cosmo.get_a_from_z(z_cl) - return self.hdpm._get_alpha(self.cosmo.be_cosmo, self.__mdelta_cor, a_cl, self.mdef) + return self.hdpm._get_alpha(self.cosmo.be_cosmo, self.__mdelta_cor, a_cl) def _eval_3d_density(self, r3d, z_cl): """"eval 3d density""" @@ -169,7 +167,7 @@ def _call_ccl_profile_lens(self, ccl_hdpm_func, radius, z_lens, ndim=2): a_lens = self.cosmo.get_a_from_z(z_lens) return ccl_hdpm_func(self.cosmo.be_cosmo, radius/a_lens, self.__mdelta_cor, - a_lens, self.mdef)*self.cor_factor/a_lens**ndim + a_lens)*self.cor_factor/a_lens**ndim def _call_ccl_profile_lens_src(self, ccl_hdpm_func, radius, z_lens, z_src): """"call ccl profile functions that depend on the lens and the sources""" @@ -177,6 +175,6 @@ def _call_ccl_profile_lens_src(self, ccl_hdpm_func, radius, z_lens, z_src): a_src = self.cosmo.get_a_from_z(z_src) return ccl_hdpm_func(self.cosmo.be_cosmo, radius/a_lens, self.__mdelta_cor, - a_lens, a_src, self.mdef) + a_lens=a_lens, a_source=a_src) Modeling = CCLCLMModeling diff --git a/tests/test_mockdata.py b/tests/test_mockdata.py index 95a57b5a6..82ef2aa35 100644 --- a/tests/test_mockdata.py +++ b/tests/test_mockdata.py @@ -30,6 +30,8 @@ def test_mock_data(): with warnings.catch_warnings(record=True) as warn: # Cause all warnings to always be triggered. warnings.simplefilter("always") + # Filter out warnings from CCL + warnings.filterwarnings("ignore", module='.*(pyccl).*') # Trigger a warning. np.random.seed(314) mock.generate_galaxy_catalog( From 324d6d3cff60a7b9e565a9b1a2cf63f8f6c0501a Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Wed, 14 Jun 2023 00:49:48 +0800 Subject: [PATCH 02/64] Update CCL version numbers --- INSTALL.md | 2 +- README.md | 2 +- clmm/theory/_ccl_supported_versions.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 56d21be17..16df96a02 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -18,7 +18,7 @@ To create a specific conda environment for CLMM, we recommend you to check the b ### Theory backend installation First, choose and install a theory backend for CLMM. -This can be CCL (versions between 2.6.0 and 2.7.1.dev9+g1a351df6), +This can be CCL (versions between 2.7.1.dev10+gf81b59a4 and 3), NumCosmo (v0.15 or later), or cluster_toolkit and they are installable as follows. diff --git a/README.md b/README.md index 04228a536..e05debf93 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ CLMM requires Python version 3.8 or later. CLMM has the following dependencies: For the theoretical predictions of the signal, CLMM relies on existing libraries and **at least one of the following must be installed as well**: - [cluster-toolkit](https://cluster-toolkit.readthedocs.io/en/latest/) -- [CCL](https://ccl.readthedocs.io/en/latest/) (versions between 2.6.0 and 2.7.1.dev9+g1a351df6) +- [CCL](https://ccl.readthedocs.io/en/latest/) (versions between 2.7.1.dev10+gf81b59a4 and 3) - [NumCosmo](https://numcosmo.github.io/) (v0.15 or later) diff --git a/clmm/theory/_ccl_supported_versions.py b/clmm/theory/_ccl_supported_versions.py index 52ab799ff..3fa3adaf9 100644 --- a/clmm/theory/_ccl_supported_versions.py +++ b/clmm/theory/_ccl_supported_versions.py @@ -1,5 +1,5 @@ """@file _ccl_supported_versions.py Versions of CCL supported by the current CLMM version """ -VMIN = '2.6.0' -VMAX = '2.7.1.dev9+g1a351df6' +VMIN = '2.7.1.dev10+gf81b59a4' +VMAX = '3' From ffd3978091d094470fa9baf336c74959c615a0f2 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Wed, 14 Jun 2023 00:50:18 +0800 Subject: [PATCH 03/64] Update to CCL v3 api --- clmm/theory/ccl.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/clmm/theory/ccl.py b/clmm/theory/ccl.py index 7e502411c..96be69391 100644 --- a/clmm/theory/ccl.py +++ b/clmm/theory/ccl.py @@ -117,7 +117,8 @@ def _set_concentration(self, cdelta): with ccl.UnlockInstance(self.mdef): self.mdef.concentration = self.conc self.hdpm = self.hdpm_dict[self.halo_profile_model]( - concentration=self.conc, **self.hdpm_opts[self.halo_profile_model]) + concentration=self.conc, mass_def=self.mdef, + **self.hdpm_opts[self.halo_profile_model]) self.hdpm.update_precision_fftlog( padding_lo_fftlog=1e-4, padding_hi_fftlog=1e3) @@ -186,7 +187,6 @@ def _call_ccl_profile_lens(self, ccl_hdpm_func, radius, z_lens, ndim=2): radius / a_lens, self.__mdelta_cor, a_lens, - self.mdef, ) * self.cor_factor / a_lens**ndim @@ -201,9 +201,8 @@ def _call_ccl_profile_lens_src(self, ccl_hdpm_func, radius, z_lens, z_src): self.cosmo.be_cosmo, radius / a_lens, self.__mdelta_cor, - a_lens, - a_src, - self.mdef, + a_lens=a_lens, + a_source=a_src, ) From 212c7f1bb358bd37bc4c40a9bde059fe66c7b20d Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Wed, 14 Jun 2023 00:51:28 +0800 Subject: [PATCH 04/64] Install latest CCL --- .github/workflows/build_check.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build_check.yml b/.github/workflows/build_check.yml index cd2c2d4fe..51f881b2a 100644 --- a/.github/workflows/build_check.yml +++ b/.github/workflows/build_check.yml @@ -36,7 +36,6 @@ jobs: conda install -c conda-forge cmake swig git clone https://github.com/LSSTDESC/CCL cd CCL - git checkout 1a351df pip install . - name: Analysing the code with pylint run: | From 9fd472eb84c3fe4e21adec3e841d987924973227 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Wed, 14 Jun 2023 00:59:41 +0800 Subject: [PATCH 05/64] Fix docs compiling --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index a91ddf9e8..bfafb1750 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -20,7 +20,7 @@ # Fix for ccl sys.modules["pyccl"].Cosmology = MagicMock -sys.modules["pyccl"].__version__ = "2.6" +sys.modules["pyccl"].__version__ = "3" # Fix for numcosmo sys.modules["gi.repository"].NumCosmo.Distance = MagicMock From 7bfcc0443a301b86abbb2c7e992fbec42ff06c37 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Wed, 14 Jun 2023 01:47:16 +0800 Subject: [PATCH 06/64] Remove warning filter --- examples/demo_mass_conversion.ipynb | 3 --- examples/demo_mock_cluster.ipynb | 3 --- examples/demo_theory_functionality.ipynb | 3 --- examples/demo_theory_functionality_diff_z_types.ipynb | 3 --- examples/demo_theory_functionality_oo.ipynb | 11 ----------- 5 files changed, 23 deletions(-) diff --git a/examples/demo_mass_conversion.ipynb b/examples/demo_mass_conversion.ipynb index 71308a80c..3cb6e9aa8 100644 --- a/examples/demo_mass_conversion.ipynb +++ b/examples/demo_mass_conversion.ipynb @@ -21,9 +21,6 @@ "os.environ[\n", " \"CLMM_MODELING_BACKEND\"\n", "] = \"ccl\" # here you may choose ccl, nc (NumCosmo) or ct (cluster_toolkit)\n", - "import warnings\n", - "\n", - "warnings.filterwarnings(\"ignore\", message=\".*(!).*\")\n", "import clmm\n", "import numpy as np\n", "import matplotlib.pyplot as plt" diff --git a/examples/demo_mock_cluster.ipynb b/examples/demo_mock_cluster.ipynb index 098284eb0..55a4e2bf6 100644 --- a/examples/demo_mock_cluster.ipynb +++ b/examples/demo_mock_cluster.ipynb @@ -24,9 +24,6 @@ "metadata": {}, "outputs": [], "source": [ - "import warnings\n", - "\n", - "warnings.filterwarnings(\"ignore\", message=\".*(!).*\")\n", "import os\n", "\n", "## Uncomment the following line if you want to use a specific modeling backend among 'ct' (cluster-toolkit), 'ccl' (CCL) or 'nc' (Numcosmo). Default is 'ccl'\n", diff --git a/examples/demo_theory_functionality.ipynb b/examples/demo_theory_functionality.ipynb index c800d5811..81b244d38 100644 --- a/examples/demo_theory_functionality.ipynb +++ b/examples/demo_theory_functionality.ipynb @@ -47,9 +47,6 @@ "metadata": {}, "outputs": [], "source": [ - "import warnings\n", - "\n", - "warnings.filterwarnings(\"ignore\", message=\".*(!).*\")\n", "import os\n", "\n", "os.environ[\n", diff --git a/examples/demo_theory_functionality_diff_z_types.ipynb b/examples/demo_theory_functionality_diff_z_types.ipynb index fd50854f8..61f3e275e 100644 --- a/examples/demo_theory_functionality_diff_z_types.ipynb +++ b/examples/demo_theory_functionality_diff_z_types.ipynb @@ -28,9 +28,6 @@ "metadata": {}, "outputs": [], "source": [ - "import warnings\n", - "\n", - "warnings.filterwarnings(\"ignore\", message=\".*(!).*\")\n", "import os\n", "\n", "## Uncomment the following line if you want to use a specific modeling backend among 'ct' (cluster-toolkit), 'ccl' (CCL) or 'nc' (Numcosmo). Default is 'ccl'\n", diff --git a/examples/demo_theory_functionality_oo.ipynb b/examples/demo_theory_functionality_oo.ipynb index 27ad45bd9..322718713 100644 --- a/examples/demo_theory_functionality_oo.ipynb +++ b/examples/demo_theory_functionality_oo.ipynb @@ -16,17 +16,6 @@ "This notebook goes through the steps to generate model data for galaxy cluster weak lensing observables. In particular, we define a galaxy cluster model that follows and NFW distribution and generate various profiles for the model (mass density, convergence, shear, etc.), which we plot. Note, a full pipeline to measure a galaxy cluster weak lensing mass requires fitting the observed (or mock) data to a model. In this notebook we use the OO interface to theory." ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import warnings\n", - "\n", - "warnings.filterwarnings(\"ignore\", message=\".*(!).*\")" - ] - }, { "cell_type": "code", "execution_count": null, From cc9e339f803fb14609f84d98bbc1185c96f7ece6 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Wed, 14 Jun 2023 01:57:59 +0800 Subject: [PATCH 07/64] Remove warning filter --- tests/test_mockdata.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/test_mockdata.py b/tests/test_mockdata.py index 2e729dac8..d5b77cf9b 100644 --- a/tests/test_mockdata.py +++ b/tests/test_mockdata.py @@ -31,8 +31,6 @@ def test_mock_data(): with warnings.catch_warnings(record=True) as warn: # Cause all warnings to always be triggered. warnings.simplefilter("always") - # Filter out warnings from CCL - warnings.filterwarnings("ignore", module='.*(pyccl).*') # Trigger a warning. np.random.seed(314) mock.generate_galaxy_catalog(1e15, 0.3, 4, cosmo, 0.30001, ngals=1000, nretry=0) From f96f43265a0dee653e4e28e0197bbd24b04ed208 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Fri, 30 Jun 2023 01:32:07 +0800 Subject: [PATCH 08/64] Update generate_einasto_hernquist_benchmarks_fromNC.ipynb --- ..._einasto_hernquist_benchmarks_fromNC.ipynb | 16 +- .../data/numcosmo/radial_profiles_einasto.txt | 200 +++++++++--------- 2 files changed, 108 insertions(+), 108 deletions(-) diff --git a/tests/data/numcosmo/generate_einasto_hernquist_benchmarks_fromNC.ipynb b/tests/data/numcosmo/generate_einasto_hernquist_benchmarks_fromNC.ipynb index d7c41f1ea..aeaf5e279 100644 --- a/tests/data/numcosmo/generate_einasto_hernquist_benchmarks_fromNC.ipynb +++ b/tests/data/numcosmo/generate_einasto_hernquist_benchmarks_fromNC.ipynb @@ -116,16 +116,16 @@ "metadata": {}, "outputs": [], "source": [ + "mdef = ccl.halos.MassDef(mass_Delta, 'matter')\n", + "conc = ccl.halos.ConcentrationConstant(c=cluster_concentration, mass_def=mdef)\n", "ccl_ein = ccl.halos.HaloProfileEinasto(\n", - " ccl.halos.ConcentrationConstant(cluster_concentration), truncated=False\n", + " mass_def=mdef,\n", + " concentration=conc\n", ")\n", "alpha_einasto = ccl_ein._get_alpha(\n", " cosmo_ccl.be_cosmo,\n", " cluster_mass,\n", - " 1 / (1 + z_cluster),\n", - " ccl.halos.massdef.MassDef(\n", - " mass_Delta, \"matter\", ccl.halos.ConcentrationConstant(cluster_concentration)\n", - " ),\n", + " 1 / (1 + z_cluster)\n", ")\n", "print(alpha_einasto)" ] @@ -667,9 +667,9 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3.11", "language": "python", - "name": "python3" + "name": "python3.11" }, "language_info": { "codemirror_mode": { @@ -681,7 +681,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.10" + "version": "3.11.4" } }, "nbformat": 4, diff --git a/tests/data/numcosmo/radial_profiles_einasto.txt b/tests/data/numcosmo/radial_profiles_einasto.txt index fc4278950..6a51529a6 100644 --- a/tests/data/numcosmo/radial_profiles_einasto.txt +++ b/tests/data/numcosmo/radial_profiles_einasto.txt @@ -1,101 +1,101 @@ # r3d rho Sigma DeltaSigma gammat kappa gt mu -1.000000000000000021e-02 2.623669635761697600e+16 3.189196070450592500e+15 1.276027514275365000e+14 4.687611461572240013e-02 1.171582264943169527e+00 -2.731990665308467459e-01 3.670653746217076474e+01 -1.072267222010323158e-02 2.529093035647578800e+16 3.163569518777162000e+15 1.349153969309525000e+14 4.956248622548301702e-02 1.162168101376863882e+00 -3.056241381916684485e-01 4.194269668572388809e+01 -1.149756995397735633e-02 2.435596729001030400e+16 3.136611589052279000e+15 1.425186873425165000e+14 5.235562907547475914e-02 1.152264843105008874e+00 -3.438458150143563485e-01 4.891537361813954021e+01 -1.232846739442065853e-02 2.343257807453348000e+16 3.108282567296658000e+15 1.504117209231940000e+14 5.525521190307310093e-02 1.141857900810179904e+00 -3.895109936598458167e-01 5.858050446802359090e+01 -1.321941148466028795e-02 2.252152478078229600e+16 3.078544381651209000e+15 1.585924159268260000e+14 5.826046995853354643e-02 1.130933288423813465e+00 -4.449630087190075689e-01 7.273127343561974101e+01 -1.417474162926805545e-02 2.162355818454726400e+16 3.047360932014807000e+15 1.670568495043020000e+14 6.136996214499520347e-02 1.119477744221855531e+00 -5.136518315163234316e-01 9.515961926913431057e+01 -1.519911082952933937e-02 2.073941526177878000e+16 3.014698448768282500e+15 1.757996073026140000e+14 6.458169944710116794e-02 1.107478862605516090e+00 -6.008781436787062891e-01 1.354846488476142667e+02 -1.629750834620644420e-02 1.986981663917872800e+16 2.980525862127245000e+15 1.848134481612495000e+14 6.789302175394992811e-02 1.094925229786629428e+00 -7.152263092389454791e-01 2.272036962235203532e+02 -1.747528400007683849e-02 1.901546401236826400e+16 2.944815185225114000e+15 1.940890326809820000e+14 7.130049814619464355e-02 1.081806564516939240e+00 -8.715742870663030217e-01 6.216767638485522411e+02 -1.873817422860384052e-02 1.817703754478220800e+16 2.907541904333967500e+15 2.036152523729590000e+14 7.480004781216917364e-02 1.068113861439532464e+00 -1.098161904659774590e+00 -1.046518771919829305e+03 -2.009233002565046985e-02 1.735519326146843600e+16 2.868685386511499000e+15 2.133785650990380000e+14 7.838669591541733150e-02 1.053839540841921663e+00 -1.455931731393632633e+00 -3.080925494466385430e+02 -2.154434690031884619e-02 1.655056045294933200e+16 2.828229300832023500e+15 2.233633106312910000e+14 8.205468951855299231e-02 1.038977603399361627e+00 -2.105175340767534209e+00 -1.918016860705505735e+02 -2.310129700083160542e-02 1.576373910521795400e+16 2.786162038713962000e+15 2.335514940323845000e+14 8.579741800593103374e-02 1.023523784586248375e+00 -3.647262526629580837e+00 -1.468897168460559328e+02 -2.477076355991711387e-02 1.499529737277655800e+16 2.742477134074154000e+15 2.439224672885610000e+14 8.960729612841962510e-02 1.007475709023901045e+00 -1.198646119611277783e+01 -1.254141599770154301e+02 -2.656087782946686682e-02 1.424576911236377400e+16 2.697173674733401000e+15 2.544533472946065000e+14 9.347591755425260773e-02 9.908330416143988906e-01 1.019704831442042980e+01 -1.155573197559476739e+02 -2.848035868435801893e-02 1.351565149563965400e+16 2.650256718901206500e+15 2.651184282870765000e+14 9.739383902064741028e-02 9.735976405403109490e-01 3.688830885336158438e+00 -1.137853798902582696e+02 -3.053855508833415444e-02 1.280540271958951800e+16 2.601737698511904000e+15 2.758894914310720000e+14 1.013506940635251069e-01 9.557737054341537419e-01 2.291638832926190084e+00 -1.202501483586175794e+02 -3.274549162877728181e-02 1.211543983374818200e+16 2.551634801771808000e+15 2.867357647997460000e+14 1.053351783155919569e-01 9.373679179108166393e-01 1.681808664217849358e+00 -1.394170843782524116e+02 -3.511191734215130672e-02 1.144613670351966200e+16 2.499973330206412500e+15 2.976236299489570000e+14 1.093349417136780938e-01 9.183895727323304614e-01 1.339717795559099311e+00 -1.888978092893256360e+02 -3.764935806792467365e-02 1.079782212885638800e+16 2.446786024608291500e+15 3.085171449074060000e+14 1.133367806242624731e-01 8.988506975480062833e-01 1.120489987343740612e+00 -3.825489646135808925e+02 -4.037017258596553582e-02 1.017077813735063200e+16 2.392113369191024000e+15 3.193776360065815000e+14 1.173264878982242937e-01 8.787661646283448924e-01 9.677701570567965872e-01 1.072802437031067029e+03 -4.328761281083057244e-02 9.565238470364550000e+15 2.336003849332720500e+15 3.301640524447680000e+14 1.212889831233878168e-01 8.581537855496332856e-01 8.550738106996020882e-01 1.848657396931597248e+02 -4.641588833612779463e-02 8.981387280171946000e+15 2.278514160340049500e+15 3.408331345659110000e+14 1.252083744434038803e-01 8.370343878854452635e-01 7.683116261079082632e-01 9.190624271938843037e+01 -4.977023564332111460e-02 8.419358055193029000e+15 2.219709357814459250e+15 3.513391824352247500e+14 1.290678735417433998e-01 8.154318704451384292e-01 6.992966437544075875e-01 5.744855413954382328e+01 -5.336699231206309957e-02 7.879232789266045000e+15 2.159662951456050000e+15 3.616348841453910000e+14 1.328500999280538553e-01 7.933732377336214503e-01 6.429472081490914537e-01 3.992738034607557296e+01 -5.722367659350217212e-02 7.361041409511860000e+15 2.098456940744797500e+15 3.716709423943595000e+14 1.365369437578742018e-01 7.708886130591987573e-01 5.959413260989665506e-01 2.954236750249809162e+01 -6.135907273413172824e-02 6.864761475707217000e+15 2.036181772232043000e+15 3.813966780864880000e+14 1.401097875713976093e-01 7.480112228441838651e-01 5.560159827465706028e-01 2.279587211770191146e+01 -6.579332246575682330e-02 6.390318162193128000e+15 1.972936218671335500e+15 3.907602305142245000e+14 1.435495798321637095e-01 7.247773522224352227e-01 5.215761892828700841e-01 1.813531791444600572e+01 -7.054802310718645553e-02 5.937584531213114000e+15 1.908827169789055500e+15 3.997089205847575000e+14 1.468369683619094590e-01 7.012262681769058092e-01 4.914654560356487845e-01 1.477003479361916760e+01 -7.564633275546291113e-02 5.506382104212469000e+15 1.843969345744390000e+15 4.081896246625880000e+14 1.499524376752821020e-01 6.774001142763715899e-01 4.648248319707924403e-01 1.225716221993067023e+01 -8.111308307896872294e-02 5.096481735052291000e+15 1.778484921963848750e+15 4.161491862276242500e+14 1.528764602064531797e-01 6.533437728547338841e-01 4.410030694252910499e-01 1.033065025776648049e+01 -8.697490026177834288e-02 4.707604786319980000e+15 1.712503057395270750e+15 4.235348609795870000e+14 1.555896598225606775e-01 6.291046917105300729e-01 4.194975141101778271e-01 8.821828293365328477e+00 -9.326033468832199691e-02 4.339424606979386500e+15 1.646159327667765000e+15 4.302947920805705000e+14 1.580729864086965475e-01 6.047326758727120666e-01 3.999141258582569192e-01 7.619094727368562303e+00 -1.000000000000000056e-01 3.991568306529020500e+15 1.579595061233158750e+15 4.363785131377497500e+14 1.603079006435073062e-01 5.802796437257364826e-01 3.819397802539639120e-01 6.645995208528413301e+00 -1.072267222010323123e-01 3.663618817662859000e+15 1.512956594439413500e+15 4.417374660658702500e+14 1.622765642410277098e-01 5.557993533535218189e-01 3.653226654804435647e-01 5.848619097758430030e+00 -1.149756995397735598e-01 3.355117236196166500e+15 1.446394434162134500e+15 4.463255355077505000e+14 1.639620362752620686e-01 5.313470949239713637e-01 3.498581455473172563e-01 5.188013718407724184e+00 -1.232846739442065853e-01 3.065565423773752500e+15 1.380062333993083000e+15 4.500995931789487500e+14 1.653484731505037719e-01 5.069793513178171285e-01 3.353783935672294270e-01 4.635440187086221187e+00 -1.321941148466029281e-01 2.794428855669627500e+15 1.314116289538742500e+15 4.530200462113840000e+14 1.664213300407097196e-01 4.827534290417549445e-01 3.217446753342405596e-01 4.169307991455362128e+00 -1.417474162926805614e-01 2.541139692867054000e+15 1.248713464170242000e+15 4.550513802342692500e+14 1.671675603955752043e-01 4.587270635922062745e-01 3.088415273540143224e-01 3.773137846648428440e+00 -1.519911082952933867e-01 2.305100054631145500e+15 1.184011062259152500e+15 4.561626803414510000e+14 1.675758073229645373e-01 4.349580055275049650e-01 2.965723060626808683e-01 3.434174380416248340e+00 -1.629750834620644351e-01 2.085685465007930000e+15 1.120165148362134875e+15 4.563281437245378750e+14 1.676365919096879098e-01 4.115035866838663847e-01 2.848557580241964371e-01 3.142420780087923138e+00 -1.747528400007683780e-01 1.882248444160040500e+15 1.057329429231785750e+15 4.555275190457765000e+14 1.673424746294103760e-01 3.884202727351990236e-01 2.736233187091154373e-01 2.889954083050963796e+00 -1.873817422860384052e-01 1.694122213234424750e+15 9.956540105025533750e+14 4.537465954312163750e+14 1.666882349790579088e-01 3.657632064495556223e-01 2.628170372234962526e-01 2.670431315312202791e+00 -2.009233002565046777e-01 1.520624479603877250e+15 9.352841518516792500e+14 4.509775415571950000e+14 1.656709960455428343e-01 3.435857503853704253e-01 2.523878726624316227e-01 2.478727632786016155e+00 -2.154434690031884481e-01 1.361061267880110500e+15 8.763590355677532500e+14 4.472192179598447500e+14 1.642903392357058512e-01 3.219390345131137310e-01 2.422943475558073101e-01 2.310667608528735428e+00 -2.310129700083160265e-01 1.214730761104602750e+15 8.190105594100537500e+14 4.424774599325580000e+14 1.625484082014574116e-01 3.008715127604031370e-01 2.325014802976419215e-01 2.162823136526633494e+00 -2.477076355991711387e-01 1.080927116020872625e+15 7.633621749181153750e+14 4.367652324964996250e+14 1.604499657697061876e-01 2.804285362536993453e-01 2.229798899116379463e-01 2.032359636926105662e+00 -2.656087782946686682e-01 9.589442163468533750e+14 7.095277875484503750e+14 4.301027347900838750e+14 1.580024322908509804e-01 2.606519492728089360e-01 2.137050772439945123e-01 1.916917823700251100e+00 -2.848035868435802032e-01 8.480793285175710000e+14 6.576107458676077500e+14 4.225173994519532500e+14 1.552158854121120646e-01 2.415797179211013057e-01 2.046568229776915548e-01 1.814521916969636273e+00 -3.053855508833415722e-01 7.476366254655651250e+14 6.077029296875623750e+14 4.140437994436648750e+14 1.521030258479365849e-01 2.232455951431550623e-01 1.958186846406994308e-01 1.723507736396344248e+00 -3.274549162877728459e-01 6.569305456469673750e+14 5.598839529435315000e+14 4.047234600020205000e+14 1.486791082988540569e-01 2.056788278941533432e-01 1.871775718941078304e-01 1.642465897408021069e+00 -3.511191734215131088e-01 5.752889566908533750e+14 5.142204973761986250e+14 3.946045741823401250e+14 1.449618369535248530e-01 1.889039123615536275e-01 1.787233832869169481e-01 1.570196590404960180e+00 -3.764935806792467643e-01 5.020560957220625625e+14 4.707657909025689375e+14 3.837416215685269375e+14 1.409712254181658964e-01 1.729404023395364753e-01 1.704486905380663275e-01 1.505673320564595796e+00 -4.037017258596555802e-01 4.365952615446967500e+14 4.295592474851565000e+14 3.721948825783897500e+14 1.367294182918761813e-01 1.578027769314410134e-01 1.623484553816270659e-01 1.448013641470657697e+00 -4.328761281083059465e-01 3.782912374245944375e+14 3.906262693189145000e+14 3.600298641901335000e+14 1.322604802016649761e-01 1.435003678812052930e-01 1.544197746757709211e-01 1.396455378325573093e+00 -4.641588833612779741e-01 3.265524271127570000e+14 3.539782190434258125e+14 3.473166429427329375e+14 1.275901544472347049e-01 1.300373493652437207e-01 1.466616461685342210e-01 1.350337200692012019e+00 -4.977023564332111460e-01 2.808126909365107188e+14 3.196125639448540000e+14 3.341291354954236250e+14 1.227455950338993407e-01 1.174127909664394870e-01 1.390747495290654279e-01 1.309082663480098274e+00 -5.336699231206309957e-01 2.405328731709928438e+14 2.875131950400774375e+14 3.205443001196825625e+14 1.177550733328795313e-01 1.056207748928115336e-01 1.316612349965609330e-01 1.272187035714403391e+00 -5.722367659350217073e-01 2.052020164035863750e+14 2.576509133117131562e+14 3.066412820470658750e+14 1.126476641164995823e-01 9.465057460069059569e-02 1.244245160555723789e-01 1.239206379468057007e+00 -6.135907273413172547e-01 1.743382631267819375e+14 2.299840836866273438e+14 2.925005157622573750e+14 1.074529157767879911e-01 8.448689504009991580e-02 1.173690635280359995e-01 1.209748468305232860e+00 -6.579332246575682053e-01 1.474894492469614062e+14 2.044594244530950000e+14 2.782028187961469375e+14 1.022005174215309953e-01 7.511016265484417309e-02 1.105002058568314433e-01 1.183465194080822513e+00 -7.054802310718645275e-01 1.242333984845648125e+14 1.810129455604338750e+14 2.638284684825885000e+14 9.691995971186782854e-02 6.649687007602664290e-02 1.038239258177540980e-01 1.160046223914949381e+00 -7.564633275546290836e-01 1.041779306747426094e+14 1.595710004885613125e+14 2.494562880655539375e+14 9.164019913484498792e-02 5.861996253658451062e-02 9.734665649143468824e-02 1.139213678635155214e+00 -8.111308307896872849e-01 8.696060067245946875e+13 1.400514376619359531e+14 2.351627579897086250e+14 8.638933152734597221e-02 5.144926085442447228e-02 9.107507691698470131e-02 1.120717668697500002e+00 -8.697490026177834288e-01 7.224818784589743750e+13 1.223648297621861250e+14 2.210211727835942500e+14 8.119428234890976870e-02 4.495191303240016201e-02 8.501591014826499759e-02 1.104332549896486437e+00 -9.326033468832198858e-01 5.973595894146687500e+13 1.064157576949703438e+14 2.071008581556610938e+14 7.608051907432651639e-02 3.909286593605450916e-02 7.917572508027981293e-02 1.089853785592691970e+00 -1.000000000000000000e+00 4.914672937013000781e+13 9.210412454805496875e+13 1.934664647651047812e+14 7.107179175347000388e-02 3.383534798892814943e-02 7.356074516443347755e-02 1.077095321617599355e+00 -1.072267222010323096e+00 4.022974965998771094e+13 7.932647376552967188e+13 1.801773438260535625e+14 6.618990363340919447e-02 2.914135341670708035e-02 6.817666389061775856e-02 1.065887394059237936e+00 -1.149756995397735571e+00 3.275944492184633203e+13 6.797729374732314062e+13 1.672870188273947500e+14 6.145451708953687114e-02 2.497212150457207500e-02 6.302847174418002574e-02 1.056074709134620981e+00 -1.232846739442065909e+00 2.653403567693038281e+13 5.795027529188967188e+13 1.548427716161748750e+14 5.688300156927166007e-02 2.128859853102722799e-02 5.812030133080552108e-02 1.047514929974726394e+00 -1.321941148466028615e+00 2.137406830977950391e+13 4.913950910324830469e+13 1.428853403679043750e+14 5.249032263850536562e-02 1.805187768378414478e-02 5.345529101343090422e-02 1.040077427328846671e+00 -1.417474162926804837e+00 1.712088276152780273e+13 4.144059959958542188e+13 1.314487347444124219e+14 4.828897407803903197e-02 1.522360822820957582e-02 4.903547087594014448e-02 1.033642246966846479e+00 -1.519911082952933201e+00 1.363504391108575195e+13 3.475168030362002344e+13 1.205601627909436562e+14 4.428895102851883314e-02 1.276636852087417902e-02 4.486167166141086932e-02 1.028099256367812409e+00 -1.629750834620645072e+00 1.079476145950517773e+13 2.897431547579106641e+13 1.102400764325394531e+14 4.049776670397524370e-02 1.064399723329306595e-02 4.093346236412814809e-02 1.023347435236769520e+00 -1.747528400007684724e+00 8.494321102523551758e+12 2.401427813035747656e+13 1.005023270758046250e+14 3.692050955364883230e-02 8.821879163724280146e-03 3.724911676066690325e-02 1.019294279310170026e+00 -1.873817422860384996e+00 6.642547423180946289e+12 1.978219746430519531e+13 9.135442429483400000e+13 3.355993829278707680e-02 7.267183076488980056e-03 3.380560984856897933e-02 1.015855290235420094e+00 -2.009233002565047776e+00 5.161316341575615234e+12 1.619407283317151758e+13 8.279788309381920312e+13 3.041660947294813622e-02 5.949050516000773357e-03 3.059864234196151694e-02 1.012953528124527658e+00 -2.154434690031884259e+00 3.984132206205844238e+12 1.317165417434258594e+13 7.482864960806734375e+13 2.748903386741975707e-02 4.838735558972434569e-03 2.762269277317589908e-02 1.010519206573620377e+00 -2.310129700083160209e+00 3.054781784682008789e+12 1.064269209948910742e+13 6.743759468851720312e+13 2.477385779430285248e-02 3.909696688310086710e-03 2.487109623689487750e-02 1.008489313459995929e+00 -2.477076355991711498e+00 2.326074591466259766e+12 8.541064423491459961e+12 6.061105861298566406e+13 2.226606322149770473e-02 3.137643274747247378e-03 2.233614608002949461e-02 1.006807244589160488e+00 -2.656087782946686904e+00 1.758676251437396484e+12 6.806788274633195312e+12 5.433143189908921875e+13 1.995918113399251098e-02 2.500540025642463294e-03 2.000921497692399742e-02 1.005422440548503937e+00 -2.848035868435801810e+00 1.320039006982927979e+12 5.385929360666869141e+12 4.857775461719150781e+13 1.784551169731677170e-02 1.978573652984112925e-03 1.788089035586679088e-02 1.004290020498433744e+00 -3.053855508833415389e+00 9.834310893597186279e+11 4.230421110872598145e+12 4.332632227008807031e+13 1.591634683334965800e-02 1.554086433462605532e-03 1.594112071278359216e-02 1.003370409279422004e+00 -3.274549162877728570e+00 7.270645370993237305e+11 3.297807853941642090e+12 3.855128397856275781e+13 1.416218996961528948e-02 1.211481862362396916e-03 1.417936801678739735e-02 1.002628956953652395e+00 -3.511191734215131088e+00 5.333191878052713013e+11 2.550926777997327637e+12 3.422521969637703906e+13 1.257296808483578110e-02 9.371078184754055721e-04 1.258476136310279422e-02 1.002035552047367606e+00 -3.764935806792467421e+00 3.880590147995317993e+11 1.957543427049501465e+12 3.031968519982909375e+13 1.113823191615837503e-02 7.191226601703537037e-04 1.114624743526494710e-02 1.001564231391590232e+00 -4.037017258596553582e+00 2.800357345210944824e+11 1.489955077460279541e+12 2.680571572883429297e+13 9.847340976615867603e-03 5.473495218711523381e-04 9.852733865786431067e-03 1.001192790631022067e+00 -4.328761281083057355e+00 2.003736708074031067e+11 1.124575317746316162e+12 2.365428177031789844e+13 8.689630991598921300e-03 4.131237053977252524e-04 8.693222367835366782e-03 1.000902400017976923e+00 -4.641588833612781961e+00 1.421292145788439636e+11 8.415121051816102295e+11 2.083669141603131641e+13 7.654561708922078857e-03 3.091376749459215454e-04 7.656928754074339774e-03 1.000677230429404485e+00 -4.977023564332113459e+00 9.991783993620965576e+10 6.241500467017153320e+11 1.832493607251046484e+13 6.731843898746959175e-03 2.292876039057282968e-04 6.733387781097457947e-03 1.000504094340355810e+00 -5.336699231206313065e+00 6.960150162074356079e+10 4.587460095964287720e+11 1.609197861108992188e+13 5.911545208298864956e-03 1.685248185072199024e-04 5.912541618302007140e-03 1.000372106014532081e+00 -5.722367659350219959e+00 4.802931090207953644e+10 3.340453831172721558e+11 1.411198490065055078e+13 5.184175217678613917e-03 1.227148277813625032e-04 5.184811470925347436e-03 1.000272364431505689e+00 -6.135907273413176100e+00 3.282463131656645966e+10 2.409245697842807617e+11 1.236050052646198242e+13 4.540750359251991518e-03 8.850598925654834894e-05 4.541152278426760502e-03 1.000197661621423650e+00 -6.579332246575682497e+00 2.221211554049404144e+10 1.720635883401535034e+11 1.081457629039860938e+13 3.972840021377477965e-03 6.320923646231778206e-05 3.973091157435935591e-03 1.000142218158481144e+00 -7.054802310718645053e+00 1.487868417444875717e+10 1.216511235381154327e+11 9.452846918003083984e+12 3.472595462213267422e-03 4.468972609373927062e-05 3.472750658488987872e-03 1.000101446664641847e+00 -7.564633275546290392e+00 9.862992725533103943e+09 8.512294593103854370e+10 8.255568625909895508e+12 3.032763610476524752e-03 3.127074397104431320e-05 3.032858450216622051e-03 1.000071743311933048e+00 -8.111308307896871739e+00 6.468514352125196457e+09 5.893342500269370270e+10 7.204620928717798828e+12 2.646687729215589386e-03 2.164976816108991152e-05 2.646745030631884443e-03 1.000050306554167712e+00 -8.697490026177835176e+00 4.195956857482413292e+09 4.035890115512548828e+10 6.283478365301539062e+12 2.308297029194971914e-03 1.482623576017978247e-05 2.308331253058342782e-03 1.000034981710555382e+00 -9.326033468832198636e+00 2.691311430106618881e+09 2.733094044697739792e+10 5.477158018204686523e+12 2.012087389632728502e-03 1.004028739674590807e-05 2.012107591771223562e-03 1.000024129551870811e+00 -1.000000000000000000e+01 1.706380886010607719e+09 1.829696972141786957e+10 4.772148324015714844e+12 1.753095205998152868e-03 6.721570187055526932e-06 1.753106989629829625e-03 1.000016516710793280e+00 +1.000000000000000021e-02 2.623669635761697600e+16 3.189196070449786000e+15 1.276027519456265000e+14 4.687611480604780834e-02 1.171582264942873097e+00 -2.731990676405569030e-01 3.670653748634952507e+01 +1.072267222010323158e-02 2.529093035647578800e+16 3.163569518776327000e+15 1.349153973752620000e+14 4.956248638870444645e-02 1.162168101376557017e+00 -3.056241391987419842e-01 4.194269671436146751e+01 +1.149756995397735633e-02 2.435596729001030400e+16 3.136611589051413000e+15 1.425186876894140000e+14 5.235562920291093880e-02 1.152264843104690684e+00 -3.438458158520137364e-01 4.891537365029977025e+01 +1.232846739442065853e-02 2.343257807453348000e+16 3.108282567295773500e+15 1.504117213282735000e+14 5.525521205188300283e-02 1.141857900809854831e+00 -3.895109947097419867e-01 5.858050452477413472e+01 +1.321941148466028795e-02 2.252152478078229600e+16 3.078544381650331500e+15 1.585924163410500000e+14 5.826047011070276810e-02 1.130933288423491057e+00 -4.449630098822922042e-01 7.273127352985996197e+01 +1.417474162926805545e-02 2.162355818454726400e+16 3.047360932013831500e+15 1.670568499448330000e+14 6.136996230682856268e-02 1.119477744221497151e+00 -5.136518328723679305e-01 9.515961944978003828e+01 +1.519911082952933937e-02 2.073941526177878000e+16 3.014698448767717000e+15 1.757996075290930000e+14 6.458169953030043486e-02 1.107478862605308478e+00 -6.008781444539676997e-01 1.354846490456935157e+02 +1.629750834620644420e-02 1.986981663917872800e+16 2.980525862123967500e+15 1.848134473910700000e+14 6.789302147101698715e-02 1.094925229785425280e+00 -7.152263062674328875e-01 2.272036942521080789e+02 +1.747528400007683849e-02 1.901546401236826400e+16 2.944815185224397500e+15 1.940890313922970000e+14 7.130049767278365258e-02 1.081806564516676117e+00 -8.715742812821479779e-01 6.216767377742245344e+02 +1.873817422860384052e-02 1.817703754478220800e+16 2.907541904332989000e+15 2.036152522110910000e+14 7.480004775270537865e-02 1.068113861439172974e+00 -1.098161903792567395e+00 -1.046518781608876452e+03 +2.009233002565046985e-02 1.735519326146843600e+16 2.868685386510629000e+15 2.133785658009000000e+14 7.838669617325318140e-02 1.053839540841602140e+00 -1.455931736191250714e+00 -3.080925456064942409e+02 +2.154434690031884619e-02 1.655056045294933200e+16 2.828229300831121500e+15 2.233633111834975000e+14 8.205468972141143069e-02 1.038977603399030336e+00 -2.105175345989904745e+00 -1.918016848448959877e+02 +2.310129700083160542e-02 1.576373910521795400e+16 2.786162038713121500e+15 2.335514944841785000e+14 8.579741817190196518e-02 1.023523784585939733e+00 -3.647262533732920975e+00 -1.468897162312466662e+02 +2.477076355991711387e-02 1.499529737277655800e+16 2.742477134073272500e+15 2.439224678149670000e+14 8.960729632179999238e-02 1.007475709023577082e+00 -1.198646122249969181e+01 -1.254141594318358415e+02 +2.656087782946686682e-02 1.424576911236377400e+16 2.697173674732507500e+15 2.544533478360235000e+14 9.347591775314742502e-02 9.908330416140705976e-01 1.019704833575204894e+01 -1.155573192594950171e+02 +2.848035868435801893e-02 1.351565149563965400e+16 2.650256718900311000e+15 2.651184288019625000e+14 9.739383920979580167e-02 9.735976405399819900e-01 3.688830892454275645e+00 -1.137853794134626355e+02 +3.053855508833415444e-02 1.280540271958951800e+16 2.601737698511011000e+15 2.758894915975570000e+14 1.013506941246849896e-01 9.557737054338257821e-01 2.291638834292075710e+00 -1.202501481797724097e+02 +3.274549162877728181e-02 1.211543983374818200e+16 2.551634801770914000e+15 2.867357639430720000e+14 1.053351780008844191e-01 9.373679179104882353e-01 1.681808659184329091e+00 -1.394170856677245354e+02 +3.511191734215130672e-02 1.144613670351966200e+16 2.499973330205520000e+15 2.976236286600430000e+14 1.093349412401829757e-01 9.183895727320025015e-01 1.339717789751822652e+00 -1.888978129857583212e+02 +3.764935806792467365e-02 1.079782212885638800e+16 2.446786024607400500e+15 3.085171445179060000e+14 1.133367804811758472e-01 8.988506975476789895e-01 1.120489985925507304e+00 -3.825489693697762732e+02 +4.037017258596553582e-02 1.017077813735063200e+16 2.392113369190124000e+15 3.193776361822970000e+14 1.173264879627750890e-01 8.787661646280142680e-01 9.677701575866055617e-01 1.072802454371603972e+03 +4.328761281083057244e-02 9.565238470364550000e+15 2.336003849331842000e+15 3.301640524644425000e+14 1.212889831306154381e-01 8.581537855493105438e-01 8.550738107486117734e-01 1.848657397499489718e+02 +4.641588833612779463e-02 8.981387280171946000e+15 2.278514160339202500e+15 3.408331345289345000e+14 1.252083744298202184e-01 8.370343878851340680e-01 7.683116260230885564e-01 9.190624268979938449e+01 +4.977023564332111460e-02 8.419358055193029000e+15 2.219709357812838500e+15 3.513391824389640000e+14 1.290678735431170510e-01 8.154318704445431276e-01 6.992966437595953266e-01 5.744855413998884330e+01 +5.336699231206309957e-02 7.879232789266045000e+15 2.159662951459143750e+15 3.616348841395462500e+14 1.328500999259067117e-01 7.933732377347579856e-01 6.429472081422364926e-01 3.992738034591483398e+01 +5.722367659350217212e-02 7.361041409511860000e+15 2.098456940717942000e+15 3.716709424211035000e+14 1.365369437676988706e-01 7.708886130493332045e-01 5.959413261161857767e-01 2.954236750089418351e+01 +6.135907273413172824e-02 6.864761475707217000e+15 2.036181772229288000e+15 3.813966780869615000e+14 1.401097875715715535e-01 7.480112228431717858e-01 5.560159827450278369e-01 2.279587211746218856e+01 +6.579332246575682330e-02 6.390318162193128000e+15 1.972936218669771750e+15 3.907602305465762500e+14 1.435495798440484527e-01 7.247773522218607933e-01 5.215761893249629688e-01 1.813531791546422056e+01 +7.054802310718645553e-02 5.937584531213114000e+15 1.908827169788433250e+15 3.997089206001302500e+14 1.468369683675568027e-01 7.012262681766772143e-01 4.914654560541749651e-01 1.477003479395117047e+01 +7.564633275546291113e-02 5.506382104212469000e+15 1.843969345743449750e+15 4.081896246708172500e+14 1.499524376783051838e-01 6.774001142760261995e-01 4.648248319796656203e-01 1.225716222003340228e+01 +8.111308307896872294e-02 5.096481735052291000e+15 1.778484921962930250e+15 4.161491862301420000e+14 1.528764602073780787e-01 6.533437728543964873e-01 4.410030694275302032e-01 1.033065025777169588e+01 +8.697490026177834288e-02 4.707604786319980000e+15 1.712503057394387000e+15 4.235348609793115000e+14 1.555896598224594529e-01 6.291046917102053326e-01 4.194975141095378390e-01 8.821828293344129435e+00 +9.326033468832199691e-02 4.339424606979386500e+15 1.646159327665952250e+15 4.302947920801250000e+14 1.580729864085329006e-01 6.047326758720461548e-01 3.999141258571691782e-01 7.619094727335000705e+00 +1.000000000000000056e-01 3.991568306529020500e+15 1.579595061232396750e+15 4.363785131360595000e+14 1.603079006428863584e-01 5.802796437254564843e-01 3.819397802522291330e-01 6.645995208509238417e+00 +1.072267222010323123e-01 3.663618817662859000e+15 1.512956594438495000e+15 4.417374660645157500e+14 1.622765642405301356e-01 5.557993533531844221e-01 3.653226654790456829e-01 5.848619097742652428e+00 +1.149756995397735598e-01 3.355117236196166500e+15 1.446394434161245500e+15 4.463255355066025000e+14 1.639620362748403504e-01 5.313470949236448471e-01 3.498581455461736711e-01 5.188013718395764862e+00 +1.232846739442065853e-01 3.065565423773752500e+15 1.380062333992191750e+15 4.500995931779765000e+14 1.653484731501466132e-01 5.069793513174897237e-01 3.353783935662818516e-01 4.635440187076746987e+00 +1.321941148466029281e-01 2.794428855669627500e+15 1.314116289537873500e+15 4.530200462104492500e+14 1.664213300403663276e-01 4.827534290414356999e-01 3.217446753333784160e-01 4.169307991447633199e+00 +1.417474162926805614e-01 2.541139692867054000e+15 1.248713464169336750e+15 4.550513802332182500e+14 1.671675603951891242e-01 4.587270635918737627e-01 3.088415273531114336e-01 3.773137846641466009e+00 +1.519911082952933867e-01 2.305100054631145500e+15 1.184011062258251750e+15 4.561626803406732500e+14 1.675758073226788214e-01 4.349580055271740631e-01 2.965723060620016893e-01 3.434174380410707883e+00 +1.629750834620644351e-01 2.085685465007930000e+15 1.120165148361241500e+15 4.563281437204610000e+14 1.676365919081902189e-01 4.115035866835382028e-01 2.848557580214927665e-01 3.142420780079149711e+00 +1.747528400007683780e-01 1.882248444160040500e+15 1.057329429230896000e+15 4.555275190454782500e+14 1.673424746293008247e-01 3.884202727348721740e-01 2.736233187087900309e-01 2.889954083047318267e+00 +1.873817422860384052e-01 1.694122213234424750e+15 9.956540105016617500e+14 4.537465954415742500e+14 1.666882349828629761e-01 3.657632064492281065e-01 2.628170372293601176e-01 2.670431315318285925e+00 +2.009233002565046777e-01 1.520624479603877250e+15 9.352841518507868750e+14 4.509775415381218750e+14 1.656709960385361335e-01 3.435857503850426320e-01 2.523878726516314286e-01 2.478727632769107014e+00 +2.154434690031884481e-01 1.361061267880110500e+15 8.763590355668608750e+14 4.472192180713363750e+14 1.642903392766633663e-01 3.219390345127858821e-01 2.422943476160940024e-01 2.310667608598216738e+00 +2.310129700083160265e-01 1.214730761104602750e+15 8.190105594091615000e+14 4.424774600698740000e+14 1.625484082519017826e-01 3.008715127600753436e-01 2.325014803696862364e-01 2.162823136601202290e+00 +2.477076355991711387e-01 1.080927116020872625e+15 7.633621749172230000e+14 4.367652326269220000e+14 1.604499658176181121e-01 2.804285362533715520e-01 2.229798899781203492e-01 2.032359636987663531e+00 +2.656087782946686682e-01 9.589442163468533750e+14 7.095277875475581250e+14 4.301027349125041250e+14 1.580024323358232563e-01 2.606519492724811426e-01 2.137050773047265151e-01 1.916917823750690308e+00 +2.848035868435802032e-01 8.480793285175710000e+14 6.576107458667155000e+14 4.225173995689320000e+14 1.552158854550853562e-01 2.415797179207735401e-01 2.046568230342647454e-01 1.814521917011921781e+00 +3.053855508833415722e-01 7.476366254655651250e+14 6.077029296866702500e+14 4.140437995502017500e+14 1.521030258870739449e-01 2.232455951428273244e-01 1.958186846910025536e-01 1.723507736430197612e+00 +3.274549162877728459e-01 6.569305456469673750e+14 5.598839529426392500e+14 4.047234601027251250e+14 1.486791083358488808e-01 2.056788278938255499e-01 1.871775719406047478e-01 1.642465897436292677e+00 +3.511191734215131088e-01 5.752889566908533750e+14 5.142204973753063125e+14 3.946045741682043125e+14 1.449618369483319236e-01 1.889039123612258064e-01 1.787233832804424327e-01 1.570196590399937087e+00 +3.764935806792467643e-01 5.020560957220625625e+14 4.707657909016767500e+14 3.837416215659887500e+14 1.409712254172334756e-01 1.729404023392087375e-01 1.704486905368713667e-01 1.505673320562770812e+00 +4.037017258596555802e-01 4.365952615446967500e+14 4.295592474842642500e+14 3.721948825721952500e+14 1.367294182896005572e-01 1.578027769311132478e-01 1.623484553788619167e-01 1.448013641468195445e+00 +4.328761281083059465e-01 3.782912374245944375e+14 3.906262693180221875e+14 3.600298641838914375e+14 1.322604801993718937e-01 1.435003678808774996e-01 1.544197746730345266e-01 1.396455378323295582e+00 +4.641588833612779741e-01 3.265524271127570000e+14 3.539782190425332500e+14 3.473166429358512500e+14 1.275901544447066438e-01 1.300373493649158441e-01 1.466616461655729509e-01 1.350337200689795569e+00 +4.977023564332111460e-01 2.808126909365107188e+14 3.196125639439655000e+14 3.341291354878803750e+14 1.227455950311282656e-01 1.174127909661130814e-01 1.390747495258742861e-01 1.309082663477945108e+00 +5.336699231206309957e-01 2.405328731709928438e+14 2.875131950391641250e+14 3.205443001114738750e+14 1.177550733298639851e-01 1.056207748924760242e-01 1.316612349931398640e-01 1.272187035712282643e+00 +5.722367659350217073e-01 2.052020164035863750e+14 2.576509133107320625e+14 3.066412820381643125e+14 1.126476641132295037e-01 9.465057460033017567e-02 1.244245160519109189e-01 1.239206379465923380e+00 +6.135907273413172547e-01 1.743382631267819375e+14 2.299840836866617188e+14 2.925005157515585000e+14 1.074529157728576489e-01 8.448689504011254459e-02 1.173690635237445851e-01 1.209748468304030711e+00 +6.579332246575682053e-01 1.474894492469614062e+14 2.044594244531041875e+14 2.782028187847165625e+14 1.022005174173319375e-01 7.511016265484754539e-02 1.105002058522917552e-01 1.183465194079629246e+00 +7.054802310718645275e-01 1.242333984845648125e+14 1.810129455604445000e+14 2.638284684691093125e+14 9.691995970691612283e-02 6.649687007603054256e-02 1.038239258124501047e-01 1.160046223913667740e+00 +7.564633275546290836e-01 1.041779306747426094e+14 1.595710004885718750e+14 2.494562880592496875e+14 9.164019913252904881e-02 5.861996253658838946e-02 9.734665648897494750e-02 1.139213678634613869e+00 +8.111308307896872849e-01 8.696060067245946875e+13 1.400514376619465938e+14 2.351627579885260312e+14 8.638933152691152806e-02 5.144926085442838581e-02 9.107507691652709514e-02 1.120717668697414959e+00 +8.697490026177834288e-01 7.224818784589743750e+13 1.223648297621967969e+14 2.210211727817767500e+14 8.119428234824209445e-02 4.495191303240408248e-02 8.501591014756625098e-02 1.104332549896363203e+00 +9.326033468832198858e-01 5.973595894146687500e+13 1.064157576949809688e+14 2.071008581536815312e+14 7.608051907359930643e-02 3.909286593605841575e-02 7.917572507952334859e-02 1.089853785592569402e+00 +1.000000000000000000e+00 4.914672937013000781e+13 9.210412454806562500e+13 1.934664647629811875e+14 7.107179175268987792e-02 3.383534798893206297e-02 7.356074516362634541e-02 1.077095321617479451e+00 +1.072267222010323096e+00 4.022974965998771094e+13 7.932647376554029688e+13 1.801773438237495000e+14 6.618990363256277432e-02 2.914135341671098348e-02 6.817666388974620573e-02 1.065887394059119364e+00 +1.149756995397735571e+00 3.275944492184633203e+13 6.797729374733382812e+13 1.672870188249035625e+14 6.145451708862170737e-02 2.497212150457599894e-02 6.302847174324166524e-02 1.056074709134503742e+00 +1.232846739442065909e+00 2.653403567693038281e+13 5.795027529190035938e+13 1.548427716134821250e+14 5.688300156828245135e-02 2.128859853103115540e-02 5.812030132979503771e-02 1.047514929974611153e+00 +1.321941148466028615e+00 2.137406830977950391e+13 4.913950910325897656e+13 1.428853403649940000e+14 5.249032263743620697e-02 1.805187768378806526e-02 5.345529101234232361e-02 1.040077427328733650e+00 +1.417474162926804837e+00 1.712088276152780273e+13 4.144059959959610938e+13 1.314487347412828594e+14 4.828897407688935439e-02 1.522360822821350324e-02 4.903547087477286986e-02 1.033642246966736344e+00 +1.519911082952933201e+00 1.363504391108575195e+13 3.475168030363070312e+13 1.205601627875218281e+14 4.428895102726179006e-02 1.276636852087810296e-02 4.486167166013776270e-02 1.028099256367702719e+00 +1.629750834620645072e+00 1.079476145950517773e+13 2.897431547580177344e+13 1.102400764289521875e+14 4.049776670265742284e-02 1.064399723329699857e-02 4.093346236279631761e-02 1.023347435236665826e+00 +1.747528400007684724e+00 8.494321102523551758e+12 2.401427813036819141e+13 1.005023270721968281e+14 3.692050955232346887e-02 8.821879163728216233e-03 3.724911675932988941e-02 1.019294279310076545e+00 +1.873817422860384996e+00 6.642547423180946289e+12 1.978219746431594141e+13 9.135442429466371875e+13 3.355993829272452267e-02 7.267183076492928287e-03 3.380560984850610601e-02 1.015855290235423647e+00 +2.009233002565047776e+00 5.161316341575615234e+12 1.619407283318226953e+13 8.279788309320454688e+13 3.041660947272233420e-02 5.949050516004723323e-03 3.059864234173447980e-02 1.012953528124521441e+00 +2.154434690031884259e+00 3.984132206205844238e+12 1.317165417435336133e+13 7.482864960748995312e+13 2.748903386720764896e-02 4.838735558976393208e-03 2.762269277296286810e-02 1.010519206573616602e+00 +2.310129700083160209e+00 3.054781784682008789e+12 1.064269209949990430e+13 6.743759468788264062e+13 2.477385779406974034e-02 3.909696688314053155e-03 2.487109623666095004e-02 1.008489313459992376e+00 +2.477076355991711498e+00 2.326074591466259766e+12 8.541064423502292969e+12 6.061105861230048438e+13 2.226606322124599635e-02 3.137643274751226834e-03 2.233614607977707847e-02 1.006807244589157158e+00 +2.656087782946686904e+00 1.758676251437396484e+12 6.806788274644006836e+12 5.433143189835042969e+13 1.995918113372110655e-02 2.500540025646434943e-03 2.000921497665199625e-02 1.005422440548501051e+00 +2.848035868435801810e+00 1.320039006982927979e+12 5.385929360677923828e+12 4.857775461639333594e+13 1.784551169702355486e-02 1.978573652988173913e-03 1.788089035557306403e-02 1.004290020498431302e+00 +3.053855508833415389e+00 9.834310893597186279e+11 4.230421110883147461e+12 4.332632226923183594e+13 1.591634683303511447e-02 1.554086433466480904e-03 1.594112071246861495e-02 1.003370409279419784e+00 +3.274549162877728570e+00 7.270645370993237305e+11 3.297807853952441406e+12 3.855128397763931250e+13 1.416218996927605216e-02 1.211481862366364229e-03 1.417936801644780614e-02 1.002628956953650619e+00 +3.511191734215131088e+00 5.333191878052713013e+11 2.550926777996636719e+12 3.422521969533789453e+13 1.257296808445404132e-02 9.371078184751517604e-04 1.258476136272069536e-02 1.002035552047357392e+00 +3.764935806792467421e+00 3.880590147995317993e+11 1.957543427048936523e+12 3.031968519920422266e+13 1.113823191592882254e-02 7.191226601701461874e-04 1.114624743503522288e-02 1.001564231391584681e+00 +4.037017258596553582e+00 2.800357345210944824e+11 1.489955077462706299e+12 2.680571572875643750e+13 9.847340976587265482e-03 5.473495218720438775e-04 9.852733865757820272e-03 1.001192790631023399e+00 +4.328761281083057355e+00 2.003736708074031067e+11 1.124575317742092041e+12 2.365428177017248047e+13 8.689630991545500491e-03 4.131237053961734338e-04 8.693222367781913013e-03 1.000902400017972926e+00 +4.641588833612781961e+00 1.421292145788439636e+11 8.415121051711517334e+11 2.083669141588459375e+13 7.654561708868179264e-03 3.091376749420795124e-04 7.656928754020393343e-03 1.000677230429396047e+00 +4.977023564332113459e+00 9.991783993620965576e+10 6.241500468201835938e+11 1.832493607222290234e+13 6.731843898641319719e-03 2.292876039492487683e-04 6.733387780992088241e-03 1.000504094340441519e+00 +5.336699231206313065e+00 6.960150162074356079e+10 4.587460089386787720e+11 1.609197861156461719e+13 5.911545208473248901e-03 1.685248182655890226e-04 5.912541618474992031e-03 1.000372106014050466e+00 +5.722367659350219959e+00 4.802931090207953644e+10 3.340453828720429688e+11 1.411198490069830664e+13 5.184175217696157176e-03 1.227148276912751689e-04 5.184811470942427523e-03 1.000272364431325833e+00 +6.135907273413176100e+00 3.282463131656645966e+10 2.409245697938116150e+11 1.236050052623933789e+13 4.540750359170201041e-03 8.850598926004959012e-05 4.541152278344977831e-03 1.000197661621429646e+00 +6.579332246575682497e+00 2.221211554049404144e+10 1.720635883427042542e+11 1.081457629016583594e+13 3.972840021291966506e-03 6.320923646325481734e-05 3.973091157350422398e-03 1.000142218158482477e+00 +7.054802310718645053e+00 1.487868417444875717e+10 1.216511235373576965e+11 9.452846917720173828e+12 3.472595462109337536e-03 4.468972609346090848e-05 3.472750658385051915e-03 1.000101446664640736e+00 +7.564633275546290392e+00 9.862992725533103943e+09 8.512294593115248108e+10 8.255568625788320312e+12 3.032763610431862995e-03 3.127074397108617018e-05 3.032858450171958993e-03 1.000071743311933048e+00 +8.111308307896871739e+00 6.468514352125196457e+09 5.893342500267601013e+10 7.204620928692994141e+12 2.646687729206477317e-03 2.164976816108341308e-05 2.646745030622772808e-03 1.000050306554167712e+00 +8.697490026177835176e+00 4.195956857482413292e+09 4.035890115511917877e+10 6.283478365265076172e+12 2.308297029181576813e-03 1.482623576017746499e-05 2.308331253044947247e-03 1.000034981710555382e+00 +9.326033468832198636e+00 2.691311430106618881e+09 2.733094044697205734e+10 5.477158018165085938e+12 2.012087389618180677e-03 1.004028739674394634e-05 2.012107591756675303e-03 1.000024129551870811e+00 +1.000000000000000000e+01 1.706380886010607719e+09 1.829696972141913605e+10 4.772148323973216797e+12 1.753095205982540790e-03 6.721570187055991953e-06 1.753106989614217548e-03 1.000016516710793280e+00 From dcd95af1e8e6b7ab4d53e960660ae4b3847342e9 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sun, 2 Jul 2023 22:51:38 +0800 Subject: [PATCH 09/64] Update demo_mock_ensemble_realistic.ipynb --- examples/demo_mock_ensemble_realistic.ipynb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/demo_mock_ensemble_realistic.ipynb b/examples/demo_mock_ensemble_realistic.ipynb index ddd35401c..bb0f9147f 100644 --- a/examples/demo_mock_ensemble_realistic.ipynb +++ b/examples/demo_mock_ensemble_realistic.ipynb @@ -133,7 +133,7 @@ " n_s=0.96,\n", " Neff=3.04,\n", " m_nu=1.0e-05,\n", - " m_nu_type=\"single\",\n", + " mass_split=\"single\",\n", ")\n", "hmd_200c = ccl.halos.MassDef(200, \"critical\")\n", "\n", @@ -141,8 +141,8 @@ "# For a different multiplicty function, the user must change this function below\n", "def tinker08_ccl(logm, z):\n", " mass = 10 ** (logm)\n", - " hmf_200c = ccl.halos.MassFuncTinker08(cosmo, mass_def=hmd_200c)\n", - " nm = hmf_200c.get_mass_function(cosmo, mass, 1.0 / (1 + z))\n", + " hmf_200c = ccl.halos.MassFuncTinker08(mass_def=hmd_200c)\n", + " nm = hmf_200c(cosmo, mass, 1.0 / (1 + z))\n", " return nm # dn/dlog10M\n", "\n", "\n", @@ -633,12 +633,12 @@ "cluster_z = ran_z[indices]\n", "\n", "# Concentration CCL object to compute the theoretical concentration\n", - "conc_obj = ccl.halos.ConcentrationDuffy08(hmd_200c)\n", + "conc_obj = ccl.halos.ConcentrationDuffy08(mass_def=hmd_200c)\n", "conc_list = []\n", "for number in range(0, len(cluster_m)):\n", " a = 1.0 / (1.0 + (cluster_z[number]))\n", " # mean value of the concentration for that cluster\n", - " lnc_mean = np.log(conc_obj.get_concentration(cosmo, M=(cluster_m[number]), a=a))\n", + " lnc_mean = np.log(conc_obj(cosmo, M=(cluster_m[number]), a=a))\n", " # random draw of actual concentration from normal distribution around lnc_mean, with a 0.14 scatter\n", " lnc = np.random.normal(lnc_mean, 0.14)\n", " conc_list.append(np.exp(lnc))\n", @@ -1179,9 +1179,9 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3.11", "language": "python", - "name": "python3" + "name": "python3.11" }, "language_info": { "codemirror_mode": { @@ -1193,7 +1193,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.8" + "version": "3.11.4" } }, "nbformat": 4, From 2607cdae6997ccf3b4c63a12de0f591a5e7d3da5 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sun, 2 Jul 2023 23:14:43 +0800 Subject: [PATCH 10/64] Remove concentration from MassDef --- clmm/theory/ccl.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/clmm/theory/ccl.py b/clmm/theory/ccl.py index 96be69391..b289a09b7 100644 --- a/clmm/theory/ccl.py +++ b/clmm/theory/ccl.py @@ -114,8 +114,6 @@ def _get_mass(self): def _set_concentration(self, cdelta): """"set concentration. Also sets/updates hdpm""" self.conc = ccl.halos.ConcentrationConstant(c=cdelta, mass_def=self.mdef) - with ccl.UnlockInstance(self.mdef): - self.mdef.concentration = self.conc self.hdpm = self.hdpm_dict[self.halo_profile_model]( concentration=self.conc, mass_def=self.mdef, **self.hdpm_opts[self.halo_profile_model]) From 963f82ad15f8676536f3d8a8d73143233b8c1961 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sat, 29 Jul 2023 00:13:06 +0800 Subject: [PATCH 11/64] Fix profile name validation --- clmm/theory/parent_class.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/clmm/theory/parent_class.py b/clmm/theory/parent_class.py index 404b1577d..e5498591c 100644 --- a/clmm/theory/parent_class.py +++ b/clmm/theory/parent_class.py @@ -383,10 +383,11 @@ def set_halo_density_profile(self, halo_profile_model="nfw", massdef="mean", del Overdensity number """ # make case independent + validate_argument(locals(), "massdef", str) + validate_argument(locals(), "halo_profile_model", str) massdef, halo_profile_model = massdef.lower(), halo_profile_model.lower() + if self.validate_input: - validate_argument(locals(), "massdef", str) - validate_argument(locals(), "halo_profile_model", str) validate_argument(locals(), "delta_mdef", int, argmin=0) if massdef not in self.mdef_dict: raise ValueError( From 6b589969ad27edd65dc7eb70e41af361a3d8158a Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sat, 29 Jul 2023 00:35:43 +0800 Subject: [PATCH 12/64] Add virial massdef properly --- clmm/theory/ccl.py | 1 + 1 file changed, 1 insertion(+) diff --git a/clmm/theory/ccl.py b/clmm/theory/ccl.py index b289a09b7..79759be36 100644 --- a/clmm/theory/ccl.py +++ b/clmm/theory/ccl.py @@ -99,6 +99,7 @@ def __init__( def _update_halo_density_profile(self): """updates halo density profile with set internal properties""" # prepare mdef object + self.delta_mdef = "vir" if self.massdef == "virial" else self.delta_mdef 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 From 19a6be7b4ddb09d8206878a88f7d7ebc9644f50f Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sat, 29 Jul 2023 01:04:56 +0800 Subject: [PATCH 13/64] Update dicstrings --- clmm/theory/parent_class.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/clmm/theory/parent_class.py b/clmm/theory/parent_class.py index e5498591c..7fd9038d7 100644 --- a/clmm/theory/parent_class.py +++ b/clmm/theory/parent_class.py @@ -376,9 +376,11 @@ def set_halo_density_profile(self, halo_profile_model="nfw", massdef="mean", del Parameters ---------- halo_profile_model: str - Halo mass profile, current options are 'nfw' (letter case independent) + Halo mass profile, current options are 'nfw', 'einasto', 'hernquist' + (letter case independent) massdef: str - Mass definition, current options are 'mean' (letter case independent) + Mass definition, current options are 'mean', 'critical', 'virial' + (letter case independent) delta_mdef: int Overdensity number """ @@ -477,8 +479,8 @@ def eval_critical_surface_density_eff(self, z_len, pzbins, pzpdf): This comes from the maximum likelihood estimator for evaluating a :math:`\Delta\Sigma` profile. - For the standard :math:`\Sigma_{\rm crit}(z)` definition, use the `eval_sigma_crit` method - of the CLMM cosmology object. + For the standard :math:`\Sigma_{\text{crit}}(z)` definition, use the `eval_sigma_crit` + method of the CLMM cosmology object. Parameters ---------- From a9a2109b3e414c60e531d4dfab0f1deef69684e8 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sat, 29 Jul 2023 01:07:40 +0800 Subject: [PATCH 14/64] Update dicstrings --- clmm/theory/cluster_toolkit.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clmm/theory/cluster_toolkit.py b/clmm/theory/cluster_toolkit.py index 2dd3a7d69..29ec265c2 100644 --- a/clmm/theory/cluster_toolkit.py +++ b/clmm/theory/cluster_toolkit.py @@ -25,7 +25,7 @@ def _assert_correct_type_ct(arg): Returns ------- - scale_factor : array_like + scale_factor : numpy.ndarray Scale factor """ if np.isscalar(arg): @@ -156,7 +156,7 @@ def _eval_mean_surface_density(self, r_proj, z_cl): Returns ------- - array_like, float + numpy.ndarray, float Excess surface density in units of :math:`M_\odot\ Mpc^{-2}`. Note From 96b9446ab0d5df4722c4f6de7f4e5112ba1dc46e Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sat, 29 Jul 2023 01:08:04 +0800 Subject: [PATCH 15/64] Add virial massdef properly --- clmm/theory/ccl.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/clmm/theory/ccl.py b/clmm/theory/ccl.py index 79759be36..174864607 100644 --- a/clmm/theory/ccl.py +++ b/clmm/theory/ccl.py @@ -99,8 +99,10 @@ def __init__( def _update_halo_density_profile(self): """updates halo density profile with set internal properties""" # prepare mdef object - self.delta_mdef = "vir" if self.massdef == "virial" else self.delta_mdef - self.mdef = ccl.halos.MassDef(self.delta_mdef, self.mdef_dict[self.massdef]) + 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]) # setting concentration (also updates hdpm) self.cdelta = self.cdelta if self.hdpm else 4.0 # ccl always needs an input concentration From a9885d22d6419a9d49cfe53fd479f3cc80a7f3ed Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sat, 29 Jul 2023 01:34:46 +0800 Subject: [PATCH 16/64] Add use_projected_quad --- clmm/theory/ccl.py | 8 ++++++++ clmm/theory/parent_class.py | 16 ++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/clmm/theory/ccl.py b/clmm/theory/ccl.py index 174864607..86b10f0e4 100644 --- a/clmm/theory/ccl.py +++ b/clmm/theory/ccl.py @@ -94,6 +94,14 @@ def __init__( self.set_halo_density_profile(halo_profile_model, massdef, delta_mdef) self.set_cosmo(None) + def _use_projected_quad(self, use_quad): + if hasattr(self.hdpm, '_projected_quad'): + self.hdpm_opts["einasto"]["projected_quad"] = use_quad + self._update_halo_density_profile() + else: + raise NotImplementedError( + "_projected_quad is not available on this version of CCL.") + # Functions implemented by child class def _update_halo_density_profile(self): diff --git a/clmm/theory/parent_class.py b/clmm/theory/parent_class.py index 7fd9038d7..d87f3571e 100644 --- a/clmm/theory/parent_class.py +++ b/clmm/theory/parent_class.py @@ -444,6 +444,22 @@ def get_einasto_alpha(self, z_cl=None): raise ValueError(f"Wrong profile model. Current profile = {self.halo_profile_model}") return self._get_einasto_alpha(z_cl) + def use_projected_quad(self, use_quad): + r"""Sets the value of the :math:`\alpha` parameter for the Einasto profile + + Parameters + ---------- + use_quad : bool + Only available for Einasto profile with CCL as the backend. If True, CCL will ues + quad_vec instead of default FFTLog to calculate the surface density profile. + """ + if self.halo_profile_model != "einasto" or self.backend != "ccl": + raise NotImplementedError( + "This option is only available for the CCL Einasto profile.") + if self.validate_input: + validate_argument(locals(), "use_quad", bool) + self._use_projected_quad(use_quad) + def eval_3d_density(self, r3d, z_cl, verbose=False): r"""Retrieve the 3d density :math:`\rho(r)`. From ec50ff20657197b8d2212068561f80c097c41414 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sat, 29 Jul 2023 01:43:12 +0800 Subject: [PATCH 17/64] pylint --- clmm/theory/parent_class.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clmm/theory/parent_class.py b/clmm/theory/parent_class.py index d87f3571e..079d6e601 100644 --- a/clmm/theory/parent_class.py +++ b/clmm/theory/parent_class.py @@ -181,6 +181,10 @@ def _get_einasto_alpha(self, z_cl=None): if defined""" raise NotImplementedError + def _use_projected_quad(self, use_quad): + """Implemented for the CCL backend only""" + raise NotImplementedError + def _eval_3d_density(self, r3d, z_cl): raise NotImplementedError From 8d46860c75c1a88dba5d3eb12858d466c10761cb Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Mon, 7 Aug 2023 03:20:15 +0800 Subject: [PATCH 18/64] Add tests; Minor fixes --- clmm/theory/ccl.py | 4 ++-- tests/test_theory.py | 12 ++++++++++++ tests/test_theory_parent.py | 26 ++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/clmm/theory/ccl.py b/clmm/theory/ccl.py index 86b10f0e4..2bcdb4500 100644 --- a/clmm/theory/ccl.py +++ b/clmm/theory/ccl.py @@ -95,12 +95,12 @@ def __init__( self.set_cosmo(None) def _use_projected_quad(self, use_quad): - if hasattr(self.hdpm, '_projected_quad'): + if hasattr(self.hdpm, 'projected_quad'): self.hdpm_opts["einasto"]["projected_quad"] = use_quad self._update_halo_density_profile() else: raise NotImplementedError( - "_projected_quad is not available on this version of CCL.") + "projected_quad is not available on this version of CCL.") # Functions implemented by child class diff --git a/tests/test_theory.py b/tests/test_theory.py index 526e865b8..422308434 100644 --- a/tests/test_theory.py +++ b/tests/test_theory.py @@ -341,6 +341,18 @@ def test_profiles(modeling_data, profile_init): assert_raises( ValueError, mod.eval_excess_surface_density, 1e-12, cfg["SIGMA_PARAMS"]["z_cl"] ) + if mod.backend == "ccl" and profile_init == "einasto": + if hasattr(mod.hdpm, 'projected_quad'): + mod.use_projected_quad(True) + assert_allclose( + mod.eval_surface_density( + cfg["SIGMA_PARAMS"]["r_proj"], cfg["SIGMA_PARAMS"]["z_cl"], verbose=True + ), + cfg["numcosmo_profiles"]["Sigma"], + reltol*1e-1, + ) + delattr(mod.hdpm, "projected_quad") + assert_raises(NotImplementedError, mod.use_projected_quad, True) # Functional interface tests # alpha_ein is None unless testing Einasto with the NC and CCL backend diff --git a/tests/test_theory_parent.py b/tests/test_theory_parent.py index c57d3c0f3..09bc8fa3a 100644 --- a/tests/test_theory_parent.py +++ b/tests/test_theory_parent.py @@ -21,6 +21,7 @@ def test_unimplemented(modeling_data): assert_raises(NotImplementedError, mod._update_halo_density_profile) assert_raises(NotImplementedError, mod._set_einasto_alpha, 0.5) assert_raises(NotImplementedError, mod._get_einasto_alpha) + assert_raises(NotImplementedError, mod._use_projected_quad, True) assert_raises(NotImplementedError, mod.eval_3d_density, [0.3], 0.3) assert_raises(NotImplementedError, mod.eval_surface_density, [0.3], 0.3) assert_raises(NotImplementedError, mod.eval_mean_surface_density, [0.3], 0.3) @@ -91,6 +92,16 @@ def test_instantiate(modeling_data): assert_raises(ValueError, mod.set_halo_density_profile, halo_profile_model="bla") assert_raises(ValueError, mod.set_halo_density_profile, massdef="blu") + if theo.be_nick in ["nc", "ccl"]: + mod.set_halo_density_profile(massdef="virial") + assert_equal(mod.massdef, "virial") + + # reset + mod.massdef = "mean" + + mod.massdef = "virial" + assert_equal(mod.massdef, "virial") + if theo.be_nick == "nc": import gi @@ -150,3 +161,18 @@ def test_einasto(modeling_data): mod.eval_reduced_tangential_shear(0.1, 0.1, 0.5, verbose=True) mod.eval_magnification(0.1, 0.1, 0.5, verbose=True) mod.eval_magnification_bias(0.1, 2, 0.1, 0.5, verbose=True) + + +def test_use_projected_quad(modeling_data): + """Test use_projected_quad method""" + mod = theo.Modeling() + assert_raises(NotImplementedError, mod.use_projected_quad, True) + + if theo.be_nick == "ccl": + assert_raises(NotImplementedError, mod.use_projected_quad, True) + mod.set_halo_density_profile("hernquist") + assert_raises(NotImplementedError, mod.use_projected_quad, True) + mod.set_halo_density_profile("einasto") + mod.use_projected_quad(True) + else: + assert_raises(NotImplementedError, mod.use_projected_quad, True) From ea689863f9ea98f43c56a1e4642809828bf305c6 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Mon, 7 Aug 2023 03:36:59 +0800 Subject: [PATCH 19/64] Fix docstrings --- clmm/theory/parent_class.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/clmm/theory/parent_class.py b/clmm/theory/parent_class.py index 079d6e601..228c705dd 100644 --- a/clmm/theory/parent_class.py +++ b/clmm/theory/parent_class.py @@ -449,12 +449,13 @@ def get_einasto_alpha(self, z_cl=None): return self._get_einasto_alpha(z_cl) def use_projected_quad(self, use_quad): - r"""Sets the value of the :math:`\alpha` parameter for the Einasto profile + r"""Control the use of quad_vec to calculate the surface density profile for + CCL Einasto profile. Parameters ---------- use_quad : bool - Only available for Einasto profile with CCL as the backend. If True, CCL will ues + Only available for Einasto profile with CCL as the backend. If True, CCL will use quad_vec instead of default FFTLog to calculate the surface density profile. """ if self.halo_profile_model != "einasto" or self.backend != "ccl": From 2b62712e4a4f772f38ae9c5f3f033d0fa4fa4672 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Mon, 7 Aug 2023 05:00:29 +0800 Subject: [PATCH 20/64] Formatting --- clmm/theory/_ccl_supported_versions.py | 4 ++-- clmm/theory/ccl.py | 14 ++++++-------- clmm/theory/parent_class.py | 3 +-- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/clmm/theory/_ccl_supported_versions.py b/clmm/theory/_ccl_supported_versions.py index 3fa3adaf9..9d6c62bf2 100644 --- a/clmm/theory/_ccl_supported_versions.py +++ b/clmm/theory/_ccl_supported_versions.py @@ -1,5 +1,5 @@ """@file _ccl_supported_versions.py Versions of CCL supported by the current CLMM version """ -VMIN = '2.7.1.dev10+gf81b59a4' -VMAX = '3' +VMIN = "2.7.1.dev10+gf81b59a4" +VMAX = "3" diff --git a/clmm/theory/ccl.py b/clmm/theory/ccl.py index 2bcdb4500..092c916ca 100644 --- a/clmm/theory/ccl.py +++ b/clmm/theory/ccl.py @@ -95,12 +95,11 @@ def __init__( self.set_cosmo(None) def _use_projected_quad(self, use_quad): - if hasattr(self.hdpm, 'projected_quad'): + if hasattr(self.hdpm, "projected_quad"): self.hdpm_opts["einasto"]["projected_quad"] = use_quad self._update_halo_density_profile() else: - raise NotImplementedError( - "projected_quad is not available on this version of CCL.") + raise NotImplementedError("projected_quad is not available on this version of CCL.") # Functions implemented by child class @@ -123,13 +122,12 @@ def _get_mass(self): return self.__mdelta_cor * self.cor_factor def _set_concentration(self, cdelta): - """"set concentration. Also sets/updates hdpm""" + """set concentration. Also sets/updates hdpm""" self.conc = ccl.halos.ConcentrationConstant(c=cdelta, mass_def=self.mdef) self.hdpm = self.hdpm_dict[self.halo_profile_model]( - concentration=self.conc, mass_def=self.mdef, - **self.hdpm_opts[self.halo_profile_model]) - self.hdpm.update_precision_fftlog( - padding_lo_fftlog=1e-4, padding_hi_fftlog=1e3) + concentration=self.conc, mass_def=self.mdef, **self.hdpm_opts[self.halo_profile_model] + ) + self.hdpm.update_precision_fftlog(padding_lo_fftlog=1e-4, padding_hi_fftlog=1e3) def _set_mass(self, mdelta): """set mass""" diff --git a/clmm/theory/parent_class.py b/clmm/theory/parent_class.py index 228c705dd..54fed1406 100644 --- a/clmm/theory/parent_class.py +++ b/clmm/theory/parent_class.py @@ -459,8 +459,7 @@ def use_projected_quad(self, use_quad): quad_vec instead of default FFTLog to calculate the surface density profile. """ if self.halo_profile_model != "einasto" or self.backend != "ccl": - raise NotImplementedError( - "This option is only available for the CCL Einasto profile.") + raise NotImplementedError("This option is only available for the CCL Einasto profile.") if self.validate_input: validate_argument(locals(), "use_quad", bool) self._use_projected_quad(use_quad) From 65ded8aa3ea26b57d8c722db3f4609fdcb356fb6 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Fri, 18 Aug 2023 23:07:38 +0800 Subject: [PATCH 21/64] Remove virial massdef from CT backend --- clmm/theory/cluster_toolkit.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/clmm/theory/cluster_toolkit.py b/clmm/theory/cluster_toolkit.py index 29ec265c2..c735df505 100644 --- a/clmm/theory/cluster_toolkit.py +++ b/clmm/theory/cluster_toolkit.py @@ -41,7 +41,7 @@ class CTCLMModeling(CLMModeling): backend: str Name of the backend being used massdef : str - Profile mass definition (`mean`, `critical`, `virial` - letter case independent) + Profile mass definition (`mean`, `critical` - letter case independent) delta_mdef : int Mass overdensity definition. halo_profile_model : str @@ -85,7 +85,6 @@ def __init__( self.mdef_dict = { "mean": self.cosmo.get_E2Omega_m, "critical": self.cosmo.get_E2, - "virial": self.cosmo.get_E2, } self.set_halo_density_profile(halo_profile_model, massdef, delta_mdef) From 864337f418fe26b43aee86b293d858d75eb9df5a Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sun, 20 Aug 2023 14:17:27 +0800 Subject: [PATCH 22/64] 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 54fed1406..23266e407 100644 --- a/clmm/theory/parent_class.py +++ b/clmm/theory/parent_class.py @@ -380,10 +380,10 @@ def set_halo_density_profile(self, halo_profile_model="nfw", massdef="mean", del Parameters ---------- halo_profile_model: str - Halo mass profile, current options are 'nfw', 'einasto', 'hernquist' + Halo mass profile, supported options are 'nfw', 'einasto', 'hernquist' (letter case independent) massdef: str - Mass definition, current options are 'mean', 'critical', 'virial' + Mass definition, supported options are 'mean', 'critical', 'virial' (letter case independent) delta_mdef: int Overdensity number From f05a390dd68e77e0325c124dd2036115c9015545 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Wed, 23 Aug 2023 14:38:26 +0800 Subject: [PATCH 23/64] Naming consistency --- clmm/theory/ccl.py | 4 ++-- clmm/theory/parent_class.py | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/clmm/theory/ccl.py b/clmm/theory/ccl.py index 092c916ca..8cfcbe8e3 100644 --- a/clmm/theory/ccl.py +++ b/clmm/theory/ccl.py @@ -94,9 +94,9 @@ def __init__( self.set_halo_density_profile(halo_profile_model, massdef, delta_mdef) self.set_cosmo(None) - def _use_projected_quad(self, use_quad): + def _set_projected_quad(self, projected_quad): if hasattr(self.hdpm, "projected_quad"): - self.hdpm_opts["einasto"]["projected_quad"] = use_quad + self.hdpm_opts["einasto"]["projected_quad"] = projected_quad self._update_halo_density_profile() else: raise NotImplementedError("projected_quad is not available on this version of CCL.") diff --git a/clmm/theory/parent_class.py b/clmm/theory/parent_class.py index 23266e407..fa64913ed 100644 --- a/clmm/theory/parent_class.py +++ b/clmm/theory/parent_class.py @@ -181,7 +181,7 @@ def _get_einasto_alpha(self, z_cl=None): if defined""" raise NotImplementedError - def _use_projected_quad(self, use_quad): + def _set_projected_quad(self, projected_quad): """Implemented for the CCL backend only""" raise NotImplementedError @@ -448,21 +448,21 @@ def get_einasto_alpha(self, z_cl=None): raise ValueError(f"Wrong profile model. Current profile = {self.halo_profile_model}") return self._get_einasto_alpha(z_cl) - def use_projected_quad(self, use_quad): + def set_projected_quad(self, projected_quad): r"""Control the use of quad_vec to calculate the surface density profile for CCL Einasto profile. Parameters ---------- - use_quad : bool + projected_quad : bool Only available for Einasto profile with CCL as the backend. If True, CCL will use quad_vec instead of default FFTLog to calculate the surface density profile. """ if self.halo_profile_model != "einasto" or self.backend != "ccl": raise NotImplementedError("This option is only available for the CCL Einasto profile.") if self.validate_input: - validate_argument(locals(), "use_quad", bool) - self._use_projected_quad(use_quad) + validate_argument(locals(), "projected_quad", bool) + self._set_projected_quad(projected_quad) def eval_3d_density(self, r3d, z_cl, verbose=False): r"""Retrieve the 3d density :math:`\rho(r)`. From 1e6f164ba0f243c92757c1bb2c2cb638203a1d30 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Wed, 23 Aug 2023 14:41:01 +0800 Subject: [PATCH 24/64] Update tests --- tests/test_theory.py | 4 ++-- tests/test_theory_parent.py | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/test_theory.py b/tests/test_theory.py index 422308434..34f9373ab 100644 --- a/tests/test_theory.py +++ b/tests/test_theory.py @@ -343,7 +343,7 @@ def test_profiles(modeling_data, profile_init): ) if mod.backend == "ccl" and profile_init == "einasto": if hasattr(mod.hdpm, 'projected_quad'): - mod.use_projected_quad(True) + mod.set_projected_quad(True) assert_allclose( mod.eval_surface_density( cfg["SIGMA_PARAMS"]["r_proj"], cfg["SIGMA_PARAMS"]["z_cl"], verbose=True @@ -352,7 +352,7 @@ def test_profiles(modeling_data, profile_init): reltol*1e-1, ) delattr(mod.hdpm, "projected_quad") - assert_raises(NotImplementedError, mod.use_projected_quad, True) + assert_raises(NotImplementedError, mod.set_projected_quad, True) # Functional interface tests # alpha_ein is None unless testing Einasto with the NC and CCL backend diff --git a/tests/test_theory_parent.py b/tests/test_theory_parent.py index 09bc8fa3a..c8a27cec1 100644 --- a/tests/test_theory_parent.py +++ b/tests/test_theory_parent.py @@ -21,7 +21,7 @@ def test_unimplemented(modeling_data): assert_raises(NotImplementedError, mod._update_halo_density_profile) assert_raises(NotImplementedError, mod._set_einasto_alpha, 0.5) assert_raises(NotImplementedError, mod._get_einasto_alpha) - assert_raises(NotImplementedError, mod._use_projected_quad, True) + assert_raises(NotImplementedError, mod._set_projected_quad, True) assert_raises(NotImplementedError, mod.eval_3d_density, [0.3], 0.3) assert_raises(NotImplementedError, mod.eval_surface_density, [0.3], 0.3) assert_raises(NotImplementedError, mod.eval_mean_surface_density, [0.3], 0.3) @@ -163,16 +163,16 @@ def test_einasto(modeling_data): mod.eval_magnification_bias(0.1, 2, 0.1, 0.5, verbose=True) -def test_use_projected_quad(modeling_data): - """Test use_projected_quad method""" +def test_set_projected_quad(modeling_data): + """Test set_projected_quad method""" mod = theo.Modeling() - assert_raises(NotImplementedError, mod.use_projected_quad, True) + assert_raises(NotImplementedError, mod.set_projected_quad, True) if theo.be_nick == "ccl": - assert_raises(NotImplementedError, mod.use_projected_quad, True) + assert_raises(NotImplementedError, mod.set_projected_quad, True) mod.set_halo_density_profile("hernquist") - assert_raises(NotImplementedError, mod.use_projected_quad, True) + assert_raises(NotImplementedError, mod.set_projected_quad, True) mod.set_halo_density_profile("einasto") - mod.use_projected_quad(True) + mod.set_projected_quad(True) else: - assert_raises(NotImplementedError, mod.use_projected_quad, True) + assert_raises(NotImplementedError, mod.set_projected_quad, True) From d291fcb3a69cfc769af686a9ed6562a27a8347d3 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Fri, 25 Aug 2023 22:52:24 +0800 Subject: [PATCH 25/64] Rename arg to use_projected_quad --- clmm/theory/ccl.py | 4 ++-- clmm/theory/parent_class.py | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/clmm/theory/ccl.py b/clmm/theory/ccl.py index 8cfcbe8e3..2f610ba28 100644 --- a/clmm/theory/ccl.py +++ b/clmm/theory/ccl.py @@ -94,9 +94,9 @@ def __init__( self.set_halo_density_profile(halo_profile_model, massdef, delta_mdef) self.set_cosmo(None) - def _set_projected_quad(self, projected_quad): + def _set_projected_quad(self, use_projected_quad): if hasattr(self.hdpm, "projected_quad"): - self.hdpm_opts["einasto"]["projected_quad"] = projected_quad + self.hdpm_opts["einasto"]["projected_quad"] = use_projected_quad self._update_halo_density_profile() else: raise NotImplementedError("projected_quad is not available on this version of CCL.") diff --git a/clmm/theory/parent_class.py b/clmm/theory/parent_class.py index fa64913ed..91c50892f 100644 --- a/clmm/theory/parent_class.py +++ b/clmm/theory/parent_class.py @@ -181,7 +181,7 @@ def _get_einasto_alpha(self, z_cl=None): if defined""" raise NotImplementedError - def _set_projected_quad(self, projected_quad): + def _set_projected_quad(self, use_projected_quad): """Implemented for the CCL backend only""" raise NotImplementedError @@ -448,21 +448,21 @@ def get_einasto_alpha(self, z_cl=None): raise ValueError(f"Wrong profile model. Current profile = {self.halo_profile_model}") return self._get_einasto_alpha(z_cl) - def set_projected_quad(self, projected_quad): + def set_projected_quad(self, use_projected_quad): r"""Control the use of quad_vec to calculate the surface density profile for CCL Einasto profile. Parameters ---------- - projected_quad : bool + use_projected_quad : bool Only available for Einasto profile with CCL as the backend. If True, CCL will use quad_vec instead of default FFTLog to calculate the surface density profile. """ if self.halo_profile_model != "einasto" or self.backend != "ccl": raise NotImplementedError("This option is only available for the CCL Einasto profile.") if self.validate_input: - validate_argument(locals(), "projected_quad", bool) - self._set_projected_quad(projected_quad) + validate_argument(locals(), "use_projected_quad", bool) + self._set_projected_quad(use_projected_quad) def eval_3d_density(self, r3d, z_cl, verbose=False): r"""Retrieve the 3d density :math:`\rho(r)`. From ffd891d2a623f1f5d4e1dffb52caa0cd494cf557 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sat, 26 Aug 2023 00:40:00 +0800 Subject: [PATCH 26/64] Add use_projected_quad to functional interface --- clmm/theory/func_layer.py | 7 +++++++ tests/test_theory.py | 35 +++++++++++++++++++++++------------ 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/clmm/theory/func_layer.py b/clmm/theory/func_layer.py index c3695453b..3cb56cf21 100644 --- a/clmm/theory/func_layer.py +++ b/clmm/theory/func_layer.py @@ -109,6 +109,7 @@ def compute_surface_density( massdef="mean", alpha_ein=None, verbose=False, + use_projected_quad=False, validate_input=True, ): r"""Computes the surface mass density @@ -154,6 +155,10 @@ def compute_surface_density( verbose : boolean, optional If True, the Einasto slope (alpha_ein) is printed out. Only available for the NC and CCL backends. + use_projected_quad : bool + Only available for Einasto profile with CCL as the backend. If True, CCL will use + quad_vec instead of default FFTLog to calculate the surface density profile. + Default: False validate_input : bool, optional If True (default), the types of the arguments are checked before proceeding. @@ -176,6 +181,8 @@ def compute_surface_density( _modeling_object.set_mass(mdelta) if halo_profile_model == "einasto" or alpha_ein is not None: _modeling_object.set_einasto_alpha(alpha_ein) + if halo_profile_model == "einasto" and _modeling_object.backend=="ccl": + _modeling_object.set_projected_quad(use_projected_quad) sigma = _modeling_object.eval_surface_density(r_proj, z_cl, verbose=verbose) diff --git a/tests/test_theory.py b/tests/test_theory.py index 34f9373ab..9c482317c 100644 --- a/tests/test_theory.py +++ b/tests/test_theory.py @@ -341,18 +341,6 @@ def test_profiles(modeling_data, profile_init): assert_raises( ValueError, mod.eval_excess_surface_density, 1e-12, cfg["SIGMA_PARAMS"]["z_cl"] ) - if mod.backend == "ccl" and profile_init == "einasto": - if hasattr(mod.hdpm, 'projected_quad'): - mod.set_projected_quad(True) - assert_allclose( - mod.eval_surface_density( - cfg["SIGMA_PARAMS"]["r_proj"], cfg["SIGMA_PARAMS"]["z_cl"], verbose=True - ), - cfg["numcosmo_profiles"]["Sigma"], - reltol*1e-1, - ) - delattr(mod.hdpm, "projected_quad") - assert_raises(NotImplementedError, mod.set_projected_quad, True) # Functional interface tests # alpha_ein is None unless testing Einasto with the NC and CCL backend @@ -385,6 +373,29 @@ def test_profiles(modeling_data, profile_init): reltol, ) + # Test use_projected_quad + if mod.backend == "ccl" and profile_init == "einasto": + if hasattr(mod.hdpm, 'projected_quad'): + mod.set_projected_quad(True) + assert_allclose( + mod.eval_surface_density( + cfg["SIGMA_PARAMS"]["r_proj"], cfg["SIGMA_PARAMS"]["z_cl"], verbose=True + ), + cfg["numcosmo_profiles"]["Sigma"], + reltol*1e-1, + ) + assert_allclose( + theo.compute_surface_density( + cosmo=cosmo, **cfg["SIGMA_PARAMS"], alpha_ein=alpha_ein, verbose=True, + use_projected_quad=True, + ), + cfg["numcosmo_profiles"]["Sigma"], + reltol*1e-1, + ) + + delattr(mod.hdpm, "projected_quad") + assert_raises(NotImplementedError, mod.set_projected_quad, True) + def test_2halo_term(modeling_data): cfg = load_validation_config() From d50fc2fdd98fd657f6793af83a9a78e7c8ab41e4 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sat, 26 Aug 2023 00:54:15 +0800 Subject: [PATCH 27/64] Use CCL v3.0.0 in GH Actions --- .github/workflows/build_check.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_check.yml b/.github/workflows/build_check.yml index 51f881b2a..f5af239a5 100644 --- a/.github/workflows/build_check.yml +++ b/.github/workflows/build_check.yml @@ -36,6 +36,7 @@ jobs: conda install -c conda-forge cmake swig git clone https://github.com/LSSTDESC/CCL cd CCL + git checkout v3.0.0 pip install . - name: Analysing the code with pylint run: | From 2c44f0d1db6d8411b21daf914c49dad3714f2a31 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sat, 26 Aug 2023 02:05:41 +0800 Subject: [PATCH 28/64] Demo how enable projected_quad --- examples/demo_theory_functionality.ipynb | 67 ++++++++++++++++++--- examples/demo_theory_functionality_oo.ipynb | 37 ++++++++++-- 2 files changed, 93 insertions(+), 11 deletions(-) diff --git a/examples/demo_theory_functionality.ipynb b/examples/demo_theory_functionality.ipynb index 81b244d38..cda9a8e7c 100644 --- a/examples/demo_theory_functionality.ipynb +++ b/examples/demo_theory_functionality.ipynb @@ -348,7 +348,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "scrolled": true + }, "outputs": [], "source": [ "plot_profile(r3d, kappa, \"$\\\\kappa$\")" @@ -437,7 +439,7 @@ "- In CCL, the default Einasto slope depends on cosmology, redshift and halo mass. \n", "- In NumCosmo, the default value is $\\alpha_{\\rm ein}=0.25$.\n", "\n", - "**NB: for CCL, setting a user-defined value for the Einasto slope is only available for CCL version >= 2.6.** Earlier versions only allow the default option.\n", + "**NB: for CCL, setting a user-defined value for the Einasto slope is only available for versions >= 2.6.** Earlier versions only allow the default option.\n", "\n", "The verbose option allows to print the value of $\\alpha$ that is being used, as follows:" ] @@ -459,8 +461,8 @@ " verbose=True,\n", ")\n", "\n", - "# For CCL < 2.6, the above call will return an error, as alpha_ein could not be set. The call below, not specifying alpha_ein,\n", - "# will use the default value (for both backend)\n", + "# For CCL < 2.6, the above call will return an error, as alpha_ein cannot not be set. The call below, not specifying alpha_ein,\n", + "# will use the default value (for both CCL and NC backends)\n", "\n", "# rho = m.compute_3d_density(r3d, mdelta=cluster_mass, cdelta=cluster_concentration,\n", "# z_cl=z_cl, cosmo=cosmo, halo_profile_model='einasto',\n", @@ -469,13 +471,64 @@ "\n", "plot_profile(r3d, rho, \"$\\\\rho_{\\\\rm 3d}$\")" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "For CCL versions >= 2.8.1.dev73+g86125b08, the surface mass density profile can be calculated with quad_vec numerial integration in addition to the default FFTLog. This option will increase the precision of the profile at large radii and can be enabled by passing `use_projected_quad` keyword argument to `compute_surface_density`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# use quad_vec\n", + "Sigma_quad = m.compute_surface_density(\n", + " r3d,\n", + " mdelta=cluster_mass,\n", + " cdelta=cluster_concentration,\n", + " z_cl=z_cl,\n", + " cosmo=cosmo,\n", + " halo_profile_model=\"einasto\",\n", + " alpha_ein=0.17,\n", + " use_projected_quad=True, # use quad_vec\n", + " verbose=True,\n", + ")\n", + "\n", + "plot_profile(r3d, Sigma_quad, \"$\\\\Sigma_{\\\\rm quad}$\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# default behavior\n", + "Sigma_FFTLog = m.compute_surface_density(\n", + " r3d,\n", + " mdelta=cluster_mass,\n", + " cdelta=cluster_concentration,\n", + " z_cl=z_cl,\n", + " cosmo=cosmo,\n", + " halo_profile_model=\"einasto\",\n", + " alpha_ein=0.17,\n", + " use_projected_quad=False, # default\n", + " verbose=True,\n", + ")\n", + "\n", + "plot_profile(r3d, Sigma_FFTLog, \"$\\\\Sigma_{\\\\rm FFTLog}$\")" + ] } ], "metadata": { "kernelspec": { - "display_name": "wrk", + "display_name": "Python 3 (ipykernel)", "language": "python", - "name": "wrk" + "name": "python3" }, "language_info": { "codemirror_mode": { @@ -487,7 +540,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.9" + "version": "3.11.5" } }, "nbformat": 4, diff --git a/examples/demo_theory_functionality_oo.ipynb b/examples/demo_theory_functionality_oo.ipynb index 322718713..290e58ae3 100644 --- a/examples/demo_theory_functionality_oo.ipynb +++ b/examples/demo_theory_functionality_oo.ipynb @@ -302,19 +302,48 @@ "plot_profile(r3d, rho, \"$\\\\rho_{\\\\rm 3d}$\")" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "For CCL versions >= 2.8.1.dev73+g86125b08, the surface mass density profile can be calculated with quad_vec numerial integration in addition to the default FFTLog. This option will increase the precision of the profile at large radii and can be enabled by calling `set_projected_quad(True)`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# use quad_vec\n", + "moo_ein.set_projected_quad(True)\n", + "\n", + "Sigma_quad = moo_ein.eval_surface_density(r3d, z_cl, verbose=True)\n", + "\n", + "plot_profile(r3d, Sigma_quad, \"$\\\\Sigma_{\\\\rm quad}$\")" + ] + }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], - "source": [] + "source": [ + "# revert the effect from the previous cell\n", + "moo_ein.set_projected_quad(False)\n", + "\n", + "# default behavior\n", + "Sigma_FFTLog = moo_ein.eval_surface_density(r3d, z_cl, verbose=True)\n", + "\n", + "plot_profile(r3d, Sigma_FFTLog, \"$\\\\Sigma_{\\\\rm FFTLog}$\")" + ] } ], "metadata": { "kernelspec": { - "display_name": "wrk", + "display_name": "Python 3 (ipykernel)", "language": "python", - "name": "wrk" + "name": "python3" }, "language_info": { "codemirror_mode": { @@ -326,7 +355,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.9" + "version": "3.11.5" } }, "nbformat": 4, From ce7003f7039816c90f722fe37d8fc59c41f29b77 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sat, 26 Aug 2023 02:09:04 +0800 Subject: [PATCH 29/64] Fix typo in comments --- examples/demo_theory_functionality.ipynb | 4 ++-- examples/demo_theory_functionality_oo.ipynb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/demo_theory_functionality.ipynb b/examples/demo_theory_functionality.ipynb index cda9a8e7c..c84f329b1 100644 --- a/examples/demo_theory_functionality.ipynb +++ b/examples/demo_theory_functionality.ipynb @@ -461,7 +461,7 @@ " verbose=True,\n", ")\n", "\n", - "# For CCL < 2.6, the above call will return an error, as alpha_ein cannot not be set. The call below, not specifying alpha_ein,\n", + "# For CCL < 2.6, the above call will return an error, as alpha_ein can not be set. The call below, not specifying alpha_ein,\n", "# will use the default value (for both CCL and NC backends)\n", "\n", "# rho = m.compute_3d_density(r3d, mdelta=cluster_mass, cdelta=cluster_concentration,\n", @@ -476,7 +476,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "For CCL versions >= 2.8.1.dev73+g86125b08, the surface mass density profile can be calculated with quad_vec numerial integration in addition to the default FFTLog. This option will increase the precision of the profile at large radii and can be enabled by passing `use_projected_quad` keyword argument to `compute_surface_density`." + "For CCL versions >= 2.8.1.dev73+g86125b08, the surface mass density profile can be calculated with the quad_vec numerial integration in addition to the default FFTLog. This option will increase the precision of the profile at large radii and can be enabled by passing `use_projected_quad` keyword argument to `compute_surface_density`." ] }, { diff --git a/examples/demo_theory_functionality_oo.ipynb b/examples/demo_theory_functionality_oo.ipynb index 290e58ae3..673a972ff 100644 --- a/examples/demo_theory_functionality_oo.ipynb +++ b/examples/demo_theory_functionality_oo.ipynb @@ -306,7 +306,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "For CCL versions >= 2.8.1.dev73+g86125b08, the surface mass density profile can be calculated with quad_vec numerial integration in addition to the default FFTLog. This option will increase the precision of the profile at large radii and can be enabled by calling `set_projected_quad(True)`." + "For CCL versions >= 2.8.1.dev73+g86125b08, the surface mass density profile can be calculated with the quad_vec numerial integration in addition to the default FFTLog. This option will increase the precision of the profile at large radii and can be enabled by calling `set_projected_quad(True)`." ] }, { From 2098ebf7d56ae1a9748ba65314e42e1e0632337a Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sat, 26 Aug 2023 02:15:25 +0800 Subject: [PATCH 30/64] Add title --- examples/demo_theory_functionality.ipynb | 4 +++- examples/demo_theory_functionality_oo.ipynb | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/demo_theory_functionality.ipynb b/examples/demo_theory_functionality.ipynb index c84f329b1..5bb640cce 100644 --- a/examples/demo_theory_functionality.ipynb +++ b/examples/demo_theory_functionality.ipynb @@ -436,7 +436,7 @@ "## Side note regarding the Einasto profile (CCL and NC backends only)\n", "\n", "The Einasto profile is supported by both the CCL and NumCosmo backends. The value of the slope of the Einasto profile can be defined by the user, using the `alpha_ein` keyword. If `alpha_ein` is not provided, both backend revert to a default value for the Einasto slope:\n", - "- In CCL, the default Einasto slope depends on cosmology, redshift and halo mass. \n", + "- In CCL, the default Einasto slope depends on cosmology, redshift and halo mass.\n", "- In NumCosmo, the default value is $\\alpha_{\\rm ein}=0.25$.\n", "\n", "**NB: for CCL, setting a user-defined value for the Einasto slope is only available for versions >= 2.6.** Earlier versions only allow the default option.\n", @@ -476,6 +476,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ + "## Side note regarding the Einasto profile (CCL backend only)\n", + "\n", "For CCL versions >= 2.8.1.dev73+g86125b08, the surface mass density profile can be calculated with the quad_vec numerial integration in addition to the default FFTLog. This option will increase the precision of the profile at large radii and can be enabled by passing `use_projected_quad` keyword argument to `compute_surface_density`." ] }, diff --git a/examples/demo_theory_functionality_oo.ipynb b/examples/demo_theory_functionality_oo.ipynb index 673a972ff..3e8083c3a 100644 --- a/examples/demo_theory_functionality_oo.ipynb +++ b/examples/demo_theory_functionality_oo.ipynb @@ -274,7 +274,7 @@ "## Side note regarding the Einasto profile (CCL and NC backends only)\n", "\n", "The Einasto profile is supported by both the CCL and NumCosmo backends. The value of the slope of the Einasto profile $\\alpha_{\\rm ein}$ can be defined by the user, using the `set_einasto_alpha` method. If $\\alpha_{\\rm ein}$ is not provided, both backend revert to a default value for the Einasto slope:\n", - "- In CCL, the default Einasto slope depends on cosmology, redshift and halo mass. \n", + "- In CCL, the default Einasto slope depends on cosmology, redshift and halo mass.\n", "- In NumCosmo, the default value is $\\alpha=0.25$.\n", "\n", "**NB: for CCL, setting a user-defined value for the Einasto slope is only available for CCL version >= 2.6.** Earlier versions only allow the default option.\n", @@ -306,6 +306,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ + "## Side note regarding the Einasto profile (CCL backend only)\n", + "\n", "For CCL versions >= 2.8.1.dev73+g86125b08, the surface mass density profile can be calculated with the quad_vec numerial integration in addition to the default FFTLog. This option will increase the precision of the profile at large radii and can be enabled by calling `set_projected_quad(True)`." ] }, From 761b7388aabbd031a47b46b89d9eaaa3cb429ddf Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sun, 27 Aug 2023 00:44:03 +0800 Subject: [PATCH 31/64] Change python_requires to >= --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 37a2745a0..6d1a6c9a3 100644 --- a/setup.py +++ b/setup.py @@ -41,5 +41,5 @@ def get_version(rel_path): "Programming Language :: Python", ], install_requires=["astropy>=4.0", "numpy", "scipy", "healpy"], - python_requires=">" + str(required_py_version), + python_requires=">=" + str(required_py_version), ) From 64f19c54fd97d6d20f2dacc921cece2f45ae4581 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sun, 27 Aug 2023 01:33:25 +0800 Subject: [PATCH 32/64] Fix docstrings --- clmm/theory/ccl.py | 4 ++-- clmm/theory/cluster_toolkit.py | 6 +++--- clmm/theory/func_layer.py | 22 +++++++++++----------- clmm/theory/generic.py | 14 +++++++------- clmm/theory/numcosmo.py | 4 ++-- clmm/theory/parent_class.py | 8 ++++---- 6 files changed, 29 insertions(+), 29 deletions(-) diff --git a/clmm/theory/ccl.py b/clmm/theory/ccl.py index 2f610ba28..e95271031 100644 --- a/clmm/theory/ccl.py +++ b/clmm/theory/ccl.py @@ -30,11 +30,11 @@ class CCLCLMModeling(CLMModeling): backend: str Name of the backend being used massdef : str - Profile mass definition (`mean`, `critical`, `virial` - letter case independent) + Profile mass definition ("mean", "critical", "virial" - letter case independent) delta_mdef : int Mass overdensity definition. halo_profile_model : str - Profile model parameterization (`nfw`, `einasto`, `hernquist` - letter case independent) + Profile model parameterization ("nfw", "einasto", "hernquist" - letter case independent) cosmo: Cosmology Cosmology object hdpm: Object diff --git a/clmm/theory/cluster_toolkit.py b/clmm/theory/cluster_toolkit.py index c735df505..d383be2db 100644 --- a/clmm/theory/cluster_toolkit.py +++ b/clmm/theory/cluster_toolkit.py @@ -41,11 +41,11 @@ class CTCLMModeling(CLMModeling): backend: str Name of the backend being used massdef : str - Profile mass definition (`mean`, `critical` - letter case independent) + Profile mass definition ("mean", "critical" - letter case independent) delta_mdef : int Mass overdensity definition. halo_profile_model : str - Profile model parameterization (`nfw`, `einasto`, `hernquist` - letter case independent) + Profile model parameterization ("nfw", "einasto", "hernquist" - letter case independent) cosmo: Cosmology Cosmology object hdpm: Object @@ -144,7 +144,7 @@ def _eval_surface_density(self, r_proj, z_cl): ) # pc**-2 to Mpc**-2 def _eval_mean_surface_density(self, r_proj, z_cl): - r"""Computes the mean value of surface density inside radius r_proj + r"""Computes the mean value of surface density inside radius `r_proj` Parameters ---------- diff --git a/clmm/theory/func_layer.py b/clmm/theory/func_layer.py index 3cb56cf21..0eb2d50c5 100644 --- a/clmm/theory/func_layer.py +++ b/clmm/theory/func_layer.py @@ -5,7 +5,7 @@ # pylint: disable=invalid-name # Thin functonal layer on top of the class implementation of CLMModeling . # The functions expect a global instance of the actual CLMModeling named -# `_modeling_object'. +# "_modeling_object". import numpy as np @@ -365,7 +365,7 @@ def compute_excess_surface_density_2h( .. math:: \Delta\Sigma_{\text{2h}}(R) = \frac{\rho_m(z)b(M)}{(1 + z)^3D_A(z)^2} - \int\frac{ldl}{(2\pi)} P_{\rm mm}(k_l, z)J_2(l\theta) + \int\frac{ldl}{(2\pi)} P_{\text{mm}}(k_l, z)J_2(l\theta) where @@ -431,13 +431,13 @@ def compute_surface_density_2h( r"""Computes the 2-halo term surface density from eq.(13) of Oguri & Hamana (2011) .. math:: - \Sigma_{\rm 2h}(R) = \frac{\rho_m(z)b(M)}{(1 + z)^3D_A(z)^2} \int\frac{ldl}{(2\pi)} - P_{\rm mm}(k_l, z)J_0(l\theta) + \Sigma_{\text{2h}}(R) = \frac{\rho_\text{m}(z)b(M)}{(1 + z)^3D_A(z)^2} + \int\frac{ldl}{(2\pi)}P_{\text{mm}}(k_l, z)J_0(l\theta) where .. math:: - k_l = \frac{l}{D_A(z)(1 +z)} + k_l = \frac{l}{D_A(z)(1 + z)} and :math:`b(M)` is the halo bias @@ -488,14 +488,14 @@ def compute_critical_surface_density_eff(cosmo, z_cluster, pzbins, pzpdf, valida r"""Computes the 'effective critical surface density' .. math:: - \langle \Sigma_{\rm crit}^{-1}\rangle^{-1} = \left(\int \frac{1}{\Sigma_{\rm crit}(z)} - p(z) dz\right)^{-1} + \langle \Sigma_{\text{crit}}^{-1}\rangle^{-1} = + \left(\int \frac{1}{\Sigma_{\text{crit}}(z)}p(z) \mathrm{d}z\right)^{-1} where :math:`p(z)` is the source photoz probability density function. This comes from the maximum likelihood estimator for evaluating a :math:`\Delta\Sigma` profile. - For the standard :math:`\Sigma_{\rm crit}(z)` definition, use the `eval_sigma_crit` method of + For the standard :math:`\Sigma_{\text{crit}}(z)` definition, use the `eval_sigma_crit` method of the CLMM cosmology object. Parameters @@ -848,9 +848,9 @@ def compute_reduced_tangential_shear( massdef : str, optional Profile mass definition, with the following supported options (letter case independent): - * `mean` (default); - * `critical` - not in cluster_toolkit; - * `virial` - not in cluster_toolkit; + * 'mean' (default); + * 'critical' - not in cluster_toolkit; + * 'virial' - not in cluster_toolkit; alpha_ein : float, None, optional If `halo_profile_model=='einasto'`, set the value of the Einasto slope. diff --git a/clmm/theory/generic.py b/clmm/theory/generic.py index 4e6a68c4a..e28754d7c 100644 --- a/clmm/theory/generic.py +++ b/clmm/theory/generic.py @@ -85,7 +85,7 @@ def compute_rdelta(mdelta, redshift, cosmo, massdef="mean", delta_mdef=200): cosmo : clmm.Cosmology Cosmology object massdef : str, None - Profile mass definition (`mean`, `critical`, `virial`). + Profile mass definition ("mean", "critical", "virial"). delta_mdef : int, None Mass overdensity definition. @@ -151,11 +151,11 @@ def compute_profile_mass_in_radius( cdelta : float Concentration of the profile. massdef : str, None - Profile mass definition (`mean`, `critical`, `virial`). + Profile mass definition ("mean", "critical", "virial"). delta_mdef : int, None Mass overdensity definition. halo_profile_model : str - Profile model parameterization (`nfw`, `einasto`, `hernquist`). + Profile model parameterization ("nfw", "einasto", "hernquist"). alpha : float, None Einasto slope, required when `halo_profile_model='einasto'`. @@ -209,19 +209,19 @@ def convert_profile_mass_concentration( cosmo : clmm.Cosmology Cosmology object massdef : str, None - Input profile mass definition (`mean`, `critical`, `virial`). + Input profile mass definition ("mean", "critical", "virial"). delta_mdef : int, None Input mass overdensity definition. halo_profile_model : str, None - Input profile model parameterization (`nfw`, `einasto`, `hernquist`). + Input profile model parameterization ("nfw", "einasto", "hernquist"). massdef2 : str, None - Profile mass definition to convert to (`mean`, `critical`, `virial`). + Profile mass definition to convert to ("mean", "critical", "virial"). If None, `massdef2=massdef`. delta_mdef2 : int, None Mass overdensity definition to convert to. If None, `delta_mdef2=delta_mdef`. halo_profile_model2 : str, None - Profile model parameterization to convert to (`nfw`, `einasto`, `hernquist`). + Profile model parameterization to convert to ("nfw", "einasto", "hernquist"). If None, `halo_profile_model2=halo_profile_model`. alpha : float, None Input Einasto slope when `halo_profile_model='einasto'`. diff --git a/clmm/theory/numcosmo.py b/clmm/theory/numcosmo.py index 556c22bd5..8902abee4 100644 --- a/clmm/theory/numcosmo.py +++ b/clmm/theory/numcosmo.py @@ -23,11 +23,11 @@ class NumCosmoCLMModeling(CLMModeling): backend: str Name of the backend being used massdef : str - Profile mass definition (`mean`, `critical`, `virial` - letter case independent) + Profile mass definition ("mean", "critical", "virial" - letter case independent) delta_mdef : int Mass overdensity definition. halo_profile_model : str - Profile model parameterization (`nfw`, `einasto`, `hernquist` - letter case independent) + Profile model parameterization ("nfw", "einasto", "hernquist" - letter case independent) cosmo: Cosmology Cosmology object hdpm: Object diff --git a/clmm/theory/parent_class.py b/clmm/theory/parent_class.py index 91c50892f..d27b8f7c6 100644 --- a/clmm/theory/parent_class.py +++ b/clmm/theory/parent_class.py @@ -45,11 +45,11 @@ class CLMModeling: cdelta: float Concentration of the profile massdef : str - Profile mass definition (`mean`, `critical`, `virial` - letter case independent) + Profile mass definition ("mean", "critical", "virial" - letter case independent) delta_mdef : int Mass overdensity definition. halo_profile_model : str - Profile model parameterization (`nfw`, `einasto`, `hernquist` - letter case independent) + Profile model parameterization ("nfw", "einasto", "hernquist" - letter case independent) cosmo: Cosmology Cosmology object hdpm: Object @@ -1714,13 +1714,13 @@ def convert_mass_concentration( z_cl: float Redshift of the cluster massdef : str, None - Profile mass definition to convert to (`mean`, `critical`, `virial`). + Profile mass definition to convert to ("mean", "critical", "virial"). If None, same value of current model is used. delta_mdef : int, None Mass overdensity definition to convert to. If None, same value of current model is used. halo_profile_model : str, None - Profile model parameterization to convert to (`nfw`, `einasto`, `hernquist`). + Profile model parameterization to convert to ("nfw", "einasto", "hernquist"). If None, same value of current model is used. alpha : float, None Einasto slope to convert to when `halo_profile_model='einasto'`. From 71efa67f2cd36e55cd2057ce5f2ae2f036e5c01f Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sun, 27 Aug 2023 01:34:26 +0800 Subject: [PATCH 33/64] Fix docstrings --- clmm/theory/cluster_toolkit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clmm/theory/cluster_toolkit.py b/clmm/theory/cluster_toolkit.py index d383be2db..6b9e33400 100644 --- a/clmm/theory/cluster_toolkit.py +++ b/clmm/theory/cluster_toolkit.py @@ -45,7 +45,7 @@ class CTCLMModeling(CLMModeling): delta_mdef : int Mass overdensity definition. halo_profile_model : str - Profile model parameterization ("nfw", "einasto", "hernquist" - letter case independent) + Profile model parameterization ("nfw" - letter case independent) cosmo: Cosmology Cosmology object hdpm: Object From 18e2387e484b117fbc04cce3a4972ffb543c3fe5 Mon Sep 17 00:00:00 2001 From: m-aguena Date: Thu, 7 Sep 2023 03:02:51 -0700 Subject: [PATCH 34/64] update nbs to newer CLMM API --- examples/Paper_v1.0/gt_and_use_case.ipynb | 1 + examples/demo_boost_factors.ipynb | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/Paper_v1.0/gt_and_use_case.ipynb b/examples/Paper_v1.0/gt_and_use_case.ipynb index a27f93b03..31c94f3ea 100644 --- a/examples/Paper_v1.0/gt_and_use_case.ipynb +++ b/examples/Paper_v1.0/gt_and_use_case.ipynb @@ -100,6 +100,7 @@ " photoz_sigma_unscaled=0.05, # Photo-z errors to source redshifts\n", " field_size=field_size,\n", " ngal_density=20, # number of gal/arcmin2 for z in [0, infty]\n", + " pzpdf_type='individual_bins',\n", ")[\"ra\", \"dec\", \"e1\", \"e2\", \"z\", \"ztrue\", \"pzbins\", \"pzpdf\", \"id\"]\n", "print(f'Catalog table with the columns: {\", \".join(mock_galaxies.colnames)}')\n", "\n", diff --git a/examples/demo_boost_factors.ipynb b/examples/demo_boost_factors.ipynb index 11a763a67..fda156a82 100644 --- a/examples/demo_boost_factors.ipynb +++ b/examples/demo_boost_factors.ipynb @@ -246,10 +246,10 @@ "metadata": {}, "outputs": [], "source": [ - "nfw_boost = u.compute_nfw_boost(cl.DeltaSigma_profile[\"radius\"], rs=1000, b0=0.1)\n", + "nfw_boost = u.compute_nfw_boost(cl.DeltaSigma_profile[\"radius\"], rscale=1000, boost0=0.1)\n", "\n", "powerlaw_boost = u.compute_powerlaw_boost(\n", - " cl.DeltaSigma_profile[\"radius\"], rs=1000, b0=0.1, alpha=-1.0\n", + " cl.DeltaSigma_profile[\"radius\"], rscale=1000, boost0=0.1, alpha=-1.0\n", ")" ] }, From 54671eb2a841104674a5ccf097bdf3da592a5551 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Thu, 7 Sep 2023 22:47:44 +0800 Subject: [PATCH 35/64] Update examples/other_compare_NFW_critical_massdef.ipynb --- .../other_compare_NFW_critical_massdef.ipynb | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/examples/other_compare_NFW_critical_massdef.ipynb b/examples/other_compare_NFW_critical_massdef.ipynb index 0ce2798d5..79224581b 100644 --- a/examples/other_compare_NFW_critical_massdef.ipynb +++ b/examples/other_compare_NFW_critical_massdef.ipynb @@ -163,18 +163,22 @@ "\n", "# CCL\n", "MDEF = \"critical\"\n", - "conc = ccl.halos.ConcentrationConstant(cvir)\n", - "mdef = ccl.halos.MassDef(Delta, \"critical\", c_m_relation=conc)\n", + "mdef = ccl.halos.MassDef(Delta, MDEF)\n", + "conc = ccl.halos.ConcentrationConstant(cvir, mass_def=mdef)\n", + "\n", "# mdef.concentration = conc\n", "\n", "ccl_nfw_num_opt = ccl.halos.HaloProfileNFW(\n", - " conc, truncated=False, projected_analytic=False, cumul2d_analytic=False, fourier_analytic=False\n", + " mass_def=mdef, concentration=conc,\n", + " truncated=False, projected_analytic=False, cumul2d_analytic=False, fourier_analytic=False\n", ")\n", "ccl_nfw_num = ccl.halos.HaloProfileNFW(\n", - " conc, truncated=False, projected_analytic=False, cumul2d_analytic=False\n", + " mass_def=mdef, concentration=conc,\n", + " truncated=False, projected_analytic=False, cumul2d_analytic=False\n", ")\n", "ccl_nfw_ana = ccl.halos.HaloProfileNFW(\n", - " conc, truncated=False, projected_analytic=True, cumul2d_analytic=True\n", + " mass_def=mdef, concentration=conc,\n", + " truncated=False, projected_analytic=True, cumul2d_analytic=True\n", ")\n", "\n", "# Colossus\n", @@ -243,15 +247,15 @@ "nc_Sigma_nfw_num = smd.sigma_array(nc_nfw, cosmo, r, 1.0, 1.0, z)\n", "\n", "# CCL\n", - "ccl_Sigma_nfw_ana = ccl_nfw_ana.projected(cosmo_ccl, r / a, Mvir, a, mdef) / a**2\n", - "ccl_Sigma_nfw_num = ccl_nfw_num.projected(cosmo_ccl, r / a, Mvir, a, mdef) / a**2\n", + "ccl_Sigma_nfw_ana = ccl_nfw_ana.projected(cosmo_ccl, r / a, Mvir, a) / a**2\n", + "ccl_Sigma_nfw_num = ccl_nfw_num.projected(cosmo_ccl, r / a, Mvir, a) / a**2\n", "\n", "# CCL numerical NFW, using optimised setup\n", "# When using fourier_analytic=False in CCL profile definition, CCL performs\n", "# better by first evaluating the profile on a wider range and then\n", "# interpolating to the desired radii\n", "rtmp = np.geomspace(1.0e-4, 100, 1000)\n", - "tmp = ccl_nfw_num_opt.projected(cosmo_ccl, rtmp / a, Mvir, a, mdef) / a**2\n", + "tmp = ccl_nfw_num_opt.projected(cosmo_ccl, rtmp / a, Mvir, a) / a**2\n", "ptf = interp1d(np.log(rtmp), np.log(tmp), bounds_error=False, fill_value=-100)\n", "ccl_Sigma_nfw_num_opt = np.exp(ptf(np.log(r)))\n", "\n", @@ -292,11 +296,11 @@ "nc_DeltaSigma_nfw_num = np.array(smd.sigma_excess_array(nc_nfw, cosmo, r, 1.0, 1.0, z))\n", "\n", "# CCL\n", - "ccl_BarSigma_nfw_ana = ccl_nfw_ana.cumul2d(cosmo_ccl, r / a, Mvir, a, mdef) / a**2\n", + "ccl_BarSigma_nfw_ana = ccl_nfw_ana.cumul2d(cosmo_ccl, r / a, Mvir, a) / a**2\n", "ccl_DeltaSigma_nfw_ana = ccl_BarSigma_nfw_ana - ccl_Sigma_nfw_ana\n", "\n", "# CCL numerical NFW, using default setup\n", - "ccl_BarSigma_nfw_num = ccl_nfw_num.cumul2d(cosmo_ccl, r / a, Mvir, a, mdef) / a**2\n", + "ccl_BarSigma_nfw_num = ccl_nfw_num.cumul2d(cosmo_ccl, r / a, Mvir, a) / a**2\n", "ccl_DeltaSigma_nfw_num = ccl_BarSigma_nfw_num - ccl_Sigma_nfw_num\n", "\n", "# CCL numerical NFW, using optimised setup\n", @@ -304,7 +308,7 @@ "# better by first evaluating the profile on a wider range and then\n", "# interpolating to the desired radii\n", "rtmp = np.geomspace(1.0e-4, 100, 1000) # extended radial range\n", - "tmp = ccl_nfw_num_opt.cumul2d(cosmo_ccl, rtmp / a, Mvir, a, mdef) / a**2 # CCL estimation\n", + "tmp = ccl_nfw_num_opt.cumul2d(cosmo_ccl, rtmp / a, Mvir, a) / a**2 # CCL estimation\n", "ptf = interp1d(np.log(rtmp), np.log(tmp), bounds_error=False, fill_value=-100) # interpolation\n", "ccl_BarSigma_nfw_num_opt = np.exp(ptf(np.log(r))) # evaluation on the desired radius array\n", "ccl_DeltaSigma_nfw_num_opt = ccl_BarSigma_nfw_num_opt - ccl_Sigma_nfw_num_opt\n", @@ -716,7 +720,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.12" + "version": "3.11.5" } }, "nbformat": 4, From 907b1bdee1bea0a54d001bc1725dafa90bb1ce6b Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Thu, 7 Sep 2023 22:54:48 +0800 Subject: [PATCH 36/64] Update examples/Paper_v1.0/mass_bias_from_models.ipynb --- .../Paper_v1.0/mass_bias_from_models.ipynb | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/examples/Paper_v1.0/mass_bias_from_models.ipynb b/examples/Paper_v1.0/mass_bias_from_models.ipynb index 4786f7ccb..00f5b00b6 100644 --- a/examples/Paper_v1.0/mass_bias_from_models.ipynb +++ b/examples/Paper_v1.0/mass_bias_from_models.ipynb @@ -150,20 +150,22 @@ "# CCL\n", "MDEF = \"matter\"\n", "mdef = ccl.halos.MassDef(Delta, MDEF)\n", - "conc = ccl.halos.ConcentrationConstant(cvir)\n", - "mdef.concentration = conc\n", + "conc = ccl.halos.ConcentrationConstant(cvir, mass_def=mdef)\n", + "\n", "ccl_nfw_num = ccl.halos.HaloProfileNFW(\n", - " conc, truncated=False, projected_analytic=False, cumul2d_analytic=False\n", + " mass_def=mdef, concentration=conc,\n", + " truncated=False, projected_analytic=False, cumul2d_analytic=False\n", ")\n", "ccl_nfw_ana = ccl.halos.HaloProfileNFW(\n", - " conc, truncated=False, projected_analytic=True, cumul2d_analytic=True\n", + " mass_def=mdef, concentration=conc,\n", + " truncated=False, projected_analytic=True, cumul2d_analytic=True\n", ")\n", "# ccl_nfw_num.update_precision_fftlog (n_per_decade = 1200)\n", - "ccl_ein = ccl.halos.HaloProfileEinasto(conc, truncated=False)\n", - "ccl_her = ccl.halos.HaloProfileHernquist(conc, truncated=False)\n", + "ccl_ein = ccl.halos.HaloProfileEinasto(mass_def=mdef, concentration=conc, truncated=False)\n", + "ccl_her = ccl.halos.HaloProfileHernquist(mass_def=mdef, concentration=conc, truncated=False)\n", "\n", "\n", - "alpha = ccl_ein._get_alpha(cosmo_ccl, Mvir, a, mdef)" + "alpha = ccl_ein._get_alpha(cosmo_ccl, Mvir, a)" ] }, { @@ -239,8 +241,8 @@ "\n", "\n", "# CCL\n", - "ccl_Sigma_nfw_ana = ccl_nfw_ana.projected(cosmo_ccl, r / a, Mvir, a, mdef) / a**2\n", - "ccl_BarSigma_nfw_ana = ccl_nfw_ana.cumul2d(cosmo_ccl, r / a, Mvir, a, mdef) / a**2\n", + "ccl_Sigma_nfw_ana = ccl_nfw_ana.projected(cosmo_ccl, r / a, Mvir, a) / a**2\n", + "ccl_BarSigma_nfw_ana = ccl_nfw_ana.cumul2d(cosmo_ccl, r / a, Mvir, a) / a**2\n", "ccl_DeltaSigma_nfw_ana = ccl_BarSigma_nfw_ana - ccl_Sigma_nfw_ana" ] }, @@ -262,8 +264,8 @@ "source": [ "def model_ref_nfw(r, logm, bias):\n", " m = 10.0**logm\n", - " tmp_Sigma = ccl_nfw_ana.projected(cosmo_ccl, r / a, m, a, mdef) / a**2\n", - " tmp_BarSigma = ccl_nfw_ana.cumul2d(cosmo_ccl, r / a, m, a, mdef) / a**2\n", + " tmp_Sigma = ccl_nfw_ana.projected(cosmo_ccl, r / a, m, a) / a**2\n", + " tmp_BarSigma = ccl_nfw_ana.cumul2d(cosmo_ccl, r / a, m, a) / a**2\n", " model = (tmp_BarSigma - tmp_Sigma) * (1 + bias)\n", " return model\n", "\n", @@ -346,8 +348,8 @@ "# CCL numerical\n", "def model_num_ccl(r, logm):\n", " m = 10.0**logm\n", - " tmp_Sigma = ccl_nfw_num.projected(cosmo_ccl, r / a, m, a, mdef) / a**2\n", - " tmp_BarSigma = ccl_nfw_num.cumul2d(cosmo_ccl, r / a, m, a, mdef) / a**2\n", + " tmp_Sigma = ccl_nfw_num.projected(cosmo_ccl, r / a, m, a) / a**2\n", + " tmp_BarSigma = ccl_nfw_num.cumul2d(cosmo_ccl, r / a, m, a) / a**2\n", " model = tmp_BarSigma - tmp_Sigma\n", " return model" ] @@ -543,9 +545,9 @@ ], "metadata": { "kernelspec": { - "display_name": "mydesc3", + "display_name": "Python 3 (ipykernel)", "language": "python", - "name": "mydesc3" + "name": "python3" }, "language_info": { "codemirror_mode": { @@ -557,7 +559,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.6" + "version": "3.11.5" } }, "nbformat": 4, From 2b2946f13fd4f3eb58301755112cc19b43cf1deb Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Thu, 7 Sep 2023 23:10:19 +0800 Subject: [PATCH 37/64] Update examples/Paper_v1.0/validation_tests.ipynb --- examples/Paper_v1.0/validation_tests.ipynb | 74 ++++++++++++++-------- 1 file changed, 49 insertions(+), 25 deletions(-) diff --git a/examples/Paper_v1.0/validation_tests.ipynb b/examples/Paper_v1.0/validation_tests.ipynb index 74a6735cd..6d8ddb9c3 100644 --- a/examples/Paper_v1.0/validation_tests.ipynb +++ b/examples/Paper_v1.0/validation_tests.ipynb @@ -2,7 +2,9 @@ "cells": [ { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "jp-MarkdownHeadingCollapsed": true + }, "source": [ "# Validation tests for the CLMM backends\n", "\n", @@ -161,28 +163,34 @@ "\n", "# CCL\n", "MDEF = \"matter\"\n", - "conc = ccl.halos.ConcentrationConstant(cvir)\n", - "mdef = ccl.halos.MassDef(Delta, \"matter\", c_m_relation=conc)\n", + "mdef = ccl.halos.MassDef(Delta, MDEF)\n", + "conc = ccl.halos.ConcentrationConstant(cvir, mass_def=mdef)\n", "# mdef.concentration = conc\n", "\n", "ccl_nfw_num_opt = ccl.halos.HaloProfileNFW(\n", - " conc, truncated=False, projected_analytic=False, cumul2d_analytic=False, fourier_analytic=False\n", + " mass_def=mdef, concentration=conc,\n", + " truncated=False, projected_analytic=False, cumul2d_analytic=False, fourier_analytic=False\n", ")\n", "ccl_nfw_num = ccl.halos.HaloProfileNFW(\n", - " conc, truncated=False, projected_analytic=False, cumul2d_analytic=False\n", + " mass_def=mdef, concentration=conc,\n", + " truncated=False, projected_analytic=False, cumul2d_analytic=False\n", ")\n", "ccl_nfw_ana = ccl.halos.HaloProfileNFW(\n", - " conc, truncated=False, projected_analytic=True, cumul2d_analytic=True\n", + " mass_def=mdef, concentration=conc,\n", + " truncated=False, projected_analytic=True, cumul2d_analytic=True\n", ")\n", "\n", "# ccl_nfw_num.update_precision_fftlog (n_per_decade = 10000)\n", "# ccl_nfw_num.update_precision_fftlog (plaw_fourier = -2)\n", "\n", - "ccl_ein = ccl.halos.HaloProfileEinasto(conc, truncated=False)\n", - "ccl_her = ccl.halos.HaloProfileHernquist(conc, truncated=False)\n", + "ccl_ein = ccl.halos.HaloProfileEinasto(mass_def=mdef, concentration=conc,\n", + " truncated=False)\n", + "ccl_ein_quad = ccl.halos.HaloProfileEinasto(mass_def=mdef, concentration=conc,\n", + " truncated=False, projected_quad=True)\n", + "ccl_her = ccl.halos.HaloProfileHernquist(mass_def=mdef, concentration=conc, truncated=False)\n", "\n", "\n", - "alpha = ccl_ein._get_alpha(cosmo_ccl, Mvir, a, mdef)\n", + "alpha = ccl_ein._get_alpha(cosmo_ccl, Mvir, a)\n", "\n", "# Colossus\n", "col_nfw = profile_nfw.NFWProfile(M=(Mvir * cosmo_col.h), c=cvir, z=z, mdef=\"200m\")\n", @@ -277,10 +285,11 @@ "nc_Sigma_her = smd.sigma_array(nc_her, cosmo, r, 1.0, 1.0, z)\n", "\n", "# CCL\n", - "ccl_Sigma_nfw_ana = ccl_nfw_ana.projected(cosmo_ccl, r / a, Mvir, a, mdef) / a**2\n", - "ccl_Sigma_nfw_num = ccl_nfw_num.projected(cosmo_ccl, r / a, Mvir, a, mdef) / a**2\n", - "ccl_Sigma_ein = ccl_ein.projected(cosmo_ccl, r / a, Mvir, a, mdef) / a**2\n", - "ccl_Sigma_her = ccl_her.projected(cosmo_ccl, r / a, Mvir, a, mdef) / a**2\n", + "ccl_Sigma_nfw_ana = ccl_nfw_ana.projected(cosmo_ccl, r / a, Mvir, a) / a**2\n", + "ccl_Sigma_nfw_num = ccl_nfw_num.projected(cosmo_ccl, r / a, Mvir, a) / a**2\n", + "ccl_Sigma_ein = ccl_ein.projected(cosmo_ccl, r / a, Mvir, a) / a**2\n", + "ccl_Sigma_ein_quad = ccl_ein.projected(cosmo_ccl, r / a, Mvir, a) / a**2\n", + "ccl_Sigma_her = ccl_her.projected(cosmo_ccl, r / a, Mvir, a) / a**2\n", "\n", "\n", "# CCL numerical NFW, using optimised setup\n", @@ -288,15 +297,15 @@ "# better by first evaluating the profile on a wider range and then\n", "# interpolating to the desired radii\n", "rtmp = np.geomspace(1.0e-4, 100, 1000)\n", - "tmp = ccl_nfw_num_opt.projected(cosmo_ccl, rtmp / a, Mvir, a, mdef) / a**2\n", + "tmp = ccl_nfw_num_opt.projected(cosmo_ccl, rtmp / a, Mvir, a) / a**2\n", "ptf = interp1d(np.log(rtmp), np.log(tmp), bounds_error=False, fill_value=-100)\n", "ccl_Sigma_nfw_num_opt = np.exp(ptf(np.log(r)))\n", "\n", - "tmp = ccl_ein.projected(cosmo_ccl, rtmp / a, Mvir, a, mdef) / a**2\n", + "tmp = ccl_ein.projected(cosmo_ccl, rtmp / a, Mvir, a) / a**2\n", "ptf = interp1d(np.log(rtmp), np.log(tmp), bounds_error=False, fill_value=-100)\n", "ccl_Sigma_ein_opt = np.exp(ptf(np.log(r)))\n", "\n", - "tmp = ccl_her.projected(cosmo_ccl, rtmp / a, Mvir, a, mdef) / a**2\n", + "tmp = ccl_her.projected(cosmo_ccl, rtmp / a, Mvir, a) / a**2\n", "ptf = interp1d(np.log(rtmp), np.log(tmp), bounds_error=False, fill_value=-100)\n", "ccl_Sigma_her_opt = np.exp(ptf(np.log(r)))\n", "\n", @@ -335,15 +344,15 @@ "nc_DeltaSigma_her = np.array(smd.sigma_excess_array(nc_her, cosmo, r, 1.0, 1.0, z))\n", "\n", "# CCL\n", - "ccl_BarSigma_nfw_ana = ccl_nfw_ana.cumul2d(cosmo_ccl, r / a, Mvir, a, mdef) / a**2\n", + "ccl_BarSigma_nfw_ana = ccl_nfw_ana.cumul2d(cosmo_ccl, r / a, Mvir, a) / a**2\n", "ccl_DeltaSigma_nfw_ana = ccl_BarSigma_nfw_ana - ccl_Sigma_nfw_ana\n", "\n", "# CCL numerical NFW, using default setup\n", - "ccl_BarSigma_nfw_num = ccl_nfw_num.cumul2d(cosmo_ccl, r / a, Mvir, a, mdef) / a**2\n", + "ccl_BarSigma_nfw_num = ccl_nfw_num.cumul2d(cosmo_ccl, r / a, Mvir, a) / a**2\n", "ccl_DeltaSigma_nfw_num = ccl_BarSigma_nfw_num - ccl_Sigma_nfw_num\n", - "ccl_BarSigma_ein = ccl_ein.cumul2d(cosmo_ccl, r / a, Mvir, a, mdef) / a**2\n", + "ccl_BarSigma_ein = ccl_ein.cumul2d(cosmo_ccl, r / a, Mvir, a) / a**2\n", "ccl_DeltaSigma_ein = ccl_BarSigma_ein - ccl_Sigma_ein\n", - "ccl_BarSigma_her = ccl_her.cumul2d(cosmo_ccl, r / a, Mvir, a, mdef) / a**2\n", + "ccl_BarSigma_her = ccl_her.cumul2d(cosmo_ccl, r / a, Mvir, a) / a**2\n", "ccl_DeltaSigma_her = ccl_BarSigma_her - ccl_Sigma_her\n", "\n", "\n", @@ -353,17 +362,17 @@ "# interpolating to the desired radii\n", "\n", "rtmp = np.geomspace(1.0e-4, 100, 1000) # extended radial range\n", - "tmp = ccl_nfw_num_opt.cumul2d(cosmo_ccl, rtmp / a, Mvir, a, mdef) / a**2 # CCL estimation\n", + "tmp = ccl_nfw_num_opt.cumul2d(cosmo_ccl, rtmp / a, Mvir, a) / a**2 # CCL estimation\n", "ptf = interp1d(np.log(rtmp), np.log(tmp), bounds_error=False, fill_value=-100) # interpolation\n", "ccl_BarSigma_nfw_num_opt = np.exp(ptf(np.log(r))) # evaluation on the desired radius array\n", "ccl_DeltaSigma_nfw_num_opt = ccl_BarSigma_nfw_num_opt - ccl_Sigma_nfw_num_opt\n", "\n", - "tmp = ccl_ein.cumul2d(cosmo_ccl, rtmp / a, Mvir, a, mdef) / a**2\n", + "tmp = ccl_ein.cumul2d(cosmo_ccl, rtmp / a, Mvir, a) / a**2\n", "ptf = interp1d(np.log(rtmp), np.log(tmp), bounds_error=False, fill_value=-100)\n", "ccl_BarSigma_ein_opt = np.exp(ptf(np.log(r)))\n", "ccl_DeltaSigma_ein_opt = ccl_BarSigma_ein_opt - ccl_Sigma_ein_opt\n", "\n", - "tmp = ccl_her.cumul2d(cosmo_ccl, rtmp / a, Mvir, a, mdef) / a**2\n", + "tmp = ccl_her.cumul2d(cosmo_ccl, rtmp / a, Mvir, a) / a**2\n", "ptf = interp1d(np.log(rtmp), np.log(tmp), bounds_error=False, fill_value=-100)\n", "ccl_BarSigma_her_opt = np.exp(ptf(np.log(r)))\n", "ccl_DeltaSigma_her_opt = ccl_BarSigma_her_opt - ccl_Sigma_her_opt\n", @@ -662,6 +671,14 @@ ")\n", "axs[0].plot(\n", " r,\n", + " np.abs(ccl_Sigma_ein_quad / nc_Sigma_ein - 1.0),\n", + " label=\"CCL - EIN (quad)\",\n", + " linestyle=\":\",\n", + " color=\"darkorange\",\n", + " lw=0.5,\n", + ")\n", + "axs[0].plot(\n", + " r,\n", " np.abs(ccl_Sigma_ein_opt / nc_Sigma_ein - 1.0),\n", " label=\"CCL - EIN (opt)\",\n", " linestyle=\"--\",\n", @@ -857,6 +874,13 @@ ")\n", "axs[1].plot(\n", " r,\n", + " np.abs(ccl_Sigma_ein_quad / col_Sigma_ein - 1.0),\n", + " label=\"EIN - CCL (quad)\",\n", + " color=\"cadetblue\",\n", + " linestyle=\"--\",\n", + ")\n", + "axs[1].plot(\n", + " r,\n", " np.abs(ct_Sigma_ein / col_Sigma_ein - 1.0),\n", " label=\"EIN - CT\",\n", " color=\"cadetblue\",\n", @@ -991,7 +1015,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -1005,7 +1029,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.8" + "version": "3.11.5" } }, "nbformat": 4, From f3b22c7238d55f83201746c7a0fa6b840cf35d12 Mon Sep 17 00:00:00 2001 From: m-aguena Date: Fri, 15 Sep 2023 07:04:19 -0700 Subject: [PATCH 38/64] Update version to 1.9.0 --- clmm/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clmm/__init__.py b/clmm/__init__.py index f2e5e440d..4071ee026 100644 --- a/clmm/__init__.py +++ b/clmm/__init__.py @@ -26,4 +26,4 @@ ) from . import support -__version__ = "1.8.2" +__version__ = "1.9.0" From 7e30805b632b4e07fdec0f83bc8030a15268b207 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sat, 16 Sep 2023 02:06:18 +0800 Subject: [PATCH 39/64] Update build_check.yml --- .github/workflows/build_check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_check.yml b/.github/workflows/build_check.yml index f5af239a5..d5533a5c8 100644 --- a/.github/workflows/build_check.yml +++ b/.github/workflows/build_check.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: conda-incubator/setup-miniconda@v2 - name: Install prereq using conda run: | From c24857fa0b4aa47e743c746c90da6e6ef0816041 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sat, 16 Sep 2023 02:09:17 +0800 Subject: [PATCH 40/64] Update build_check.yml --- .github/workflows/build_check.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build_check.yml b/.github/workflows/build_check.yml index d5533a5c8..89ba5ff6f 100644 --- a/.github/workflows/build_check.yml +++ b/.github/workflows/build_check.yml @@ -13,6 +13,9 @@ jobs: steps: - uses: actions/checkout@v4 - uses: conda-incubator/setup-miniconda@v2 + with: + channels: conda-forge + channel-priority: strict - name: Install prereq using conda run: | echo "$CONDA/bin" >> $GITHUB_PATH From 11678c35dfde62699bd23832e9e0b74cbbc56033 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sat, 16 Sep 2023 02:17:53 +0800 Subject: [PATCH 41/64] Update build_check.yml --- .github/workflows/build_check.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/build_check.yml b/.github/workflows/build_check.yml index 89ba5ff6f..d7bc19c86 100644 --- a/.github/workflows/build_check.yml +++ b/.github/workflows/build_check.yml @@ -13,9 +13,6 @@ jobs: steps: - uses: actions/checkout@v4 - uses: conda-incubator/setup-miniconda@v2 - with: - channels: conda-forge - channel-priority: strict - name: Install prereq using conda run: | echo "$CONDA/bin" >> $GITHUB_PATH @@ -36,7 +33,7 @@ jobs: pip install . - name: Install CCL from source run: | - conda install -c conda-forge cmake swig + conda install -c conda-forge --override-channels cmake swig git clone https://github.com/LSSTDESC/CCL cd CCL git checkout v3.0.0 From 439fca03ba86942956c9513480df7c68cfcd285d Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sat, 16 Sep 2023 23:35:09 +0800 Subject: [PATCH 42/64] Revert build_check.yml --- .github/workflows/build_check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_check.yml b/.github/workflows/build_check.yml index d7bc19c86..d5533a5c8 100644 --- a/.github/workflows/build_check.yml +++ b/.github/workflows/build_check.yml @@ -33,7 +33,7 @@ jobs: pip install . - name: Install CCL from source run: | - conda install -c conda-forge --override-channels cmake swig + conda install -c conda-forge cmake swig git clone https://github.com/LSSTDESC/CCL cd CCL git checkout v3.0.0 From b5a730656855fab03e9ae535e2f3e2bff61e302a Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sun, 17 Sep 2023 14:36:19 +0800 Subject: [PATCH 43/64] Show conda info --- .github/workflows/build_check.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_check.yml b/.github/workflows/build_check.yml index d5533a5c8..e67ea3231 100644 --- a/.github/workflows/build_check.yml +++ b/.github/workflows/build_check.yml @@ -16,6 +16,7 @@ jobs: - name: Install prereq using conda run: | echo "$CONDA/bin" >> $GITHUB_PATH + conda info conda install -c conda-forge gobject-introspection pygobject - name: Install prereq using pip run: | From e4e4880cfac30274cb69ef4cb7ca40455dca58f1 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sun, 17 Sep 2023 15:23:21 +0800 Subject: [PATCH 44/64] Add conda-forge channel --- .github/workflows/build_check.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_check.yml b/.github/workflows/build_check.yml index e67ea3231..1b242c98b 100644 --- a/.github/workflows/build_check.yml +++ b/.github/workflows/build_check.yml @@ -13,10 +13,11 @@ jobs: steps: - uses: actions/checkout@v4 - uses: conda-incubator/setup-miniconda@v2 + with: + channels: conda-forge - name: Install prereq using conda run: | echo "$CONDA/bin" >> $GITHUB_PATH - conda info conda install -c conda-forge gobject-introspection pygobject - name: Install prereq using pip run: | From b5906eb7987e59c8c478027523edc34da3117abb Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sun, 17 Sep 2023 15:30:39 +0800 Subject: [PATCH 45/64] Use strict channel-priority --- .github/workflows/build_check.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_check.yml b/.github/workflows/build_check.yml index 1b242c98b..89ba5ff6f 100644 --- a/.github/workflows/build_check.yml +++ b/.github/workflows/build_check.yml @@ -15,6 +15,7 @@ jobs: - uses: conda-incubator/setup-miniconda@v2 with: channels: conda-forge + channel-priority: strict - name: Install prereq using conda run: | echo "$CONDA/bin" >> $GITHUB_PATH From e05ed501602cecbab9bc70e3f534fcefaf454671 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sun, 17 Sep 2023 15:38:58 +0800 Subject: [PATCH 46/64] Revert --- .github/workflows/build_check.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build_check.yml b/.github/workflows/build_check.yml index 89ba5ff6f..d5533a5c8 100644 --- a/.github/workflows/build_check.yml +++ b/.github/workflows/build_check.yml @@ -13,9 +13,6 @@ jobs: steps: - uses: actions/checkout@v4 - uses: conda-incubator/setup-miniconda@v2 - with: - channels: conda-forge - channel-priority: strict - name: Install prereq using conda run: | echo "$CONDA/bin" >> $GITHUB_PATH From 2a5aa3ac50d20f2de5f2c51da0bdce2e6bf4a213 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sun, 17 Sep 2023 15:53:35 +0800 Subject: [PATCH 47/64] Require numpy<1.26 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index c507da7cc..fc9e7ad0c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ astropy>=4, !=5.0 matplotlib -numpy>=1.17 +numpy>=1.17, <1.26 scipy>=1.3 From 34e308cbaecfab947acca3d98293e6335303e305 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sun, 17 Sep 2023 16:00:12 +0800 Subject: [PATCH 48/64] NumCosmo --no-update-deps --- .github/workflows/build_check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_check.yml b/.github/workflows/build_check.yml index d5533a5c8..6ce2b095a 100644 --- a/.github/workflows/build_check.yml +++ b/.github/workflows/build_check.yml @@ -25,7 +25,7 @@ jobs: pip install . - name: Install NumCosmo from conda-forge run: | - conda install -c conda-forge numcosmo + conda install -c conda-forge numcosmo --no-update-deps - name: Install cluster_toolkit from source run: | git clone https://github.com/tmcclintock/cluster_toolkit.git From 76f50e1a66d0994db0a422d851e365c7dc3187f9 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sun, 17 Sep 2023 16:07:36 +0800 Subject: [PATCH 49/64] Require conda install numpy<1.26 --- .github/workflows/build_check.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_check.yml b/.github/workflows/build_check.yml index 6ce2b095a..95f07d0a8 100644 --- a/.github/workflows/build_check.yml +++ b/.github/workflows/build_check.yml @@ -25,6 +25,7 @@ jobs: pip install . - name: Install NumCosmo from conda-forge run: | + conda install -c conda-forge numpy<1.26 conda install -c conda-forge numcosmo --no-update-deps - name: Install cluster_toolkit from source run: | From 9af58aa5a5aa3a7843c641d17d7a4002028c03a6 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sun, 17 Sep 2023 16:20:32 +0800 Subject: [PATCH 50/64] Update build_check.yml --- .github/workflows/build_check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_check.yml b/.github/workflows/build_check.yml index 95f07d0a8..9d5e08624 100644 --- a/.github/workflows/build_check.yml +++ b/.github/workflows/build_check.yml @@ -25,7 +25,7 @@ jobs: pip install . - name: Install NumCosmo from conda-forge run: | - conda install -c conda-forge numpy<1.26 + conda install -c conda-forge "numpy<1.26" conda install -c conda-forge numcosmo --no-update-deps - name: Install cluster_toolkit from source run: | From 814484858f2450fa077c2d9a6f2a7403797844e2 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sun, 17 Sep 2023 16:26:02 +0800 Subject: [PATCH 51/64] Revert --- .github/workflows/build_check.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build_check.yml b/.github/workflows/build_check.yml index 9d5e08624..d5533a5c8 100644 --- a/.github/workflows/build_check.yml +++ b/.github/workflows/build_check.yml @@ -25,8 +25,7 @@ jobs: pip install . - name: Install NumCosmo from conda-forge run: | - conda install -c conda-forge "numpy<1.26" - conda install -c conda-forge numcosmo --no-update-deps + conda install -c conda-forge numcosmo - name: Install cluster_toolkit from source run: | git clone https://github.com/tmcclintock/cluster_toolkit.git From 459b0fe637ca4c5346bdd48c4c92da54114e8e78 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sun, 17 Sep 2023 16:34:37 +0800 Subject: [PATCH 52/64] libcurl>8.2.1 --- .github/workflows/build_check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_check.yml b/.github/workflows/build_check.yml index d5533a5c8..e7e3f2471 100644 --- a/.github/workflows/build_check.yml +++ b/.github/workflows/build_check.yml @@ -33,7 +33,7 @@ jobs: pip install . - name: Install CCL from source run: | - conda install -c conda-forge cmake swig + conda install -c conda-forge cmake swig libcurl>8.2.1 git clone https://github.com/LSSTDESC/CCL cd CCL git checkout v3.0.0 From ab71b8b2ace356b11e8aba46772cb56384fdf72f Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sun, 17 Sep 2023 16:41:11 +0800 Subject: [PATCH 53/64] libcurl>8.2.1 with NumCosmo --- .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 e7e3f2471..ea89cd05e 100644 --- a/.github/workflows/build_check.yml +++ b/.github/workflows/build_check.yml @@ -25,7 +25,7 @@ jobs: pip install . - name: Install NumCosmo from conda-forge run: | - conda install -c conda-forge numcosmo + conda install -c conda-forge numcosmo libcurl>8.2.1 - name: Install cluster_toolkit from source run: | git clone https://github.com/tmcclintock/cluster_toolkit.git @@ -33,7 +33,7 @@ jobs: pip install . - name: Install CCL from source run: | - conda install -c conda-forge cmake swig libcurl>8.2.1 + conda install -c conda-forge cmake swig git clone https://github.com/LSSTDESC/CCL cd CCL git checkout v3.0.0 From 27448ee5ed8770141f4b4563956bf30835eda75a Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sun, 17 Sep 2023 16:45:56 +0800 Subject: [PATCH 54/64] "libcurl>8.2.1" --- .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 ea89cd05e..b4e6f7406 100644 --- a/.github/workflows/build_check.yml +++ b/.github/workflows/build_check.yml @@ -25,7 +25,7 @@ jobs: pip install . - name: Install NumCosmo from conda-forge run: | - conda install -c conda-forge numcosmo libcurl>8.2.1 + conda install -c conda-forge numcosmo - name: Install cluster_toolkit from source run: | git clone https://github.com/tmcclintock/cluster_toolkit.git @@ -33,7 +33,7 @@ jobs: pip install . - name: Install CCL from source run: | - conda install -c conda-forge cmake swig + conda install -c conda-forge cmake swig "libcurl>8.2.1" git clone https://github.com/LSSTDESC/CCL cd CCL git checkout v3.0.0 From 6dc0fd4cd272497c1f0a3f280398400cf6b6ae4f Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sun, 17 Sep 2023 17:23:11 +0800 Subject: [PATCH 55/64] Require cmake=3.27.5 --- .github/workflows/build_check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_check.yml b/.github/workflows/build_check.yml index b4e6f7406..4608dd5e5 100644 --- a/.github/workflows/build_check.yml +++ b/.github/workflows/build_check.yml @@ -33,7 +33,7 @@ jobs: pip install . - name: Install CCL from source run: | - conda install -c conda-forge cmake swig "libcurl>8.2.1" + conda install -c conda-forge cmake swig cmake=3.27.5 git clone https://github.com/LSSTDESC/CCL cd CCL git checkout v3.0.0 From 3700a997c998c3c6f5eac07709972908821ab1aa Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sun, 17 Sep 2023 17:26:14 +0800 Subject: [PATCH 56/64] Require cmake>=3.27 --- .github/workflows/build_check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_check.yml b/.github/workflows/build_check.yml index 4608dd5e5..17e5e1471 100644 --- a/.github/workflows/build_check.yml +++ b/.github/workflows/build_check.yml @@ -33,7 +33,7 @@ jobs: pip install . - name: Install CCL from source run: | - conda install -c conda-forge cmake swig cmake=3.27.5 + conda install -c conda-forge cmake swig "cmake>=3.27" git clone https://github.com/LSSTDESC/CCL cd CCL git checkout v3.0.0 From 5287bce6401f3d573e95a2f59d14fb99d11d8878 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sun, 17 Sep 2023 19:23:47 +0800 Subject: [PATCH 57/64] Install CCL first --- .github/workflows/build_check.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_check.yml b/.github/workflows/build_check.yml index 17e5e1471..ca5f4cb5b 100644 --- a/.github/workflows/build_check.yml +++ b/.github/workflows/build_check.yml @@ -23,6 +23,13 @@ jobs: - name: Install the package run: | pip install . + - name: Install CCL from source + run: | + conda install -c conda-forge cmake swig "cmake>=3.27" + git clone https://github.com/LSSTDESC/CCL + cd CCL + git checkout v3.0.0 + pip install . - name: Install NumCosmo from conda-forge run: | conda install -c conda-forge numcosmo @@ -31,13 +38,6 @@ jobs: git clone https://github.com/tmcclintock/cluster_toolkit.git cd cluster_toolkit pip install . - - name: Install CCL from source - run: | - conda install -c conda-forge cmake swig "cmake>=3.27" - git clone https://github.com/LSSTDESC/CCL - cd CCL - git checkout v3.0.0 - pip install . - name: Analysing the code with pylint run: | pip install pylint From 2c9fce3df13556e64f353f5afb98fc7393639341 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sun, 17 Sep 2023 19:26:40 +0800 Subject: [PATCH 58/64] Remove "cmake>=3.27" --- .github/workflows/build_check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_check.yml b/.github/workflows/build_check.yml index ca5f4cb5b..f061f623a 100644 --- a/.github/workflows/build_check.yml +++ b/.github/workflows/build_check.yml @@ -25,7 +25,7 @@ jobs: pip install . - name: Install CCL from source run: | - conda install -c conda-forge cmake swig "cmake>=3.27" + conda install -c conda-forge cmake swig git clone https://github.com/LSSTDESC/CCL cd CCL git checkout v3.0.0 From 65969c558e73b1a3e70bb71176064ff4279165f1 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sun, 17 Sep 2023 20:22:01 +0800 Subject: [PATCH 59/64] Revert --- .github/workflows/build_check.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_check.yml b/.github/workflows/build_check.yml index f061f623a..d5533a5c8 100644 --- a/.github/workflows/build_check.yml +++ b/.github/workflows/build_check.yml @@ -23,13 +23,6 @@ jobs: - name: Install the package run: | pip install . - - name: Install CCL from source - run: | - conda install -c conda-forge cmake swig - git clone https://github.com/LSSTDESC/CCL - cd CCL - git checkout v3.0.0 - pip install . - name: Install NumCosmo from conda-forge run: | conda install -c conda-forge numcosmo @@ -38,6 +31,13 @@ jobs: git clone https://github.com/tmcclintock/cluster_toolkit.git cd cluster_toolkit pip install . + - name: Install CCL from source + run: | + conda install -c conda-forge cmake swig + git clone https://github.com/LSSTDESC/CCL + cd CCL + git checkout v3.0.0 + pip install . - name: Analysing the code with pylint run: | pip install pylint From c2cb29b93ca2ef5343f7ca3f67a59e4d68889967 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sun, 17 Sep 2023 21:53:13 +0800 Subject: [PATCH 60/64] pygobject<3.46.0 --- .github/workflows/build_check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_check.yml b/.github/workflows/build_check.yml index d5533a5c8..175808f58 100644 --- a/.github/workflows/build_check.yml +++ b/.github/workflows/build_check.yml @@ -16,7 +16,7 @@ jobs: - name: Install prereq using conda run: | echo "$CONDA/bin" >> $GITHUB_PATH - conda install -c conda-forge gobject-introspection pygobject + conda install -c conda-forge gobject-introspection pygobject<3.46.0 - name: Install prereq using pip run: | pip install -r requirements.txt From cff25094c84a4770236dc6a1d5e6497092e87e8d Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Sun, 17 Sep 2023 23:55:05 +0800 Subject: [PATCH 61/64] Update build_check.yml --- .github/workflows/build_check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_check.yml b/.github/workflows/build_check.yml index 175808f58..829865138 100644 --- a/.github/workflows/build_check.yml +++ b/.github/workflows/build_check.yml @@ -16,7 +16,7 @@ jobs: - name: Install prereq using conda run: | echo "$CONDA/bin" >> $GITHUB_PATH - conda install -c conda-forge gobject-introspection pygobject<3.46.0 + conda install -c conda-forge gobject-introspection "pygobject<3.46.0" - name: Install prereq using pip run: | pip install -r requirements.txt From c90326020a933a9f3b75b960253f12b64bc72a97 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Mon, 18 Sep 2023 00:21:12 +0800 Subject: [PATCH 62/64] Revert --- .github/workflows/build_check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_check.yml b/.github/workflows/build_check.yml index 829865138..d5533a5c8 100644 --- a/.github/workflows/build_check.yml +++ b/.github/workflows/build_check.yml @@ -16,7 +16,7 @@ jobs: - name: Install prereq using conda run: | echo "$CONDA/bin" >> $GITHUB_PATH - conda install -c conda-forge gobject-introspection "pygobject<3.46.0" + conda install -c conda-forge gobject-introspection pygobject - name: Install prereq using pip run: | pip install -r requirements.txt From 7efe879f6b0a7110c14ba626c5ddb85bd8a3d32c Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Mon, 18 Sep 2023 20:07:05 +0800 Subject: [PATCH 63/64] Update requirements.txt --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index fc9e7ad0c..c507da7cc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ astropy>=4, !=5.0 matplotlib -numpy>=1.17, <1.26 +numpy>=1.17 scipy>=1.3 From f0f8a380faf64ddf19d3ac109d250b086f45ab57 Mon Sep 17 00:00:00 2001 From: Hsin Fan <57552401+hsinfan1996@users.noreply.github.com> Date: Mon, 18 Sep 2023 20:07:37 +0800 Subject: [PATCH 64/64] Remove --override-channels --- .github/workflows/build_check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_check.yml b/.github/workflows/build_check.yml index a87a0a0bc..d5533a5c8 100644 --- a/.github/workflows/build_check.yml +++ b/.github/workflows/build_check.yml @@ -33,7 +33,7 @@ jobs: pip install . - name: Install CCL from source run: | - conda install -c conda-forge cmake swig --override-channels + conda install -c conda-forge cmake swig git clone https://github.com/LSSTDESC/CCL cd CCL git checkout v3.0.0