Ik heb een snakefile met één regel die een lokale Python-script Importeren en dan roept een RuntimeError
. Wanneer ik snakefile draaien, de stack trace de RuntimeError
niet getoond. De code en snakemake output hieronder getoond.
// test.snakefile
rule test_rule:
run:
from test import hello
print(hello)
raise RuntimeError('raising error')
// test.py
import logging
import os
from logging.config import fileConfig
log_file_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'logging_config.ini')
fileConfig(log_file_path)
hello = 'hello'
snakemake output:
...
[Mon Jan 13 14:45:54 2020]
rule test_rule:
jobid: 0
Job counts:
count jobs
1 test_rule
1
hello
Shutting down, this might take some time.
Exiting because a job execution failed. Look above for error message
Echter, als ik commentaar van de regel fileConfig(log_file_path)
in test.py
en uit te voeren snakemake, de RuntimeError stack trace wordt afgedrukt zoals verwacht:
Error in rule test_rule:
jobid: 0
RuleException:
RuntimeError in line 5 of /my-dir/test.snakefile:
raising error
File /my-dir/test.snakefile, line 5, in __rule_test_rule
File /usr/lib/python3.6/concurrent/futures/thread.py, line 56, in run
Exiting because a job execution failed. Look above for error message
Iedereen weet waarom dit gebeurt?