Skip to content

Commit

Permalink
Prepare for new CCL release (#620)
Browse files Browse the repository at this point in the history
* Install CCL from main branch

* setup-miniconda@v3

* only require CCL v3.0

* add pylint ignores

* Move Sphinx prereqs up

* Install setuptools_scm

* document PR on comment in build_check

* Update version to 1.12.1

---------

Co-authored-by: m-aguena <[email protected]>
  • Loading branch information
hsinfan1996 and m-aguena authored Jun 20, 2024
1 parent 50876a8 commit 714b92d
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 13 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/build_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v2
- uses: conda-incubator/setup-miniconda@v3
- 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 sphinx sphinx_rtd_theme nbconvert pandoc ipython
- name: Install prereq using pip
run: |
pip install -r requirements.txt
Expand All @@ -33,11 +33,10 @@ 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 setuptools_scm
git clone https://github.com/LSSTDESC/CCL
cd CCL
git checkout v3.0.0
pip install .
pip install --no-use-pep517 .
- name: Analysing the code with pylint
run: |
pip install pylint
Expand All @@ -48,9 +47,10 @@ jobs:
pytest tests/ --ignore=cluster_toolkit/tests --cov=clmm/
env:
DISPLAY: test
- name: Install Sphinx prereq
run: |
conda install -c conda-forge sphinx sphinx_rtd_theme nbconvert pandoc ipython ipython_genutils
# temporarily moved up due to libarchive issue - see PR 620
# - name: Install Sphinx prereq
# run: |
# conda install -c conda-forge sphinx sphinx_rtd_theme nbconvert pandoc ipython ipython_genutils
- name: Run the docs
run: |
make -C docs/ html
Expand Down
2 changes: 1 addition & 1 deletion clmm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@
)
from . import support

__version__ = "1.12.0"
__version__ = "1.12.1"
5 changes: 2 additions & 3 deletions clmm/theory/ccl.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
# Check which versions of ccl are currently supported
from . import _ccl_supported_versions

if parse(ccl.__version__) < parse(_ccl_supported_versions.VMIN) or parse(ccl.__version__) > parse(
_ccl_supported_versions.VMAX
):
if (parse(ccl.__version__) < parse(_ccl_supported_versions.VMIN)
or parse(ccl.__version__).major > parse(_ccl_supported_versions.VMAX).major):
raise EnvironmentError(
f"Current CCL version ({ccl.__version__}) not supported by CLMM. "
f"It must be between {_ccl_supported_versions.VMIN} and {_ccl_supported_versions.VMAX}."
Expand Down
17 changes: 16 additions & 1 deletion clmm/theory/parent_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,10 @@ def eval_tangential_shear(self, r_proj, z_cl, z_src, z_src_info="discrete", verb

if self.halo_profile_model == "einasto" and verbose:
print(f"Einasto alpha = {self._get_einasto_alpha(z_cl=z_cl)}")
gammat = None

# function _validate_z_src already safekeeps from this error:
# pylint: disable=possibly-used-before-assignment

if z_src_info == "discrete":
warning_msg = (
"\nSome source redshifts are lower than the cluster redshift."
Expand Down Expand Up @@ -844,6 +847,9 @@ def eval_convergence(self, r_proj, z_cl, z_src, z_src_info="discrete", verbose=F
if self.halo_profile_model == "einasto" and verbose:
print(f"Einasto alpha = {self._get_einasto_alpha(z_cl=z_cl)}")

# function _validate_z_src already safekeeps from this error:
# pylint: disable=possibly-used-before-assignment

if z_src_info == "discrete":
warning_msg = (
"\nSome source redshifts are lower than the cluster redshift."
Expand Down Expand Up @@ -1053,6 +1059,9 @@ def eval_reduced_tangential_shear(
if self.halo_profile_model == "einasto" and verbose:
print(f"Einasto alpha = {self._get_einasto_alpha(z_cl=z_cl)}")

# functions _validate_z_src, _validate_approx_z_src_info already safekeeps from this error:
# pylint: disable=possibly-used-before-assignment

if approx is None:
if z_src_info == "distribution":
gt = self._pdz_weighted_avg(
Expand Down Expand Up @@ -1211,6 +1220,9 @@ def eval_magnification(
if self.halo_profile_model == "einasto" and verbose:
print(f"Einasto alpha = {self._get_einasto_alpha(z_cl=z_cl)}")

# functions _validate_z_src, _validate_approx_z_src_info already safekeeps from this error:
# pylint: disable=possibly-used-before-assignment

if approx is None:
if z_src_info == "distribution":
mu = self._pdz_weighted_avg(
Expand Down Expand Up @@ -1375,6 +1387,9 @@ def eval_magnification_bias(
if self.halo_profile_model == "einasto" and verbose:
print(f"Einasto alpha = {self._get_einasto_alpha(z_cl=z_cl)}")

# functions _validate_z_src, _validate_approx_z_src_info already safekeeps from this error:
# pylint: disable=possibly-used-before-assignment

if approx is None:
# z_src (float or array) is redshift
if z_src_info == "distribution":
Expand Down

0 comments on commit 714b92d

Please sign in to comment.