Skip to content

Commit d3fe7f1

Browse files
committed
test: fixed test_memoize_evals_2 for macos azure action
1 parent 8b0fdfd commit d3fe7f1

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

pylops/optimization/cls_sparsity.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1771,7 +1771,7 @@ def step(self, x: NDArray, show: bool = False) -> Tuple[NDArray, float]:
17711771
if self.SOp is not None:
17721772
x = self.SOpmatvec(x)
17731773

1774-
# check model update
1774+
# compute model update norm
17751775
if not self.preallocate:
17761776
xupdate = np.linalg.norm(x - xold)
17771777
else:
@@ -1782,7 +1782,7 @@ def step(self, x: NDArray, show: bool = False) -> Tuple[NDArray, float]:
17821782
)
17831783
xupdate = np.linalg.norm(self.xold)
17841784

1785-
# cost functions
1785+
# compute cost functions
17861786
costdata = 0.5 * np.linalg.norm(self.res if self.preallocate else res) ** 2
17871787
costreg = self.eps * np.linalg.norm(x, ord=1)
17881788
self.cost.append(float(costdata + costreg))

pytests/test_memoizeoperator.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
from numpy.testing import assert_array_almost_equal
1111

1212
backend = "numpy"
13-
import itertools
14-
1513
import pytest
1614

1715
from pylops import MemoizeOperator
@@ -73,7 +71,7 @@ def test_memoize_evals_2(par):
7371

7472
# Approach 1
7573
Aop1 = Aop.toreal(forw=False, adj=True)
76-
xinv1 = Aop1.div(y)
74+
xinv1 = Aop1.div(y).real
7775
assert_array_almost_equal(x, xinv1)
7876

7977
# Approach 2

0 commit comments

Comments
 (0)