Skip to content

Commit 8514666

Browse files
committed
Update _util.py
1 parent 7c3316e commit 8514666

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/ptwt/_util.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from __future__ import annotations
44

55
import functools
6+
import itertools as itt
67
import typing
78
import warnings
89
from collections.abc import Callable, Sequence
@@ -854,7 +855,8 @@ def _group_for_symmetric(padding: tuple[int, ...]) -> list[tuple[int, int]]:
854855

855856
def _get_padding_n(data, wavelet, n: int) -> tuple[int, ...]:
856857
wavelet_length = _get_len(wavelet)
857-
rv = []
858-
for i in range(1, n + 1):
859-
rv.extend(_get_pad(data.shape[-i], wavelet_length))
860-
return tuple(rv)
858+
return tuple(
859+
itt.chain.from_iterable(
860+
_get_pad(data.shape[-i], wavelet_length) for i in range(1, n + 1)
861+
)
862+
)

0 commit comments

Comments
 (0)