Skip to content

Commit

Permalink
Fix types to support numpy 2
Browse files Browse the repository at this point in the history
  • Loading branch information
dafeda authored Jun 28, 2024
1 parent 640de45 commit 8c23618
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/iterative_ensemble_smoother/esmda_inversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def normalize_alpha(alpha: npt.NDArray[np.double]) -> npt.NDArray[np.double]:
Examples
--------
>>> alpha = np.arange(10) + 1
>>> np.sum(1/normalize_alpha(alpha))
>>> float(np.sum(1/normalize_alpha(alpha)))
1.0
"""
factor = np.sum(1 / alpha)
Expand Down
2 changes: 1 addition & 1 deletion src/iterative_ensemble_smoother/sies.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def sies_iteration(
# Line 9
N = self.X.shape[1] # Ensemble members
ans: npt.NDArray[np.double] = self.X + self.X @ self.W / np.sqrt(N - 1)
return ans
return ans.astype(responses.dtype)

def propose_W(
self, responses: npt.NDArray[np.double], step_length: float = 0.5
Expand Down

0 comments on commit 8c23618

Please sign in to comment.