Skip to content

Commit c747760

Browse files
author
John Halloran
committed
style: clean up several lines and remove noqa
1 parent b200826 commit c747760

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

doc/source/conf.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020

2121
# If extensions (or modules to document with autodoc) are in another directory,
2222
# add these directories to sys.path here. If the directory is relative to the
23-
# documentation root, use Path().resolve() to make it absolute, like shown here. # noqa: E501
23+
# documentation root, use Path().resolve() to make it absolute,
24+
# like shown here.
2425
# sys.path.insert(0, str(Path(".").resolve()))
2526
sys.path.insert(0, str(Path("../..").resolve()))
2627
sys.path.insert(0, str(Path("../../src").resolve()))
@@ -204,7 +205,7 @@
204205
# html_file_suffix = None
205206

206207
# Output file base name for HTML help builder.
207-
basename = "diffpy.snmf".replace(" ", "").replace(".", "") # noqa: E501
208+
basename = "diffpy.snmf".replace(" ", "").replace(".", "")
208209
htmlhelp_basename = basename + "doc"
209210

210211

src/diffpy/snmf/snmf_class.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ def apply_transformation_matrix(
628628
# Expand row indices
629629
repm = np.tile(
630630
np.arange(self.n_components),
631-
(self.signal_length, self.n_signals), # noqa E501
631+
(self.signal_length, self.n_signals),
632632
)
633633

634634
# Compute transformations
@@ -747,9 +747,7 @@ def update_components(self):
747747
* (self.components_ - self._prev_components)
748748
) # Element-wise multiplication
749749
denom = (
750-
np.linalg.norm(
751-
self.components_ - self._prev_components, "fro"
752-
) # noqa E501
750+
np.linalg.norm(self.components_ - self._prev_components, "fro")
753751
** 2
754752
) # Frobenius norm squared
755753
step_size = num / denom if denom > 0 else initial_step_size
@@ -946,8 +944,7 @@ def _compute_objective_function(
946944
regularization_term = (
947945
0.5
948946
* rho
949-
* np.linalg.norm(spline_smooth_operator @ stretch.T, "fro")
950-
** 2 # noqa E501
947+
* np.linalg.norm(spline_smooth_operator @ stretch.T, "fro") ** 2
951948
)
952949
sparsity_term = eta * np.sum(np.sqrt(components))
953950
return residual_term + regularization_term + sparsity_term

0 commit comments

Comments
 (0)