Skip to content

Commit 5938fef

Browse files
committed
Address review: move changelog to 2.8.0, simplify test docstring/comments
1 parent 515e51a commit 5938fef

2 files changed

Lines changed: 7 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Changelog
22
=========
33

4+
# 2.8.0
5+
* Fixed element-wise variance accumulation in `pylops.optimization.cls_basic.LSQR`
6+
and `pylops.lsqr`, which previously assigned the same value to every entry of
7+
`var` (#639)
8+
49
# 2.7.0
510
* Added cubic spline interpolation operator via
611
`pylops.signalprocessing.interpspline.InterpCubicSpline` (also interfaceable via
@@ -17,9 +22,6 @@ Changelog
1722
and `pylops.waveeqprocessing.Marchenko`
1823
* Improved typing annotations across all operators (and enforced use of
1924
Literal for parameters with multiple options)
20-
* Fixed element-wise variance accumulation in `pylops.optimization.cls_basic.LSQR`
21-
and `pylops.lsqr`, which previously assigned the same value to every entry of
22-
`var` (#639)
2325

2426
# 2.6.0
2527
* Added `pylops.medical` module and `pylops.medical.CT2D` operator

pytests/test_solver.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -382,11 +382,8 @@ def test_lsqr_pylops_scipy(par):
382382
)
383383
@pytest.mark.parametrize("par", [(par3), (par4)])
384384
def test_lsqr_calc_var(par):
385-
"""LSQR ``var`` estimates the diagonal of (A^H A)^-1 element-wise.
386-
387-
Each unknown must get its own variance; a regression would make all entries
388-
identical. scipy's LSQR is used as the reference implementation.
389-
"""
385+
"""Compare PyLops and scipy LSQR variance computation for the diagonal of
386+
(A^H A)^-1 (issue #639)."""
390387
np.random.seed(10)
391388

392389
A = np.random.normal(0, 1, (par["ny"], par["nx"]))
@@ -399,7 +396,6 @@ def test_lsqr_calc_var(par):
399396
var = lsqr(Aop, y, x0=None, niter=niter, atol=1e-8, btol=1e-8)[9]
400397
var_sp = sp_lsqr(Aop, y, iter_lim=niter, atol=1e-8, btol=1e-8, calc_var=True)[9]
401398

402-
# the dot(dk, dk) bug produced a constant vector instead (issue #639)
403399
assert not np.allclose(var, var[0])
404400
assert_array_almost_equal(var, var_sp, decimal=6)
405401

0 commit comments

Comments
 (0)