Skip to content

Commit 52af4d1

Browse files
committed
Fix Ruff errors
1 parent 49170be commit 52af4d1

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

litebird_sim/mueller_convolver.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# MR: This code is maintained externally, so I'm switching auto-formatting off
33
# to make updating from outside sources easier.
44
from dataclasses import dataclass
5-
from typing import List, Optional, Tuple, Union
65

76
import ducc0
87
import numpy as np
@@ -37,12 +36,12 @@ class TruncatedBlm:
3736
mmax: int
3837

3938

40-
def truncate_blm(inp: np.ndarray, lmax: int, mmax: int, epsilon: float = 1e-10) -> List[Optional[TruncatedBlm]]:
39+
def truncate_blm(inp: np.ndarray, lmax: int, mmax: int, epsilon: float = 1e-10) -> list[TruncatedBlm | None]:
4140
"""
4241
Analyzes the beam components and truncates them at the highest significant m-mode.
4342
"""
4443
limit = epsilon * np.max(np.abs(inp))
45-
out: List[Optional[TruncatedBlm]] = []
44+
out: list[TruncatedBlm | None] = []
4645
for i in range(len(inp)):
4746
maxk = -1
4847
idx = 0
@@ -262,7 +261,8 @@ def _mueller_tc_prep(self, blm: np.ndarray, mueller: np.ndarray, lmax: int, mmax
262261
# Since we padded blm2_dense to mmax+4, checking bounds for +/- 2 is safe
263262
# Checking +/- 4 might technically hit edge if m is at limit, but loop handles range.
264263
def get_d(comp, idx_m):
265-
if idx_m < 0 or idx_m >= blm2_dense.shape[1]: return 0j
264+
if idx_m < 0 or idx_m >= blm2_dense.shape[1]:
265+
return 0j
266266
return blm2_dense[comp, idx_m, lrange]
267267

268268
# T component, Marta notes [4a]

litebird_sim/noise.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from numbers import Number
21
import numpy as np
32
import scipy as sp
43
from numba import njit

0 commit comments

Comments
 (0)