Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] authored and jsdillon committed Feb 19, 2025
1 parent f3dd5f0 commit 36966c0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hera_filters/dspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -2938,7 +2938,7 @@ def sparse_linear_fit_2D(
matrix (X^T W X) of the basis matrices. Prior to computing the inverse, the eigenvalues
of the Gramian matrix are regularized by adding a small value to the diagonal. This
value is calculated by computing the cumulative sum of the eigenvalues and selecting
the smallest value such that the cumulative sum of the largest eigenvalues is less than
the smallest value such that the cumulative sum of the largest eigenvalues is less than
1 - `eigenspec_threshold`. This helps to stabilize the computation of the inverse.
eigenspec_threshold : float, optional, default 1e-3
Regularization parameters for the eigenvalues of the Gramian matrix. This parameter
Expand Down Expand Up @@ -2983,11 +2983,11 @@ def sparse_linear_fit_2D(
# Start by computing separable weights for the two axes
with np.errstate(invalid='ignore'):
axis_1_wgts = np.nanmean(
np.where(weights == 0, np.nan, weights),
np.where(weights == 0, np.nan, weights),
axis=1, keepdims=True
)
axis_2_wgts = np.nanmean(
np.where(weights == 0, np.nan, weights / axis_1_wgts),
np.where(weights == 0, np.nan, weights / axis_1_wgts),
axis=0, keepdims=True
)
axis_1_wgts[~np.isfinite(axis_1_wgts)] = 0.0
Expand Down

0 comments on commit 36966c0

Please sign in to comment.