Skip to content

Commit

Permalink
[CI] Turn on pydocstyle and improve coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
f-dangel committed Nov 8, 2023
1 parent 2eb654f commit 65a2377
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/lint-pydocstyle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ on:

jobs:
pydocstyle:
# NOTE: Uncomment the following line to disable
if: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
Expand Down
3 changes: 1 addition & 2 deletions curvlinops/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,7 @@ def _check_deterministic(self):

@staticmethod
def print_nonclose(array1: ndarray, array2: ndarray, rtol: float, atol: float):
"""Check if the two arrays are element-wise equal within a tolerance and print
the entries that differ.
"""Check element-wise equality of two arrays and print differing entries.
Args:
array1: First array for comparison.
Expand Down
17 changes: 17 additions & 0 deletions curvlinops/papyan2020traces/spectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,23 @@ def lanczos_approximate_spectrum_from_iter(
kappa: float,
margin: float,
) -> Tuple[ndarray, ndarray]:
"""Estimate the spectral density from Lanczos iterations.
Args:
lanczos_iter: Eigenvalues and eigenvectors of the tri-diagonal matrix built up
during Lanczos iterations. ``evecs[:, i]`` is normalized eigenvector of
``evals[i]``.
boundaries: Estimates of the minimum and maximum eigenvalues used as boundaries
for the spectral density's grid.
num_points: Resolution of the spectral density's grid.
kappa: Width of the Gaussian bumps used as approximate delta peaks in the
grid normalized to ``[-1; 1]``. Must be positive.
margin: Relative padding added around the boundary values (half to the left,
half to the right).
Returns:
The grid and the approximated spectral density.
"""
eval_min, eval_max = boundaries
_width = eval_max - eval_min
_padding = margin * _width
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,4 @@ strictness = full
[pydocstyle]
convention = google
match = .*\.py
match_dir = ^(?!(test|.git)).*
match_dir = ^(?!(test|.git|docs)).*

0 comments on commit 65a2377

Please sign in to comment.