Move powerlaw utility functions to separate namespace #599
I'd like to propose that the functions from gammapy.spectrum.powerlaw are moved to a separate namespace.
Currently those functions are part of the main gammapy.spectrum namespace and IMO it's a mess to find something.
So I'd like to propose to either have those functions in
I don't think that we should add all those functions to the gammapy.spectrum.PowerLaw class, but that is an option as well. Power-law is special, everything is available analytically and it's usually the building block for a lot of other code (like numerical integration in energy).
This change is very easy to implement, but it will break a lot of scripts that call that functionality from Gammapy. I think there aren't many people using it and they can just adapt when going to Gammapy 0.5, I don't want to do a deprecation cycle.
Any preference for where to expose it?
Do you like this?
from gammapy.spectrum.powerlaw import powerlaw_flux, powerlaw_energy_flux result = powerlaw_flux(args)
from gammapy.spectrum import PLUtils result = PLUtils.flux(args)
Or something else?
I think once we have the spectral model classes not so many users will use these power law utils functions, this is more for implementing algorithms in Gammapy.