@@ -163,15 +163,47 @@ Many of the JWST calibration steps and pipelines expect an
163163:ref: `Association <associations >` file as input. When opened with
164164:meth: `~jwst.stpipe.step.Step.open_model `, a
165165:class: `~jwst.datamodels.ModelContainer ` is returned. `ModelContainer `
166- is, among other features, a list-like object where each element is the
167- `DataModel ` of each member of the association. The `meta. asn_table ` is
166+ is a list-like object where each element is the
167+ `DataModel ` of each member of the association. The `asn_table ` attribute is
168168populated with the association data structure, allowing direct access
169169to the association itself. The association file, as well as the files
170170listed in the association file, must be in the input directory.
171171
172172To read in a list of files, or an association file, as an association,
173173use the `load_as_level2_asn ` or `load_as_level3_asn ` methods.
174174
175+ ModelContainer vs ModelLibrary
176+ ``````````````````````````````
177+
178+ Some steps in the pipeline, namely any steps involved in the Stage 3 Imaging pipeline,
179+ rely on the :class: `~jwst.datamodels.ModelLibrary ` class instead of the
180+ :class: `~jwst.datamodels.ModelContainer ` class to process association-type data.
181+ The `ModelLibrary ` class is purpose-built for enabling memory-saving options in the
182+ image3 pipeline and is only recommended when working with large associations.
183+ Additional documentation on the `ModelLibrary ` class can be found in the
184+ `stpipe ModelLibrary documentation <https://stpipe.readthedocs.io/en/latest/model_library.html >`_.
185+
186+ ModelContainer Changes in JWST 1.17
187+ ```````````````````````````````````
188+
189+ In JWST 1.17, the `ModelContainer ` class was de-scoped in light of the introduction of the
190+ `ModelLibrary ` class in JWST 1.16. The `ModelContainer ` class is still the recommended class
191+ for handling association-type data, but it is no longer a subclass of `JWSTDataModel `. The
192+ following changes in behavior are noteworthy:
193+
194+ * The `ModelContainer ` class no longer has a `meta ` attribute. The association data is now
195+ stored in the top-level `asn_table ` attribute, along with several other association-relevant
196+ attributes including `asn_table_name `, `asn_pool_name `, `asn_exptypes `, `asn_n_members `,
197+ `asn_file_path `. Note that `asn_table ` is now a dictionary, not an `ObjectNode `.
198+ * All infrastructure that attempted memory savings in the `ModelContainer ` class has been removed.
199+ Use the `ModelLibrary ` class if memory-saving options are needed.
200+ * A `ModelContainer ` object can no longer hold a list of `ModelContainer ` objects.
201+ * The `ModelContainer ` class is still list-like, and can be indexed and sliced like a list.
202+ * The `ModelContainer ` class is still the default class returned by stdatamodels `open() `
203+ for association-type input data, e.g. a .json file or dict.
204+ * The `ModelContainer ` class can still be used as a context manager, such that `with open(asn_file.json) `
205+ still works.
206+
175207Input Source
176208------------
177209
0 commit comments