-
Notifications
You must be signed in to change notification settings - Fork 5
Deprecate kde_smoothing=True argument
#310
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 1 commit
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 | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,3 +1,5 @@ | ||||||||||||
| import warnings | ||||||||||||
|
|
||||||||||||
| import numpy as np | ||||||||||||
| from scipy.stats import ( | ||||||||||||
| gaussian_kde, | ||||||||||||
|
|
@@ -83,6 +85,9 @@ def __init__( | |||||||||||
| The smoothing filter to use for smoothing the energy histogram. | ||||||||||||
| If None, no smoothing will be applied. | ||||||||||||
| kde_smoothing : bool | ||||||||||||
| .. deprecated:: | ||||||||||||
| Use of ``kde_smoothing=True`` is deprecated and will be removed | ||||||||||||
| in a future version. | ||||||||||||
| Apply a kde smoothing to the energy pdf for each bin in sin(dec). | ||||||||||||
| This is useful for signal injections, because it ensures that the | ||||||||||||
| background is not zero when injecting high energy events. | ||||||||||||
|
|
@@ -152,6 +157,11 @@ def __init__( | |||||||||||
| self._hist_mask_mc_covered_zero_physics = h > 0 | ||||||||||||
|
|
||||||||||||
| if kde_smoothing: | ||||||||||||
| warnings.warn( | ||||||||||||
| 'The kde_smoothing option is deprecated and will be removed in a future version', | ||||||||||||
| DeprecationWarning, | ||||||||||||
| stacklevel=2, | ||||||||||||
| ) | ||||||||||||
|
Comment on lines
+159
to
+163
|
||||||||||||
| # If a bandwidth is passed, apply a KDE-based smoothing with the | ||||||||||||
| # given bandwidth parameter as bandwidth for the fit. | ||||||||||||
| kde_pdf_list = [] | ||||||||||||
|
|
@@ -374,6 +384,9 @@ def __init__(self, data_exp, logE_binning, sinDec_binning, smoothing_filter=None | |||||||||||
| The smoothing filter to use for smoothing the energy histogram. | ||||||||||||
| If None, no smoothing will be applied. | ||||||||||||
| kde_smoothing : bool | ||||||||||||
| .. deprecated:: | ||||||||||||
| Use of ``kde_smoothing=True`` is deprecated and will be removed | ||||||||||||
| in a future version. | ||||||||||||
|
||||||||||||
| .. deprecated:: | |
| Use of ``kde_smoothing=True`` is deprecated and will be removed | |
| in a future version. | |
| Deprecated: Use of ``kde_smoothing=True`` is deprecated and will | |
| be removed in a future version. |
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.
fixed
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -761,6 +761,9 @@ def create_analysis( | |||||||||||
| gamma_max : float | ||||||||||||
| Upper bound for gamma fit. | ||||||||||||
| kde_smoothing : bool | ||||||||||||
| .. deprecated:: | ||||||||||||
| Use of ``kde_smoothing=True`` is deprecated and will be removed | ||||||||||||
| in a future version. | ||||||||||||
|
||||||||||||
| .. deprecated:: | |
| Use of ``kde_smoothing=True`` is deprecated and will be removed | |
| in a future version. | |
| Deprecated: Use of ``kde_smoothing=True`` is deprecated and will be | |
| removed in a future version. |
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.
fixed
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -179,6 +179,9 @@ def create_analysis( | |||||||||||
| gamma_max : float | ||||||||||||
| Upper bound for gamma fit. | ||||||||||||
| kde_smoothing : bool | ||||||||||||
| .. deprecated:: | ||||||||||||
| Use of ``kde_smoothing=True`` is deprecated and will be removed | ||||||||||||
| in a future version. | ||||||||||||
|
||||||||||||
| .. deprecated:: | |
| Use of ``kde_smoothing=True`` is deprecated and will be removed | |
| in a future version. | |
| Deprecated: Use of ``kde_smoothing=True`` is deprecated and will be | |
| removed in a future version. |
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.
fixed
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -233,6 +233,9 @@ def create_analysis( | |||||||||||
| e_peak_max : float | ||||||||||||
| Upper bound for energy peak fit, | ||||||||||||
| kde_smoothing : bool | ||||||||||||
| .. deprecated:: | ||||||||||||
| Use of ``kde_smoothing=True`` is deprecated and will be removed | ||||||||||||
| in a future version. | ||||||||||||
|
||||||||||||
| .. deprecated:: | |
| Use of ``kde_smoothing=True`` is deprecated and will be removed | |
| in a future version. | |
| Deprecated: use of ``kde_smoothing=True`` is deprecated and will be | |
| removed in a future version. |
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.
fixed
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.
This adds a Sphinx
.. deprecated::directive in the parameter docstring without a version argument. If Sphinx processes this docstring as reST, the directive usually requires.. deprecated:: <version>and can otherwise emit a parsing warning/error. Please provide the version or convert this to plain text so doc builds remain clean.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.
fixed