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

Refactor input handling to avoid shallow copies #1313

Open
stscijgbot-rstdms opened this issue Jul 17, 2024 · 0 comments
Open

Refactor input handling to avoid shallow copies #1313

stscijgbot-rstdms opened this issue Jul 17, 2024 · 0 comments

Comments

@stscijgbot-rstdms
Copy link
Collaborator

Issue RCAL-875 was created on JIRA by Brett Graham:

Related to the resample step input handling described in #1309 a more general reorganization of input handling could yield performance improvements and a more consistent step behavior for romancal.

Most steps being with a call to datamodels.open. For an input filename this will open the file (and return a datamodel). However for an already open datamodel this will create a shallow copy. However, the general convention in romancal is that steps modify their inputs.

The following changes could be considered:

  • change the datamodels.open call at the start of each step to self.open_model
  • update Step._datamodels_open to return the same model when called with an open model (this has the added benefit of allowing stpipe to open the input file fewer times and create fewer shallow copies)
  • document and test the established convention that steps modify inputs (with a few exceptions where the input model type is changed)
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