Skip to content
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

Investigate issue with datamodels.open #68

Merged
merged 6 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions liger_iris_pipeline/dark_current/dark_current_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,6 @@ 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
7 changes: 4 additions & 3 deletions liger_iris_pipeline/datamodels/model_base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from astropy.time import Time

from stdatamodels import DataModel as _DataModel
from stdatamodels.jwst.datamodels import JwstDataModel as _DataModel


__all__ = ["LigerIrisDataModel"]
Expand Down Expand Up @@ -30,7 +30,8 @@ def get_crds_parameters(self):
dict
"""
return {
key: val for key, val in self.to_flat_dict(include_arrays=False).items()
key: val
for key, val in self.to_flat_dict(include_arrays=False).items()
if isinstance(val, (str, int, float, complex, bool))
}

Expand All @@ -51,4 +52,4 @@ def on_save(self, init):
"""
super().on_save(init)

self.meta.date = Time.now().isot
self.meta.date = Time.now().isot
Loading