-
Notifications
You must be signed in to change notification settings - Fork 3
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
Fix/b value testing #178
base: main
Are you sure you want to change the base?
Fix/b value testing #178
Conversation
@@ -94,129 +96,107 @@ def test_estimate_b( | |||
assert w[-1].category == UserWarning | |||
|
|||
|
|||
def magnitudes(b: float): |
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.
maybe name differently? load_magnitudes?
[ | ||
(1000000, 1.2, 3, 0, "b_value", 0.005), | ||
(1000000, np.log(10), 3, 0.1, "beta", 0.01), | ||
(1, magnitudes(1), 0, 0.1, 0.002, "b_value"), |
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.
use exact b-values calculated with the function as it is now, assuming it is now correct.
n, b, mc, delta_m, b_parameter=b_parameter | ||
) | ||
mags = bin_to_precision(mags, delta_m) | ||
mags = mags[mags >= mc - delta_m / 2] | ||
b_estimate = estimate_b_classic(mags, mc, delta_m, b_parameter=b_parameter) | ||
|
||
assert abs(b - b_estimate) / b <= precision |
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.
then this becomes almost equal
Make the tests for the b-value estimates more reliable