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

Deprecate unsafe low-level methods #336

Closed
attipaci opened this issue Sep 17, 2022 · 0 comments · Fixed by #340
Closed

Deprecate unsafe low-level methods #336

attipaci opened this issue Sep 17, 2022 · 0 comments · Fixed by #340
Assignees
Labels
enhancement A new feature and/or an improved capability style Better style and/or less bug-prone
Milestone

Comments

@attipaci
Copy link
Collaborator

attipaci commented Sep 17, 2022

The nom-tam-fits library exposes too many low-level methods. Apart from making the library confusing to use, they are also dangerous because they promote misuse.

For example, consider the setNaxes(int), setNAxis(int, int), setSimple(boolean), or setBitpix(BitPix) methods in Header. Say, you created the HDU with a float[32][40] image (or read an existing FITS file with such an image). That image itself defines that BITPIX should be -32, NAXIS = 2, NAXIS1 = 40, NAXIS2 = 32. And, whether or not this HDU is the primary HDU in a FITS file decides whether the header should start with a SIMPLE or XTENSION key. By allowing the user to tinker with these properties, we can mess up the FITS header in a way that it no longer represents the data that is associated with it, and can result in creating corrupted unreadable FITS files.

Therefore, we should deprecate such unsafe methods, so they can either be removed or have reduced visibility in a future major release (2.0). As such this issue is a pre-requisite of #174.

@attipaci attipaci added enhancement A new feature and/or an improved capability API change Changes existing API style Better style and/or less bug-prone labels Sep 17, 2022
@attipaci attipaci modified the milestones: 2.0, 1.18.0 Sep 17, 2022
@attipaci attipaci self-assigned this Sep 17, 2022
@attipaci attipaci removed the API change Changes existing API label Sep 17, 2022
@attipaci attipaci linked a pull request Sep 29, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A new feature and/or an improved capability style Better style and/or less bug-prone
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant