Skip to content

Fits Header does not preserve subclasses in copying and slicing. #7379

Closed

Description

@mhvk

I have a subclass of io.fits.Header and noticed that the copying and slicing does not by default return instances of my subclasses but rather of Header. This is because the class is hardcoded in those methods. In principle, this is incorrect, and correcting it is relatively straightforward [1], except that this breaks the CompImageHeader subclass since that cannot deal properly with its own class initializer being used. Which puts it slightly out of reach of a quick fix, and makes it more part of a cleanup of CompImageHeader that the comments for that class already refer to as being needed...

[1] https://github.com/astropy/astropy/compare/master...mhvk:io-fits-header-subclass-preservation?expand=1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions