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

Fix integrate_spectrum for small integration ranges #2163

Merged
merged 2 commits into from
May 27, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions gammapy/spectrum/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,13 @@ def test_fermi_isotropic():
)


def test_ecpl_intergrate():
# regresseion test to check the numerical integration for small energy bins
ecpl = ExponentialCutoffPowerLaw()
value = ecpl.integral(1 * u.TeV, 1.1 * u.TeV)
assert_quantity_allclose(value, 0 * u.Unit("s-1 cm-2"))


@requires_dependency("naima")
class TestNaimaModel:
# Used to test model value at 2 TeV
Expand Down