Skip to content
Permalink
Browse files
fix: fix function call when creating report and hashes for between wo…
…rkflow caching (#1198)

* Fix report

* black fmt

* fix: hashing of scripts, notebooks and wrappers

Co-authored-by: Johannes Köster <johannes.koester@tu-dortmund.de>
  • Loading branch information
FelixMoelder and johanneskoester committed Sep 30, 2021
1 parent 715ce17 commit a4f68365125c357f30510d0e61036f98b9d3aa69
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
@@ -50,7 +50,7 @@ def _get_provenance_hash(self, job: Job):
# resources, and filenames (which shall be irrelevant for the hash).
h.update(job.rule.shellcmd.encode())
elif job.is_script:
_, source, _ = script.get_source(
_, source, _, _ = script.get_source(
job.rule.script,
job.rule.workflow.sourcecache,
basedir=job.rule.basedir,
@@ -59,7 +59,7 @@ def _get_provenance_hash(self, job: Job):
)
h.update(source)
elif job.is_notebook:
_, source, _ = script.get_source(
_, source, _, _ = script.get_source(
job.rule.notebook,
job.rule.workflow.sourcecache,
basedir=job.rule.basedir,
@@ -68,7 +68,7 @@ def _get_provenance_hash(self, job: Job):
)
h.update(source)
elif job.is_wrapper:
_, source, _ = script.get_source(
_, source, _, _ = script.get_source(
wrapper.get_script(job.rule.wrapper, prefix=workflow.wrapper_prefix),
job.rule.workflow.sourcecache,
basedir=job.rule.basedir,
@@ -260,26 +260,27 @@ def code(self):
language = "bash"
elif self._rule.script is not None and not contains_wildcard(self._rule.script):
logger.info("Loading script code for rule {}".format(self.name))
_, source, language = script.get_source(
_, source, language, _ = script.get_source(
self._rule.script, self._rule.workflow.sourcecache, self._rule.basedir
)
sources = [source.decode()]
elif self._rule.wrapper is not None and not contains_wildcard(
self._rule.wrapper
):
logger.info("Loading wrapper code for rule {}".format(self.name))
_, source, language = script.get_source(
_, source, language, _ = script.get_source(
wrapper.get_script(
self._rule.wrapper,
self._rule.workflow.sourcecache,
prefix=self._rule.workflow.wrapper_prefix,
)
),
self._rule.workflow.sourcecache,
)
sources = [source.decode()]
elif self._rule.notebook is not None and not contains_wildcard(
self._rule.notebook
):
_, source, language = script.get_source(
_, source, language, _ = script.get_source(
self._rule.notebook, self._rule.workflow.sourcecache, self._rule.basedir
)
language = language.split("_")[1]

0 comments on commit a4f6836

Please sign in to comment.