Skip to content

Commit

Permalink
Remove X_subset
Browse files Browse the repository at this point in the history
Use in-place operations instead
  • Loading branch information
dafeda committed Jan 11, 2024
1 parent 14def30 commit d4ac926
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/iterative_ensemble_smoother/experimental.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,6 @@ def correlation_threshold(ensemble_size: int) -> float:
if np.all(~unique_row):
continue

# Get the parameters (X) that have identical significant responses (Y)
X_subset = X[indices_of_row, :]
Y_subset = Y[unique_row, :]

# Compute the masked arrays for these variables
Expand All @@ -332,7 +330,7 @@ def correlation_threshold(ensemble_size: int) -> float:
Y=Y_subset,
cov_YY=cov_YY_subset, # Passing cov(Y, Y) avoids re-computation
)
X_out[indices_of_row, :] = X_subset + cov_XY_subset @ T
X_out[indices_of_row, :] += cov_XY_subset @ T

return X_out

Expand Down

0 comments on commit d4ac926

Please sign in to comment.