Skip to content

Commit

Permalink
Merge branch 'main' into fix-pathlib-bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jdavies-st authored Feb 27, 2024
2 parents 066cde2 + b622618 commit f9411a9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
- Remove bundled ``configobj`` package in favor of the ``configobj`` package
bundled into ``astropy``. [#122]
- Fix ``datetime.utcnow()`` DeprecationWarning [#134]
- Provide ``asn_n_members=1`` when opening the ``Step`` dataset for
``get_crds_parameters`` [#142]
- Fix bug in handling of ``pathlib.Path`` objects as ``Step`` inputs [#143]

0.5.1 (2023-10-02)
Expand Down
12 changes: 6 additions & 6 deletions src/stpipe/step.py
Original file line number Diff line number Diff line change
Expand Up @@ -841,12 +841,12 @@ def get_config_from_reference(cls, dataset, disable=None, crds_observatory=None)
# If the dataset is not an operable instance of AbstractDataModel,
# log as such and return an empty config object
try:
model = cls._datamodels_open(dataset)
if isinstance(model, Sequence):
# Pull out first model in ModelContainer
model = model[0]
crds_parameters = model.get_crds_parameters()
crds_observatory = model.crds_observatory
with cls._datamodels_open(dataset, asn_n_members=1) as model:
if isinstance(model, Sequence):
# Pull out first model in ModelContainer
model = model[0]
crds_parameters = model.get_crds_parameters()
crds_observatory = model.crds_observatory
except (OSError, TypeError, ValueError):
logger.warning("Input dataset is not an instance of AbstractDataModel.")
disable = True
Expand Down

0 comments on commit f9411a9

Please sign in to comment.