-
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
Add option to skip generator caching #16
Conversation
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.
Looks good!
log_mf_min = int(math.log(f_min*MTSUN_SI*(m1+m2)) * 25) | ||
|
||
wave_gen = get_waveform_genner(log_mf_min, run_phenomd=run_phenomd) | ||
log_mf_min = math.log(f_min*MTSUN_SI*(m1+m2)) * 25 |
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.
Thanks for the PR! Why do you remove int()
? Previously, we used it to round down.
if cache_generator: | ||
# Use int to round down | ||
wave_gen = cached_get_waveform_genner( | ||
int(log_mf_min), |
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.
Ah, OK, you moved it here.
@@ -129,6 +134,7 @@ def _bbhx_fd( | |||
direct=False, | |||
num_interp=100, | |||
interp_f_lower=1e-4, | |||
cache_generator=True, |
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 would suggest to make the default False
. Easier to avoid issues if the user has to "opt-in" to use this
Following some discussion with @spxiwh, I wanted to add an option to disable the generator caching. For now, I've taken the simple approach of having two functions but I'm open to suggestions for how to best do this.
I've also added a test to ensure the cache is still called correctly.