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 Jan 16, 2024
1 parent 8f8118a commit c0fb17c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
11 changes: 6 additions & 5 deletions src/stpipe/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"""
import inspect

from . import function_wrapper
from . import utilities
from . import function_wrapper, utilities
from .step import Step


Expand Down Expand Up @@ -87,11 +86,13 @@ def get_hook_objects(step, hooktype, hooks):
hooktype : str, "pre" or "post"
strings, to indicate whether it is a pre- or post-hook
hooks : str or class
path to executible script, or Step class to run as hook
path to executable script, or Step class to run as hook
Returns
-------
list of callables that can be run as a hook
"""
return [hook_from_string_or_class(step, hooktype, i, hook)
for i, hook in enumerate(hooks)]
return [
hook_from_string_or_class(step, hooktype, i, hook)
for i, hook in enumerate(hooks)
]
1 change: 0 additions & 1 deletion src/stpipe/subproc.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class SystemCall(Step):
""" # noqa: E501

def process(self, *args):

newargs = []
for i, arg in enumerate(args):
if isinstance(arg, AbstractDataModel):
Expand Down
5 changes: 1 addition & 4 deletions tests/test_hooks.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import pytest

from jwst.stpipe import Step, Pipeline

from jwst.stpipe import Pipeline, Step

pytest.importorskip("jwst")

Expand Down Expand Up @@ -38,7 +36,6 @@ def process(self, input_data):


class HookStep(Step):

class_alias = "myhook"

spec = """
Expand Down
3 changes: 2 additions & 1 deletion tests/test_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ def test_func():
class HovercraftFullOfEels:
pass

class Foo(Step):

class Foo(Step):
def process(self, input_data):
pass


def test_import_class():
from stpipe import Step

step_class = import_class("stpipe.Step", subclassof=Step)
assert step_class is Step

Expand Down

0 comments on commit c0fb17c

Please sign in to comment.