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

Adjust to_edisp_kernel input to MapAxis #5186

Merged
merged 4 commits into from
Jun 5, 2024

Conversation

Astro-Kirsty
Copy link
Member

@Astro-Kirsty Astro-Kirsty commented Mar 29, 2024

This PR is to resolve #5142.
I left it as a draft as I am not sure if this is the correct procedure to take.
This is two part issue, we want to change the variables to be consistent with the other naming for axis

def to_edisp_kernel_map(self, energy_axis):

We also need to change the variable to no longer be a quantity but a MapAxis.

This was the best way I could think to achieve this.

Note: there are a number of failing tests, but I did not want to fix them all with the deprecation warning until a method was decided upon.

I am open to suggestions.

@registerrier registerrier self-requested a review April 26, 2024 13:20
@Astro-Kirsty Astro-Kirsty marked this pull request as ready for review April 29, 2024 13:20
@Astro-Kirsty Astro-Kirsty self-assigned this Apr 29, 2024
Copy link
Member

@AtreyeeS AtreyeeS left a comment

Choose a reason for hiding this comment

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

Thanks @Astro-Kirsty !

I do not think you need to adapt internet tests to check for the deprecation warning, eg as done in gammapy/datasets/tests/test_map.py
It only needs to be checked when the user passes a quantity instead of a MapAxis in the to_edisp_kernel function, and internally within Gammapy we should pass a MapAxis.

gammapy/irf/edisp/core.py Show resolved Hide resolved
Signed-off-by: Astro-Kirsty <AstroKirsty@gmail.com>
Signed-off-by: Astro-Kirsty <AstroKirsty@gmail.com>
Copy link

codecov bot commented May 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.46%. Comparing base (f85fb7b) to head (e8e4a7c).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5186   +/-   ##
=======================================
  Coverage   94.46%   94.46%           
=======================================
  Files         232      232           
  Lines       35636    35645    +9     
=======================================
+ Hits        33664    33673    +9     
  Misses       1972     1972           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@QRemy QRemy added cleanup api-change PRs and issues that change an existing API, possibly requiring a deprecation period and removed api-change PRs and issues that change an existing API, possibly requiring a deprecation period labels May 14, 2024
@QRemy QRemy added this to To do in gammapy.irf via automation May 14, 2024
@QRemy QRemy added this to the 1.3 milestone May 14, 2024
QRemy
QRemy previously approved these changes May 31, 2024
Copy link
Contributor

@QRemy QRemy left a comment

Choose a reason for hiding this comment

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

Thanks @Astro-Kirsty looks good.

@QRemy QRemy requested a review from AtreyeeS May 31, 2024 14:58
AtreyeeS
AtreyeeS previously approved these changes Jun 1, 2024
Copy link
Member

@AtreyeeS AtreyeeS left a comment

Choose a reason for hiding this comment

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

Thanks @Astro-Kirsty ! No further comments

@AtreyeeS AtreyeeS self-requested a review June 1, 2024 00:02
Copy link
Member

@AtreyeeS AtreyeeS left a comment

Choose a reason for hiding this comment

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

Please check that the deprecation works correctly, ie, the old behaviour is still supported

@AtreyeeS AtreyeeS dismissed their stale review June 1, 2024 00:06

Added question about deprecation

Signed-off-by: Astro-Kirsty <AstroKirsty@gmail.com>
Copy link
Member

@AtreyeeS AtreyeeS left a comment

Choose a reason for hiding this comment

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

No further comments. Thanks!

Copy link
Contributor

@registerrier registerrier left a comment

Choose a reason for hiding this comment

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

Thanks @Astro-Kirsty . This looks good!

@registerrier registerrier merged commit 619f6f4 into gammapy:main Jun 5, 2024
17 checks passed
gammapy.irf automation moved this from To do to Done Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
gammapy.irf
  
Done
Development

Successfully merging this pull request may close these issues.

Expect the MapAxis directly in to_edisp_kernel
4 participants