Skip to content

Commit 7b8727a

Browse files
authored
Merge pull request #571 from mrava87/fix-dtcwtimport
fix: ensure dtcwt is not used in typing annotations
2 parents 0d19f56 + 5451f4d commit 7b8727a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pylops/signalprocessing/dtcwt.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,12 @@ def _nd_to_2d(self, arr_nd):
138138
arr_2d = arr_nd.reshape(self.dims[self.axis], -1).squeeze()
139139
return arr_2d
140140

141-
def _coeff_to_array(self, pyr: dtcwt.Pyramid) -> NDArray:
141+
def _coeff_to_array(self, pyr): # cannot use dtcwt types as it may not be installed
142142
highpass_coeffs = np.vstack([h for h in pyr.highpasses])
143143
coeffs = np.concatenate((highpass_coeffs, pyr.lowpass), axis=0)
144144
return coeffs
145145

146-
def _array_to_coeff(self, X: NDArray) -> dtcwt.Pyramid:
146+
def _array_to_coeff(self, X): # cannot use dtcwt types as it may not be installed
147147
lowpass = (X[-self.lowpass_size :].real).reshape((-1, self.otherdims))
148148
_ptr = 0
149149
highpasses = ()
@@ -154,7 +154,7 @@ def _array_to_coeff(self, X: NDArray) -> dtcwt.Pyramid:
154154
highpasses += (_h,)
155155
return dtcwt.Pyramid(lowpass, highpasses)
156156

157-
def get_pyramid(self, x: NDArray) -> dtcwt.Pyramid:
157+
def get_pyramid(self, x): # cannot use dtcwt types as it may not be installed
158158
"""Return Pyramid object from flat real-valued array"""
159159
return self._array_to_coeff(x[0] + 1j * x[1])
160160

0 commit comments

Comments
 (0)