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 direct access to extra_fits in stdatamodels #9191

Open
stscijgbot-jp opened this issue Feb 13, 2025 · 5 comments
Open

Deprecate direct access to extra_fits in stdatamodels #9191

stscijgbot-jp opened this issue Feb 13, 2025 · 5 comments

Comments

@stscijgbot-jp
Copy link
Collaborator

Issue JP-3886 was created on JIRA by Ned Molter:

This ticket mirrors an stdatamodels ticket that Melanie Clarke suggested I make a Jira ticket for so it can get noticed by INS - specifically, we are wondering whether directly accessing or setting extra_fits is used by anyone when creating/updating reference files (or in any other ways).

Directly copying the text from stdatamodels issue #⁠295:

As noted in https://jira.stsci.edu/browse/JP-2056 the documentation for extra_fits incorrectly refers to it as {}_extra_fits{}:
https://stdatamodels.readthedocs.io/en/latest/jwst/datamodels/models.html#extra-fits-keywords

There are other references to {}extra_fits{}:
https://stdatamodels.readthedocs.io/en/latest/search.html?q=extra_fits&check_keywords=yes&area=default

We should consider deprecating extra_fits as part of the "public" API (it appears to only have a single use in jwst):

if len(path) and path[0] == 'extra_fits':

We should continue to "roundtrip" non-schema fits data but allowing users to arbitrarily update these data while in memory seems dangerous. Any updates can instead use the existing astropy.io.fits API.

Since extra_fits appears in the documentation I suggest we:

  • deprecate it
  • update the documentation
  • remove it in a later major version (I'm milestoneing this issue for 2.0.0)
@stscijgbot-jp
Copy link
Collaborator Author

Comment by David Law on JIRA:

Can't say as I use it myself; I normally use astropy fits io to handle things and just check against datamodels at the end.  I can pass this along to see if anyone else does though.

@stscijgbot-jp
Copy link
Collaborator Author

Comment by Rachel Plesha on JIRA:

From the NIRISS' team perspective, there are some use cases where keywords added during the analysis (for example, a sky background level) wouldn't accessible through the datamodel.

This behavior might also still be useful in a development context, when new keywords and corresponding datamodel schemas haven't been finalized but the developer wants to be able to access those keywords via datamodel.

This should all still be accessible through astropy, but we still wanted to bring up the use of these that we know of currently.

@stscijgbot-jp
Copy link
Collaborator Author

Comment by David Law on JIRA:

Rachel Plesha Clarifying, is it sufficient to be able to access the new keywords, but not to change their values?

@stscijgbot-jp
Copy link
Collaborator Author

Comment by Rachel Plesha on JIRA:

David Law from my current understanding, yes I think that's sufficient, and folks are actually also reading them in astropy as well

@stscijgbot-jp
Copy link
Collaborator Author

Comment by David Law on JIRA:

Good to know, thanks.  It sounds like it may be ok to move ahead with removing alteration of these values in memory, but that we want to maintain the ability to access them.

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

No branches or pull requests

1 participant