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

Add `frame` attribute for SkyDiffuseMap #2106

Merged
merged 2 commits into from Apr 2, 2019

Conversation

Projects
None yet
2 participants
@lmohrmann
Copy link
Contributor

commented Apr 1, 2019

It seems the frame attribute is missing for SkyDiffuseMap, which leads to a crash when MapDataset tries to access it. This PR adds the frame attribute and sets it to None, as for the SkyDiffuseConstant model.

@lmohrmann lmohrmann requested a review from adonath Apr 1, 2019

@adonath adonath self-assigned this Apr 1, 2019

@adonath adonath added the bug label Apr 1, 2019

@adonath adonath added this to the 0.12 milestone Apr 1, 2019

@adonath
Copy link
Member

left a comment

Thanks @lmohrmann! This is clearly a bug...

Here is how the frame attribute is defined for the SkyDiffuseCube:
https://github.com/gammapy/gammapy/blob/master/gammapy/cube/models.py#L310

Could you implement the same definition for SkyDiffuseMap? And maybe add a small regression test? E.g. check the returned frame with an additional assert here: https://github.com/gammapy/gammapy/blob/master/gammapy/image/models/tests/test_core.py#L150

@lmohrmann

This comment has been minimized.

Copy link
Contributor Author

commented Apr 2, 2019

Like so?

@adonath

adonath approved these changes Apr 2, 2019

@adonath adonath merged commit c3c86e4 into gammapy:master Apr 2, 2019

8 of 9 checks passed

gammapy.gammapy (Test Windows35)
Details
Codacy/PR Quality Review Up to standards. A positive pull request.
Details
Scrutinizer Analysis: 1 updated code elements – Tests: passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
gammapy.gammapy Build #20190402.1 succeeded
Details
gammapy.gammapy (DevDocs) DevDocs succeeded
Details
gammapy.gammapy (Lint) Lint succeeded
Details
gammapy.gammapy (Test Python35) Test Python35 succeeded
Details
gammapy.gammapy (Test Windows37) Test Windows37 succeeded
Details
@adonath

This comment has been minimized.

Copy link
Member

commented Apr 2, 2019

Perfect, thanks @lmohrmann!

@lmohrmann lmohrmann deleted the lmohrmann:fix-diffuse-map branch Apr 2, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.