-
Notifications
You must be signed in to change notification settings - Fork 169
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
Simplify ModelContainer #8738
Simplify ModelContainer #8738
Comments
Comment by Ned Molter on JIRA: A draft of the slimmed-down new-look ModelContainer can be found here. -I was able to make this work with the rest of the jwst repository and run all the pipelines successfully with only minor modifications.- I'm listing the major changes, along with some questions about what is the desired behavior. I'm curious to hear anyone's feedback.
|
Comment by Melanie Clarke on JIRA: A quick note for discussion later, while we are refactoring ModelContainer... There are some inconsistencies between how ModelContainer handles relative paths in association file expname values and how stpipe does it. I think it can be traced back to ModelContainer not respecting the input_directory when it reads in files from an association: instead of using something like stpipe.step.make_input_path, it directly prepends the ASN directory (here, in your proposed refactor branch). This was reported in an old ticket (JP-2038) and closed as won't-fix, but it would be nice to clean it up while we're working on making ModelContainer more usable and stpipe compatible. |
Comment by Ned Molter on JIRA: Melanie Clarke does the new test association file in this commit cover the problem that was being discussed? And does it look like the new unit test covers that case adequately? I hope I understood the problem correctly from the original ticket and long back-and-forth on it. |
Comment by Melanie Clarke on JIRA: I think not quite. I am testing like this, with input imaging rate files set up in an 'input' directory, and two empty directories, 'img2' and 'img3', at the same level under the current directory: asn_from_list input/*fits -o img2/img2.json -r DMSLevel2bBase asn_from_list img2/*cal.fits -o img3/img3.json --product-name img3 The image2 run succeeds: it assumes the starting directory is the current working directory and finds the input at input/*fits, even though the association is in img2. The image3 run fails, on both main and your branches, because it assumes the starting directory is img3, where the association file is, and looks for the files in img3/img2/*cal.fits. I was hoping we could just quickly sort out this inconsistency, but it may be too complicated a side issue to be dealt with in this ticket. On further examination, it doesn't look like either pipeline properly supports the input_directory parameter. |
Comment by Ned Molter on JIRA: Fixed by #8831 |
Issue JP-3721 was created on JIRA by Ned Molter:
With the addition of ModelLibrary, the role of ModelContainer needs to be re-evaluated. ModelLibrary certainly renders the
return_open
andsave_open
options obsolete, as well as theget_sections
method, since if memory usage is a concern then ModelLibrary should be used instead.However, during discussions related to JP-3715, it has become increasingly clear that the strictness of ModelLibrary and the additional borrow/shelve code required to access models is not necessary/desired for many use-cases. For example, the
calwebb_spec3
pipeline currently makes extensive use of ModelContainer but does not have the same memory issues ascalwebb_image3
does. Learning to use ModelLibrary may also be a nuisance for users manipulating relatively small datasets.Therefore, the need may remain for a lightweight, easy-to-use class for loading a list of models and association metadata. This container should satisfy the following constraints:
datamodels.open()
for asn-type datawith datamodels.open(asn.json) as container
has the expected behaviorThe plan for now is to draft this container by substantially slimming down ModelContainer, and see if it satisfies the needs of the JWST pipeline.
More context about ModelContainer issues can be found on this innerspace page: https://innerspace.stsci.edu/display/SCSB/ModelContainer+uses+in+jwst
The text was updated successfully, but these errors were encountered: