The doc says factor has to be int.
I'm -1 an auto-truncating floats by calling factor = int(factor) here.
Either remove this line, expecting the user to follow the docs.
Or if you want to ensure int, instead of silently truncating, I'd suggest throwing an error if the input isn't an int.
This line is obsolete, but I will use it in other places.
I think right now I would make it private, but later one could think about adding some further info to the Axis object (e.g. SkyImage.axes.x.unit, SkyImage.axes.x.idx or SkyCube.axes.energy.unit) and make it public.
Thanks @cdeil! I've changed SkyImage.pad() and SkyImage.crop() as we discussed offline. I moved the shape computing utility functions to gammapy.utils.array, to keep the namespace in gammapy.image cleaner.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.