Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 9, 2024
1 parent 7b75304 commit 8cdad5d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
18 changes: 10 additions & 8 deletions src/stpipe/step.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,9 +492,11 @@ def run(self, *args):
)
library.shelve(model, i)

elif (isinstance(args[0], Sequence)) and \
(not isinstance(args[0], str)) and \
(self.class_alias is not None):
elif (
(isinstance(args[0], Sequence))
and (not isinstance(args[0], str))
and (self.class_alias is not None)
):
# handle ModelContainer or list of models
if args[0] and isinstance(args[0][0], AbstractDataModel):
for model in args[0]:

Check warning on line 502 in src/stpipe/step.py

View check run for this annotation

Codecov / codecov/patch

src/stpipe/step.py#L501-L502

Added lines #L501 - L502 were not covered by tests
Expand All @@ -509,12 +511,12 @@ def run(self, *args):
e,
)

elif isinstance(args[0], AbstractDataModel) and \
self.class_alias is not None:
elif (
isinstance(args[0], AbstractDataModel)
and self.class_alias is not None
):
try:
args[0][
f"meta.cal_step.{self.class_alias}"
] = "SKIPPED"
args[0][f"meta.cal_step.{self.class_alias}"] = "SKIPPED"
except AttributeError as e:
self.log.info(

Check warning on line 521 in src/stpipe/step.py

View check run for this annotation

Codecov / codecov/patch

src/stpipe/step.py#L518-L521

Added lines #L518 - L521 were not covered by tests
"Could not record skip into DataModel header: %s",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ def get_crds_parameters(self):
def save(self, path, dir_path=None, *args, **kwargs):
saveid = getattr(self, "saveid", None)
if saveid is not None:
fname = saveid+"-saved.txt"
fname = saveid + "-saved.txt"
with open(fname, "w") as f:
f.write(f"{path}")
return fname
Expand Down

0 comments on commit 8cdad5d

Please sign in to comment.