Skip to content

Commit 10df260

Browse files
committed
Support python 3.14, update NumPy to 2 and Ducc to 0.41
1 parent 0f67778 commit 10df260

4 files changed

Lines changed: 469 additions & 120 deletions

File tree

litebird_sim/grasp2alm.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ def __init__(self, healpix_map):
5757
def _check_reason(
5858
self, reason: int, iter_count: int, residual_norm: float, quality: float
5959
) -> None:
60-
assert reason in (1, 2), (
60+
assert reason in (
61+
1,
62+
2,
63+
), (
6164
f"pseudo_analysis failed, reason: {REASON_DESCRIPTION[reason]}, {iter_count=}, {residual_norm=}, {quality=}"
6265
)
6366

@@ -95,7 +98,7 @@ def to_alm(
9598
(3, SphericalHarmonics.num_of_alm_from_lmax(lmax, mmax)),
9699
dtype=np.complex128,
97100
)
98-
(_, reason, iter_count, residual_norm, quality) = ducc0.sht.pseudo_analysis(
101+
_, reason, iter_count, residual_norm, quality = ducc0.sht.pseudo_analysis(
99102
map=self.map[0].reshape(1, -1), # Make this a 2D matrix
100103
alm=alm[0, :].reshape(1, -1),
101104
lmax=lmax,
@@ -190,7 +193,7 @@ def beam_mapmaker(
190193
if hit_map[i] > 0:
191194
output_map[i] /= hit_map[i]
192195
else:
193-
output_map[i] = np.NaN
196+
output_map[i] = np.nan
194197

195198

196199
@dataclass

pyproject.toml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,22 @@ authors = [
3030
]
3131
readme = "README.md"
3232
license = {text = "GPL-3.0"}
33-
requires-python = ">=3.10,<3.14"
33+
requires-python = ">=3.10,<=3.14"
3434
dependencies = [
35-
"numba>=0.63.0",
36-
"numpy>=1.26.4",
35+
"numba>=0.65.0",
36+
"numpy>=2.2.6",
3737
"astropy>=6.1.7",
3838
"tomlkit>=0.12.1",
3939
"jinja2>=3.1",
40-
"matplotlib>=3.10.3",
40+
"matplotlib>=3.10.8",
4141
"healpy>=1.18.1",
4242
"pyyaml>=6.0",
4343
"jplephem>=2.22",
4444
"requests>=2.32.0",
4545
"rich>=14.0.0",
46-
"ducc0>=0.40.0",
47-
"pysm3>=3.4.2",
46+
"ducc0>=0.41.0",
47+
"pysm3>=3.4.4",
4848
"h5py>=3.9",
49-
"deprecation>=2.1.0",
5049
"deprecated>=1.2.18",
5150
"scipy>=1.14.0",
5251
"libinsdb>=0.9.0",

test/test_binner.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ def test_accumulate_map_and_info():
5454
assert np.allclose(res_info, info)
5555

5656
rhs = mapping._extract_map_and_fill_info(info)
57-
assert np.allclose(np.linalg.solve(info, rhs), res_map)
57+
# Starting from NumPy 2, we must reshape `rhs`
58+
# so that it matches the shape of the `info` tensor.
59+
# Plus, we add `.squeeze(1)` to remove the (new)
60+
# dimension at the end of the result
61+
assert np.allclose(np.linalg.solve(info, rhs[..., np.newaxis]).squeeze(-1), res_map)
5862

5963

6064
def test_make_binned_map_api_simulation(tmp_path):

0 commit comments

Comments
 (0)