Add fromwdl to janisdk#58
Conversation
mr-c
left a comment
There was a problem hiding this comment.
My personal script also caught exceptions and exposed the file name, line number, and columns of errors; does that happen as well here?
try:
WdlParser.from_doc(sys.argv[1]).translate("cwl");
except MultipleValidationErrors as err:
for exc in err.exceptions:
print(exc, file=sys.stderr)
print(exc.pos, file=sys.stderr)
print(exc.node, file=sys.stderr)
except ValidationError as exc:
print(exc, file=sys.stderr)
print(exc.pos, file=sys.stderr)
print(exc.node, file=sys.stderr)| parser.add_argument("wdlfile", help="The path to the WDL file") | ||
|
|
||
| parser.add_argument( | ||
| "translation", default="janis", choices=["wdl", "wdl", "janis"], nargs="?" |
Suggested: PMCC-BioinformaticsCore/janis#58 (review) Co-authored-by: Michael R. Crusoe <michael.crusoe@gmail.com>
| translated = tool.translate( | ||
| args.translation, | ||
| to_console=args.output is None, | ||
| to_disk=args.output is not None, | ||
| export_path=args.output, | ||
| ) |
There was a problem hiding this comment.
Hmm.. I was thinking that the "try/except ValidationError" logic would go here. But I see that this function returns the translation, so it might be intended to be used outside of the CLI where printing to stderr would be appropriate. Maybe amend the ValidationError class to always include the pos and node information would be a nicer solution? That way everyone wins.
|
Was testing a WDL workflow with the That workflow in the issue linked didn't work, but I believe that's for a future enhancement. The error reported was: (Note: I patched |
Blocked by release of janis-core v0.11.5: PMCC-BioinformaticsCore/janis-core#102