Skip to content

Commit 5948716

Browse files
committed
MAINT: Fix linting
1 parent f233281 commit 5948716

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

pybaselines/two_d/_algorithm_setup.py

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -410,19 +410,12 @@ def _setup_whittaker(self, y, lam=1, diff_order=2, weights=None, copy_weights=Fa
410410
if self._sort_order is not None and weights is not None:
411411
weight_array = weight_array[self._sort_order]
412412

413-
if False:#(
414-
#TODO can probably keep the basis for reuse if using SVD, like _setup_spline does, and
415-
# retain the unmodified penalties for the rows and columns if possible to skip that
416-
# calculation as well
417-
418-
#self.whittaker_system is not None
419-
#and self.whittaker_system.same_basis(diff_order, num_eigens)
420-
#):
421-
self.whittaker_system.update_penalty(lam)
422-
else:
423-
whittaker_system = WhittakerSystem2D(
424-
self._shape, lam, diff_order, num_eigens
425-
)
413+
# TODO can probably keep the basis for reuse if using SVD, like _setup_spline does, and
414+
# retain the unmodified penalties for the rows and columns if possible to skip that
415+
# calculation as well
416+
whittaker_system = WhittakerSystem2D(
417+
self._shape, lam, diff_order, num_eigens
418+
)
426419
if not whittaker_system._using_svd:
427420
y = y.ravel()
428421
weight_array = weight_array.ravel()
@@ -607,7 +600,7 @@ def _setup_spline(self, y, weights=None, spline_degree=3, num_knots=10,
607600
):
608601
self._spline_basis = SplineBasis2D(self.x, self.z, num_knots, spline_degree)
609602

610-
#TODO should probably also retain the unmodified penalties for the rows and
603+
# TODO should probably also retain the unmodified penalties for the rows and
611604
# columns if possible to skip that calculation as well
612605
pspline = PSpline2D(self._spline_basis, lam, diff_order)
613606

tests/test_algorithm_setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def test_setup_whittaker_reset_penalized_system(small_data, algorithm, diff_orde
165165
weights = np.linspace(0.01, 1, small_data.shape[0])
166166
whittaker_system.add_diagonal(weights)
167167

168-
#TODO update these tests once the original diagonals are tracked by _Algorithm again
168+
# TODO update these tests once the original diagonals are tracked by _Algorithm again
169169
# now reset with a new lam value
170170
_, _, whittaker_system_2 = algorithm._setup_whittaker(
171171
small_data, lam_2, diff_order, allow_lower=allow_lower, reverse_diags=reverse_diags

0 commit comments

Comments
 (0)