diff --git a/changes/204.removal.rst b/changes/204.removal.rst new file mode 100644 index 00000000..b46f1d6d --- /dev/null +++ b/changes/204.removal.rst @@ -0,0 +1 @@ +Deprecate Step.__call__. For users that do not want to use CRDS parameters please use Step.run. diff --git a/src/stpipe/step.py b/src/stpipe/step.py index f956c454..8776eb5f 100644 --- a/src/stpipe/step.py +++ b/src/stpipe/step.py @@ -5,6 +5,7 @@ import gc import os import sys +import warnings from collections.abc import Sequence from contextlib import contextmanager, suppress from functools import partial @@ -593,7 +594,13 @@ def run(self, *args): return step_result - __call__ = run + def __call__(self, *args): + warnings.warn( + "Step.__call__ is deprecated. It is equivalent to Step.run " + "and is not recommended.", + UserWarning, + ) + return self.run(*args) def finalize_result(self, result, reference_files_used): """ diff --git a/tests/test_hooks.py b/tests/test_hooks.py index 15dc5623..3196f27a 100644 --- a/tests/test_hooks.py +++ b/tests/test_hooks.py @@ -83,8 +83,8 @@ def _datamodels_open(cls, init, **kwargs): return init def process(self, input_data): - result = self.shovelpixels(input_data) - result = self.cancelnoise(result) + result = self.shovelpixels.run(input_data) + result = self.cancelnoise.run(result) return result # noqa: RET504