Skip to content

Commit

Permalink
Fix numba regression from GH#7
Browse files Browse the repository at this point in the history
  • Loading branch information
scottshambaugh committed Mar 19, 2024
1 parent 6ca6104 commit 38f005b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/monaco/dvars_sensitivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import numpy as np
from monaco.helper_functions import vprint
from scipy.optimize import minimize
from scipy.linalg import det
from warnings import warn

# numba is recommended for speed, as this will be very slow otherwise
Expand Down Expand Up @@ -270,7 +269,7 @@ def calc_L(phi : np.ndarray,
M = np.ones((m, 1))
R = calc_R(phi, X)
Rinv = np.linalg.inv(R)
Rdet = max(det(R), 1e-12) # Protect for poor conditioning
Rdet = max(np.linalg.det(R), 1e-12) # Protect for poor conditioning

mu = np.linalg.inv(M.T @ Rinv @ M) @ (M.T @ Rinv @ Y)

Expand Down Expand Up @@ -301,7 +300,7 @@ def calc_R(phi : np.ndarray,
The correlation matrix.
"""
m = X.shape[0]
R = np.ones((m, m))
R = np.ones((m, m), dtype=np.float64)
for u in range(1, m):
# do lower triangle only and duplicate across diag
# diag will be all 1s
Expand Down

0 comments on commit 38f005b

Please sign in to comment.