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
Remove unused and untested code from stats/data.py
#2233
Comments
👍 |
@registerrier - The How do we weight Do you think we'll have on-off maps? If yes, that would be another caller of that helper function. |
I'm with @registerrier here. Code that is currently unused and untested should be just removed. If it's still useful, we can re-introduce it later, when the use-case is on the table and clearly defined. I'm sure the code was introduced following the YAGNI principle... |
I think that the use case of |
Resolved by #2235. |
I'm all for cleaning up and removing or improving code. I think in this case maybe we should have improved, not removed. The concern I have is about ObservationStats.stack but even more about SpectrumDatasetOnOffStacker.stack_backscal. What exactly do these methods do? They don't have good docstrings, explaining the method used, and they don't have good tests (I found this one). Especially So my suggestions here are to improve This might or might not re-introducing a utility function like gammapy.stats.combine_stats - of course with good tests and 1 or 2 callers. If some Sherpa or X-ray paper or note exists that gives the formula how they weight I'm re-opening this issue now for discussion. @registerrier as expert on this - Could you please have a look and comment what you think we could improve (if anything) here? |
Found this: https://heasarc.gsfc.nasa.gov/docs/asca/abc_backscal.html |
The stacking method is now documented here https://docs.gammapy.org/0.15/api/gammapy.spectrum.SpectrumDatasetOnOff.html#gammapy.spectrum.SpectrumDatasetOnOff.stack Closing the issue now. |
In
stats/data.py
, the functionsmake_stats
,combine_stats
andcompute_total_stats
are unused and not tested.I propose to remove them.
OK? @adonath @cdeil
The text was updated successfully, but these errors were encountered: