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
Improve error methods on spectral models #985
Improve error methods on spectral models #985
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.
@adonath - Thanks!
I left a few inline comments. Nothing controversial I think.
gammapy/spectrum/models.py
Outdated
|
||
Parameters | ||
---------- | ||
emin : `~astropy.units.Quantity` |
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.
You can make it a bit shorter if you put it like this:
emin, emax : `~astropy.units.Quantity`
Energy range
gammapy/spectrum/models.py
Outdated
emin : `~astropy.units.Quantity` | ||
Lower bound of integration range. | ||
emax : `~astropy.units.Quantity` | ||
Upper bound of integration range |
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.
Put Returns
section. Is it also a tuple?
gammapy/spectrum/models.py
Outdated
|
||
val = -1 * upars['index'] + 2 | ||
|
||
if np.isclose(val.n, 0): |
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 use .nominal_value
and .std_dev
everywhere.
The .n
and .s
is really cryptic for people like me that aren't using uncertainties
much.
gammapy/spectrum/models.py
Outdated
Lower bound of integration range. | ||
emax : `~astropy.units.Quantity` | ||
Upper bound of integration range | ||
|
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.
Add Returns
section.
Thanks! Merging this now. Travis-ci fails are unrelated, I'll fix those now. |
This PR adds analytical solutions to
xxxxx_error()
methods, where available. Fixes gammapy/gamma-cat#107 and #984