-
Notifications
You must be signed in to change notification settings - Fork 371
Remove polarization_samples deprecationwarning and actually deprecate it #5205
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,6 @@ | |
| """ | ||
|
|
||
| import logging | ||
| import warnings | ||
| from distutils.util import strtobool | ||
|
|
||
| import numpy | ||
|
|
@@ -63,6 +62,8 @@ def setup_marginalization(self, | |
| marginalize_vector_params=None, | ||
| marginalize_vector_samples=1e3, | ||
| marginalize_sky_initial_samples=1e6, | ||
| marginalize_polarization=True, | ||
| marginalize_polarization_samples=1e3, | ||
| **kwargs): | ||
| """ Setup the model for use with distance marginalization | ||
|
|
||
|
|
@@ -96,7 +97,7 @@ def setup_marginalization(self, | |
| ------- | ||
| variable_params: list of strings | ||
| Set of variable params (missing distance-related parameter). | ||
| kwags: dict | ||
| kwargs: dict | ||
| The keyword arguments to the model initialization, may be modified | ||
| from the original set by this function. | ||
| """ | ||
|
|
@@ -126,20 +127,15 @@ def pop_prior(param): | |
| self.marginalize_sky_initial_samples = \ | ||
| int(float(marginalize_sky_initial_samples)) | ||
|
|
||
| if marginalize_polarization: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think you want this section at all. The point was to just use the more general marginalize_vector setup. I think this change should just be removing options, not renaming them.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was added in as self.marginalize_vector_params must have 'polarization' as a key later. I'm happy to simply put this in as a no-if-statement thing if that is better? |
||
| pol_uniform = numpy.linspace(0, numpy.pi * 2.0, self.vsamples) | ||
| self.marginalize_vector_params['polarization'] = pol_uniform | ||
|
|
||
| for param in str_to_tuple(marginalize_vector_params, str): | ||
| logging.info('Marginalizing over %s, %s points from prior', | ||
| param, self.vsamples) | ||
| self.marginalized_vector_priors[param] = pop_prior(param) | ||
|
|
||
| # Remove in the future, backwards compatibility | ||
| if 'polarization_samples' in kwargs: | ||
| warnings.warn("use marginalize_vector_samples rather " | ||
| "than 'polarization_samples'", DeprecationWarning) | ||
| pol_uniform = numpy.linspace(0, numpy.pi * 2.0, self.vsamples) | ||
| self.marginalize_vector_params['polarization'] = pol_uniform | ||
| self.vsamples = int(kwargs['polarization_samples']) | ||
| kwargs.pop('polarization_samples') | ||
|
|
||
| self.reset_vector_params() | ||
|
|
||
| self.marginalize_phase = str_to_bool(marginalize_phase) | ||
|
|
||
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.
See below