Skip to content

Commit

Permalink
JP-3721: Simplify ModelContainer (#330)
Browse files Browse the repository at this point in the history
  • Loading branch information
emolter authored Oct 8, 2024
1 parent 852c8d7 commit d602f7c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions changes/330.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
allow new-look ModelContainer to be the default container when opening any list-like
4 changes: 2 additions & 2 deletions docs/source/jwst/datamodels/attributes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ The current models are as follows:
'NirspecIFUCubeParsModel', 'MiriIFUCubeParsModel',
'IFUFOREModel', 'IFUImageModel', 'IFUPostModel', 'IFUSlicerModel',
'ImageModel', 'IPCModel', 'IRS2Model', 'LastFrameModel', 'Level1bModel',
'LinearityModel', 'MaskModel', 'ModelContainer', 'MSAModel',
'LinearityModel', 'MaskModel', 'MSAModel',
'MultiCombinedSpecModel', 'MultiExposureModel',
'MultiExtract1dImageModel', 'MultiSlitModel',
'MultiSpecModel',
Expand All @@ -56,7 +56,7 @@ The current models are as follows:
'RegionsModel', 'ResetModel',
'ResolutionModel', 'MiriResolutionModel',
'RSCDModel', 'SaturationModel', 'SlitDataModel', 'SlitModel', 'SpecModel',
'SegmentationMapModel', 'SourceModelContainer',
'SegmentationMapModel',
'SpecKernelModel',
'SpecProfileModel', 'SpecProfileSingleModel',
'SpecTraceModel', 'SpecTraceSingleModel',
Expand Down
3 changes: 2 additions & 1 deletion src/stdatamodels/jwst/datamodels/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Various utility functions and data types
"""

from collections.abc import Sequence
import sys
import warnings
from os.path import basename
Expand Down Expand Up @@ -153,7 +154,7 @@ def open(init=None, guess=True, memmap=False, **kwargs):
elif isinstance(init, fits.HDUList):
hdulist = init

elif is_association(init) or isinstance(init, list):
elif is_association(init) or isinstance(init, Sequence):
try:
from jwst.datamodels import ModelContainer
except ImportError as err:
Expand Down

0 comments on commit d602f7c

Please sign in to comment.