Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dynamic versioning #1209

Merged
merged 21 commits into from
Nov 13, 2024
Merged
5 changes: 3 additions & 2 deletions .github/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ dependencies:
- fftw
- swig
- pyyaml
- numpy
# The below is only because the currnt version of fast-pt uses deprecated scipy functions.
- numpy<2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you checked that this doesn't break other CCL stuff that might have been updated to numpy 2?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The opposite, actually. We cannot yet move to numpy 2 because many of our dependencies still don't use numpy 2. firecrown is in the same situation. This will be a tricky migration.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also want to add this numpy<2 in the pyproject.toml dependencies.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

# The below is only because the current version of fast-pt uses deprecated scipy functions.
# DarkEmulator also uses an old scipy.
# We should remove the <1.14 flag as soon as this is fixed.
- scipy<1.14
- camb
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Unreleased

# v3.1.2 Changes
- Fixed dynamic versioning

# v3.1.1 Changes
- Update physical constants (#1196)
- Fixed bug in Despali 2016 mass function (#1197)

# v3.1 Changes
- Docstring improvements (#1168, #1177, #1184).
- Minor bugfixes (#1167, #1169, #1170, #1172, #1187, #1188).
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.5)
if (NOT CMAKE_BUILD_TYPE)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure why, but I wasn't able to fix dynamic versioning without this requirement.

message(STATUS "No build type selected, default to Release")
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
Expand All @@ -8,7 +8,7 @@ MESSAGE( STATUS "CMAKE_BUILD_TYPE: " ${CMAKE_BUILD_TYPE} )
# Adding customized cmake module
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules/")

project(ccl VERSION 3.1)
project(ccl VERSION 3.1.2)

# Uncomment to get detailed build outputs
# set( CMAKE_VERBOSE_MAKEFILE on )
Expand Down
13 changes: 12 additions & 1 deletion benchmarks/test_ptpk_bacco_lbias.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,17 @@
import pyccl as ccl
import pyccl.nl_pt as pt
import pytest
import platform

LPTPK_TOLERANCE = 1e-4

if platform.system() == 'Darwin':
# TODO: This test fails on macOS, even if it passes
# on linux using the same version of bacco. As a
# patch we are increasing the tolerance for macOS,
# but this should be investigated.
LPTPK_TOLERANCE = 1e-3
else:
LPTPK_TOLERANCE = 1e-4

# Set cosmology
COSMO = ccl.Cosmology(Omega_c=0.25, Omega_b=0.05,
Expand Down Expand Up @@ -37,6 +46,8 @@

@pytest.mark.parametrize('comb', enumerate(order))
def test_pt_pk(comb):
import baccoemu
print(baccoemu.__version__)
i_d, cc = comb
t1, t2 = cc

Expand Down
2 changes: 1 addition & 1 deletion pyccl/halos/halo_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def number_counts(self, cosmo, *, selection,
mint[i] = self._integrator(
dVda[i] * self._mf[..., :] * _selm[..., :],
self._lmass
)
).squeeze()
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few warnings were being triggered because of this (the result of the integral is an array of size 1 instead of a scalar, which numpy doesn't like).


# now do scale factor integral
return self._integrator(mint, a)
Expand Down
Loading
Loading