-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add fromwdl to janisdk #58
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)
janisdk/fromwdl/__init__.py
Outdated
parser.add_argument("wdlfile", help="The path to the WDL file") | ||
|
||
parser.add_argument( | ||
"translation", default="janis", choices=["wdl", "wdl", "janis"], nargs="?" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wdl and wdl?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
find-replace ftw 🤦
Suggested: PMCC-BioinformaticsCore/janis#58 (review) Co-authored-by: Michael R. Crusoe <[email protected]>
janisdk/fromwdl/__init__.py
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 print
ing 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