Skip to content

Commit b3e0333

Browse files
committed
address minor typos for merge
1 parent 3551865 commit b3e0333

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

s2fft/precompute_transforms/construct.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
# Maximum spin number at which Price-McEwen recursion is sufficiently accurate.
1313
# For spins > PM_MAX_STABLE_SPIN one should default to the Risbo recursion.
14-
PM_MAX_STABLE_SPIN = 5
14+
PM_MAX_STABLE_SPIN = 6
1515

1616

1717
def spin_spherical_kernel(
@@ -66,15 +66,15 @@ def spin_spherical_kernel(
6666
+ "Defering to complex transform.",
6767
stacklevel=2,
6868
)
69-
if recursion.lower() == "price-mcewen" and abs(spin) >= PM_MAX_STABLE_SPIN:
69+
if recursion.lower() == "price-mcewen" and abs(spin) > PM_MAX_STABLE_SPIN:
7070
raise ValueError(
71-
f"The Price-McEwen can become unstable for spins >= {PM_MAX_STABLE_SPIN}."
71+
f"The Price-McEwen recursion can become unstable for spins >= {PM_MAX_STABLE_SPIN}."
7272
)
7373

7474
if recursion.lower() == "auto":
7575
# This mode automatically determines which recursion is best suited for the
7676
# current parameter configuration.
77-
recursion = "risbo" if abs(spin) >= PM_MAX_STABLE_SPIN else "price-mcewen"
77+
recursion = "risbo" if abs(spin) > PM_MAX_STABLE_SPIN else "price-mcewen"
7878

7979
dl = []
8080
m_start_ind = L - 1 if reality else 0
@@ -214,15 +214,15 @@ def spin_spherical_kernel_jax(
214214
+ "Defaulting to complex transform.",
215215
stacklevel=2,
216216
)
217-
if recursion.lower() == "price-mcewen" and abs(spin) >= PM_MAX_STABLE_SPIN:
217+
if recursion.lower() == "price-mcewen" and abs(spin) > PM_MAX_STABLE_SPIN:
218218
raise ValueError(
219-
f"The Price-McEwen can become unstable for spins >= {PM_MAX_STABLE_SPIN}."
219+
f"The Price-McEwen recursion can become unstable for spins >= {PM_MAX_STABLE_SPIN}."
220220
)
221221

222222
if recursion.lower() == "auto":
223223
# This mode automatically determines which recursion is best suited for the
224224
# current parameter configuration.
225-
recursion = "risbo" if abs(spin) >= PM_MAX_STABLE_SPIN else "price-mcewen"
225+
recursion = "risbo" if abs(spin) > PM_MAX_STABLE_SPIN else "price-mcewen"
226226

227227
dl = []
228228
m_start_ind = L - 1 if reality else 0

tests/test_spherical_precompute.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
from s2fft.precompute_transforms.spherical import forward, inverse
99
from s2fft.sampling import s2_samples as samples
1010

11+
# Maximum spin number at which Price-McEwen recursion is sufficiently accurate.
12+
# For spins > PM_MAX_STABLE_SPIN one should default to the Risbo recursion.
13+
PM_MAX_STABLE_SPIN = 6
14+
1115
L_to_test = [12]
1216
spin_to_test = [-2, 0, 6]
1317
nside_to_test = [4, 5]
@@ -17,8 +21,6 @@
1721
methods_to_test = ["numpy", "jax", "torch"]
1822
recursions_to_test = ["price-mcewen", "risbo", "auto"]
1923

20-
PM_MAX_STABLE_SPIN = 5
21-
2224

2325
@pytest.mark.parametrize("L", L_to_test)
2426
@pytest.mark.parametrize("spin", spin_to_test)

0 commit comments

Comments
 (0)