Skip to content
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

Merged
merged 3 commits into from Apr 24, 2017

Conversation

adonath
Copy link
Member

@adonath adonath commented Apr 24, 2017

This PR adds analytical solutions to xxxxx_error() methods, where available. Fixes gammapy/gamma-cat#107 and #984

Copy link
Contributor

@cdeil cdeil left a 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.


Parameters
----------
emin : `~astropy.units.Quantity`
Copy link
Contributor

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

emin : `~astropy.units.Quantity`
Lower bound of integration range.
emax : `~astropy.units.Quantity`
Upper bound of integration range
Copy link
Contributor

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?


val = -1 * upars['index'] + 2

if np.isclose(val.n, 0):
Copy link
Contributor

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.

Lower bound of integration range.
emax : `~astropy.units.Quantity`
Upper bound of integration range

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add Returns section.

@cdeil cdeil self-assigned this Apr 24, 2017
@cdeil cdeil added this to the 0.6 milestone Apr 24, 2017
@cdeil
Copy link
Contributor

cdeil commented Apr 24, 2017

Thanks! Merging this now.

Travis-ci fails are unrelated, I'll fix those now.

@cdeil cdeil merged commit e8b5a5a into gammapy:master Apr 24, 2017
@adonath adonath deleted the improve_error_methods_spec_model branch November 20, 2018 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants