-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compute cross-correlation matrices without matrix inversion #6339
Compute cross-correlation matrices without matrix inversion #6339
Conversation
@Blunde1 I have checked and the tests with adaptive localization threshold 0.0 and 1.0 pass👍 |
20cfcde
to
d80f169
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small comment on a small function. Take it or leave it :)
src/ert/config/analysis_module.py
Outdated
Section 2.3 - Localization in the CHOP problem | ||
""" | ||
default_threshold = 3 / math.sqrt(ensemble_size) | ||
if user_defined_threshold == -1: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't compare floats using ==
.
In fact, I think using None
is better here. More typical Python, more readable:
if user_defined_threshold is None:
return default_threshold
Come to think of it, I believe the (1) decision to use the default or user defined threshold and (2) retrieving the default threshold are two separate concerns. I think this is better:
threshold = # either a float in [0, 1], or None
self.threshold = correlation_threshold(ensemble_size) if threshold is None else threshold
In other words, remove user_defined_threshold
entirely. The decision is already taken before the function is called (by setting it to -1
/ None
), so no need to propagate the data down into the function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with this.
Could you make an issue with this?
7055dcc
to
19072b4
Compare
19072b4
to
854436b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 👍
Issue
Resolves #6330
Approach
Use @tommyod approach #4243 (comment)