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

Fix check for inputs in subdirectories #63

Merged
merged 1 commit into from
May 23, 2023
Merged
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: 6 additions & 7 deletions polaris/step.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,10 +500,7 @@ def process_inputs_and_outputs(self):
if len(databases_with_downloads) > 0:
self._fix_permissions(databases_with_downloads)

# convert inputs and outputs to absolute paths
self.inputs = [os.path.abspath(os.path.join(step_dir, filename)) for
filename in inputs]

# inputs are already absolute paths, convert outputs to absolute paths
self.outputs = [os.path.abspath(os.path.join(step_dir, filename)) for
filename in self.outputs]

Expand Down Expand Up @@ -565,18 +562,20 @@ def _process_input(entry, config, base_work_dir, component, step_dir):

if target is not None:
filepath = os.path.join(step_dir, filename)
dirname = os.path.dirname(filepath)
if copy:
shutil.copy(target, filepath)
else:
dirname = os.path.dirname(filepath)
try:
os.makedirs(dirname)
except FileExistsError:
pass
symlink(target, filepath)
input_file = target
input_file = os.path.join(dirname, target)
else:
input_file = filename
input_file = os.path.join(step_dir, filename)

input_file = os.path.abspath(input_file)

return input_file, database_subdirs

Expand Down