Skip to content

Commit fa2ff5a

Browse files
committed
Rename module import
1 parent d5b1fea commit fa2ff5a

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

glass/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
"lognormal_fields",
4949
"lognormal_gls",
5050
"lognormal_shift_hilbert2011",
51-
"multalm",
5251
"multi_plane_matrix",
5352
"multi_plane_weights",
5453
"nfields_from_nspectra",
@@ -62,6 +61,7 @@
6261
"restrict",
6362
"save_cls",
6463
"shear_from_convergence",
64+
"sht",
6565
"smail_nz",
6666
"solve_gaussian_spectra",
6767
"spectra_indices",
@@ -78,7 +78,7 @@
7878
from ._version import __version__
7979

8080
# modules
81-
from glass import algorithm, grf
81+
from glass import algorithm, grf, sht
8282
from glass.fields import (
8383
check_posdef_spectra,
8484
cls2cov,
@@ -109,7 +109,6 @@
109109
redshifts,
110110
redshifts_from_nz,
111111
)
112-
from glass.harmonictools import multalm
113112
from glass.lensing import (
114113
MultiPlaneConvergence,
115114
deflect,

glass/fields.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import glass
2020
import glass.grf
21-
import glass.harmonictools
21+
import glass.sht
2222

2323
if TYPE_CHECKING:
2424
from collections.abc import Callable, Generator, Iterable, Iterator, Sequence
@@ -397,11 +397,11 @@ def _generate_grf(
397397

398398
# scale by standard deviation of the conditional distribution
399399
# variance is distributed over real and imaginary part
400-
alm = glass.harmonictools.multalm(z, s)
400+
alm = glass.sht.multalm(z, s)
401401

402402
# add the mean of the conditional distribution
403403
for i in range(ncorr):
404-
alm += glass.harmonictools.multalm(y[:, i], a[:, i])
404+
alm += glass.sht.multalm(y[:, i], a[:, i])
405405

406406
# store the standard normal in y array at the indicated index
407407
if j is not None:

tests/test_harmonictools.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import numpy as np
66
import pytest
77

8-
import glass.harmonictools
8+
import glass.sht
99

1010
if TYPE_CHECKING:
1111
import types
@@ -22,7 +22,7 @@ def test_multalm(xp: types.ModuleType) -> None:
2222
bl = xp.asarray([2.0, 0.5, 1.0])
2323
alm_copy = xp.asarray(alm, copy=True)
2424

25-
result = glass.harmonictools.multalm(alm, bl, inplace=True)
25+
result = glass.sht.multalm(alm, bl, inplace=True)
2626

2727
np.testing.assert_allclose(result, alm)
2828
expected_result = xp.asarray([2.0, 1.0, 1.5, 4.0, 5.0, 6.0])
@@ -39,14 +39,14 @@ def test_multalm(xp: types.ModuleType) -> None:
3939
alm = xp.asarray([1.0, 2.0, 3.0, 4.0, 5.0, 6.0])
4040
bl = xp.ones(3)
4141

42-
result = glass.harmonictools.multalm(alm, bl, inplace=False)
42+
result = glass.sht.multalm(alm, bl, inplace=False)
4343
np.testing.assert_allclose(result, alm)
4444

4545
# multiple with 0s
4646

4747
bl = xp.asarray([0.0, 1.0, 0.0])
4848

49-
result = glass.harmonictools.multalm(alm, bl, inplace=False)
49+
result = glass.sht.multalm(alm, bl, inplace=False)
5050

5151
expected_result = xp.asarray([0.0, 2.0, 3.0, 0.0, 0.0, 0.0])
5252
np.testing.assert_allclose(result, expected_result)
@@ -56,5 +56,5 @@ def test_multalm(xp: types.ModuleType) -> None:
5656
alm = xp.asarray([])
5757
bl = xp.asarray([])
5858

59-
result = glass.harmonictools.multalm(alm, bl, inplace=False)
59+
result = glass.sht.multalm(alm, bl, inplace=False)
6060
np.testing.assert_allclose(result, alm)

0 commit comments

Comments
 (0)