Skip to content

Commit

Permalink
split make_input_path into function to be reused by jwst container
Browse files Browse the repository at this point in the history
  • Loading branch information
emolter committed Sep 26, 2024
1 parent 4b63ec2 commit e44fce4
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/stpipe/step.py
Original file line number Diff line number Diff line change
Expand Up @@ -1191,13 +1191,7 @@ def make_input_path(self, file_path):
File path using ``input_dir`` if the input
had no directory path.
"""
full_path = file_path
if isinstance(file_path, str):
original_path, file_name = split(file_path)
if not len(original_path):
full_path = join(self.input_dir, file_name)

return full_path
return _make_input_path(file_path, self.input_dir)

def _set_input_dir(self, input_, exclusive=True):
"""Set the input directory
Expand Down Expand Up @@ -1466,3 +1460,12 @@ def preserve_step_pars(step):
yield saved_pars
finally:
step.update_pars(saved_pars)


def _make_input_path(file_path, input_dir):
full_path = file_path
if isinstance(file_path, str):
original_path, file_name = split(file_path)
if not len(original_path):
full_path = join(input_dir, file_name)
return full_path

0 comments on commit e44fce4

Please sign in to comment.