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: Ga4gh tes bugfixes #1127

Merged
merged 11 commits into from Aug 12, 2021
1 change: 1 addition & 0 deletions setup.py
Expand Up @@ -76,6 +76,7 @@
"filelock",
"stopit",
"tabulate",
"py-tes",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this needs to be a required dependency. But the docs should probably say that py-tes needs to be installed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And the import statement here should be wrapped in a try-except with a WorkflowError("Unable to import Python package tes. TES backend requires py-tes to be installed. Please install py-tes, e.g. via Conda or Pip.")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I added a try-except statement in the init function. I will also a note at the documentation

],
extras_require={
"reports": ["jinja2", "networkx", "pygments", "pygraphviz"],
Expand Down
32 changes: 11 additions & 21 deletions snakemake/executors/ga4gh_tes.py
Expand Up @@ -310,39 +310,29 @@ def _get_task_inputs(self, job, jobscript, checkdir):

return inputs

def _get_task_outputs(self, job, checkdir):
outputs = []
# add output files to outputs
for o in job.output:
def _append_task_outputs(self, outputs, files):
for file in files:
obj = self._prepare_file(
filename=o,
filename=file,
checkdir=checkdir,
type="Output",
)
if obj:
outputs.append(obj)
return outputs

def _get_task_outputs(self, job, checkdir):
outputs = []
# add output files to outputs
outputs = self._append_task_outputs(outputs, job.output)

# add log files to outputs
if job.log:
for log in job.log:
outputs.append(
self._prepare_file(
filename=log,
checkdir=checkdir,
type="Output",
)
)
outputs = self._append_task_outputs(outputs, job.log)

# add benchmark files to outputs
if hasattr(job, "benchmark") and job.benchmark:
for benchmark in job.benchmark:
outputs.append(
self._prepare_file(
filename=benchmark,
checkdir=checkdir,
type="Output",
)
)
outputs = self._append_task_outputs(outputs, job.benchmark)

return outputs

Expand Down