Skip to content

Commit 0a6828d

Browse files
committed
fix linting
1 parent e08fa78 commit 0a6828d

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

s2fft/precompute_transforms/custom_ops.py

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ def wigner_subset_to_s2(
3838
3939
"""
4040
if sampling.lower() not in ["mw", "mwss"]:
41-
raise ValueError(f"Fourier-Wigner algorithm does not support {sampling} sampling.")
41+
raise ValueError(
42+
f"Fourier-Wigner algorithm does not support {sampling} sampling."
43+
)
4244

4345
# EXTRACT VARIOUS PRECOMPUTES
4446
Delta, _ = DW
@@ -55,7 +57,9 @@ def wigner_subset_to_s2(
5557
n = -spins
5658

5759
# Calculate fmna = i^(n-m)\sum_L Delta^l_am Delta^l_an f^l_mn(2l+1)/(8pi^2)
58-
x = np.zeros((flmn.shape[0], n_dim, xnlm_size, xnlm_size, flmn.shape[-1]), dtype=flmn.dtype)
60+
x = np.zeros(
61+
(flmn.shape[0], n_dim, xnlm_size, xnlm_size, flmn.shape[-1]), dtype=flmn.dtype
62+
)
5963
x[:, :, m_offset:, m_offset:, :] = np.einsum(
6064
"bnlmc,lam,lan,l->bnamc",
6165
flmn,
@@ -65,7 +69,9 @@ def wigner_subset_to_s2(
6569
)
6670

6771
# APPLY SIGN FUNCTION AND PHASE SHIFT
68-
x = np.einsum("bnamc,m,n,a->bnamc", x, 1j ** (-m), 1j ** (n), np.exp(1j * m * theta0))
72+
x = np.einsum(
73+
"bnamc,m,n,a->bnamc", x, 1j ** (-m), 1j ** (n), np.exp(1j * m * theta0)
74+
)
6975

7076
# IFFT OVER THETA AND PHI
7177
x = np.fft.ifftshift(x, axes=(-3, -2))
@@ -106,7 +112,9 @@ def wigner_subset_to_s2_jax(
106112
107113
"""
108114
if sampling.lower() not in ["mw", "mwss"]:
109-
raise ValueError(f"Fourier-Wigner algorithm does not support {sampling} sampling.")
115+
raise ValueError(
116+
f"Fourier-Wigner algorithm does not support {sampling} sampling."
117+
)
110118

111119
# EXTRACT VARIOUS PRECOMPUTES
112120
Delta, _ = DW
@@ -123,7 +131,9 @@ def wigner_subset_to_s2_jax(
123131
n = -spins
124132

125133
# Calculate fmna = i^(n-m)\sum_L Delta^l_am Delta^l_an f^l_mn(2l+1)/(8pi^2)
126-
x = jnp.zeros((flmn.shape[0], n_dim, xnlm_size, xnlm_size, flmn.shape[-1]), dtype=flmn.dtype)
134+
x = jnp.zeros(
135+
(flmn.shape[0], n_dim, xnlm_size, xnlm_size, flmn.shape[-1]), dtype=flmn.dtype
136+
)
127137
x = x.at[:, :, m_offset:, m_offset:, :].set(
128138
jnp.einsum(
129139
"bnlmc,lam,lan,l->bnamc",
@@ -135,7 +145,9 @@ def wigner_subset_to_s2_jax(
135145
)
136146

137147
# APPLY SIGN FUNCTION AND PHASE SHIFT
138-
x = jnp.einsum("bnamc,m,n,a->bnamc", x, 1j ** (-m), 1j ** (n), jnp.exp(1j * m * theta0))
148+
x = jnp.einsum(
149+
"bnamc,m,n,a->bnamc", x, 1j ** (-m), 1j ** (n), jnp.exp(1j * m * theta0)
150+
)
139151

140152
# IFFT OVER THETA AND PHI
141153
x = jnp.fft.ifftshift(x, axes=(-3, -2))
@@ -258,7 +270,9 @@ def s2_to_wigner_subset(
258270
259271
"""
260272
if sampling.lower() not in ["mw", "mwss"]:
261-
raise ValueError(f"Fourier-Wigner algorithm does not support {sampling} sampling.")
273+
raise ValueError(
274+
f"Fourier-Wigner algorithm does not support {sampling} sampling."
275+
)
262276

263277
# EXTRACT VARIOUS PRECOMPUTES
264278
Delta, Quads = DW
@@ -342,7 +356,9 @@ def s2_to_wigner_subset_jax(
342356
343357
"""
344358
if sampling.lower() not in ["mw", "mwss"]:
345-
raise ValueError(f"Fourier-Wigner algorithm does not support {sampling} sampling.")
359+
raise ValueError(
360+
f"Fourier-Wigner algorithm does not support {sampling} sampling."
361+
)
346362

347363
# EXTRACT VARIOUS PRECOMPUTES
348364
Delta, Quads = DW

0 commit comments

Comments
 (0)