def test_describe_outputs(): wf_path = os.path.join(TEST_DATA_DIR, "wf1.gxwf.yml") outputs = describe_outputs(wf_path) assert len(outputs) == 1 output = outputs[0] assert output.order_index == 1 assert output.output_name == "out_file1" assert output.label == "wf_output_1"
def get_outputs(runnable): """Return a list of :class:`RunnableOutput` objects for this runnable.""" if not runnable.is_single_artifact: raise NotImplementedError("Cannot generate outputs for a directory.") if runnable.type in [RunnableType.galaxy_tool, RunnableType.cwl_tool]: tool_source = get_tool_source(runnable.path) # TODO: do something with collections at some point output_datasets, _ = tool_source.parse_outputs(None) return [ToolOutput(o) for o in output_datasets.values()] elif runnable.type == RunnableType.galaxy_workflow: workflow_outputs = describe_outputs(runnable.path) return [GalaxyWorkflowOutput(o) for o in workflow_outputs] else: raise NotImplementedError("Getting outputs for this artifact type is not yet supported.")
def get_outputs(runnable, gi=None): """Return a list of :class:`RunnableOutput` objects for this runnable. Supply bioblend user Galaxy instance object (as gi) if additional context needed to resolve workflow details. """ if not runnable.is_single_artifact: raise NotImplementedError("Cannot generate outputs for a directory.") if runnable.type in [RunnableType.galaxy_tool, RunnableType.cwl_tool]: tool_source = get_tool_source(runnable.path) # TODO: do something with collections at some point output_datasets, _ = tool_source.parse_outputs(None) outputs = [ToolOutput(o) for o in output_datasets.values()] return outputs elif runnable.type == RunnableType.galaxy_workflow: workflow_outputs = describe_outputs(runnable, gi=gi) return [GalaxyWorkflowOutput(o) for o in workflow_outputs] elif runnable.type == RunnableType.cwl_workflow: workflow = workflow_proxy(runnable.path, strict_cwl_validation=False) return [CwlWorkflowOutput(label) for label in workflow.output_labels] else: raise NotImplementedError( "Getting outputs for this artifact type is not yet supported.")