Skip to content

Commit

Permalink
Revert "Revert "FIXME: override datamodels.open""
Browse files Browse the repository at this point in the history
This reverts commit 6ef3c5a.
  • Loading branch information
zonca committed Jul 22, 2024
1 parent 6ef3c5a commit 0eb968d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions liger_iris_pipeline/dark_current/dark_current_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@ class DarkCurrentStep(Step):

reference_file_types = ["dark"]

#FIXME - This will need to be ported to a new LigerIrisStep class
# I do not understand why this is necessary, in JWST it seems like
# this is not needed and works out of the box.
# Without this, the pipeline tries to call `datamodes.open` on a
# file that is already open, which gives the error:
# expected str, bytes or os.PathLike object, not LigerIrisDataModel
@classmethod
def _datamodels_open(cls, init, **kwargs):
if issubclass(init.__class__, stdatamodels.model_base.DataModel):
return init
else:
return datamodels.open(init, **kwargs)

def process(self, input):

# Open the input data model
Expand Down

0 comments on commit 0eb968d

Please sign in to comment.