예제 #1
0
def required_input_steps(workflow_path):
    steps = inputs_normalized(workflow_path=workflow_path)
    required_steps = []
    for input_step in steps:
        if input_step.get("optional", False) or input_step.get("default"):
            continue
        required_steps.append(input_step)
    return required_steps
예제 #2
0
def input_labels(workflow_path):
    """Get normalized labels for workflow artifact regardless of format."""
    steps = inputs_normalized(workflow_path=workflow_path)
    labels = []
    for step in steps:
        step_id = input_label(step)
        if step_id:
            labels.append(step_id)
    return labels
예제 #3
0
def required_input_steps(workflow_path):
    try:
        steps = inputs_normalized(workflow_path=workflow_path)
    except Exception:
        raise Exception(
            "Input workflow could not be successfully normalized - try linting with planemo workflow_lint."
        )
    required_steps = []
    for input_step in steps:
        if input_step.get("optional", False) or input_step.get("default"):
            continue
        required_steps.append(input_step)
    return required_steps
예제 #4
0
def test_optional_inputs():
    # Ensure normalized inputs can be used to check if inputs have defaults.
    for workflow_dict in _both_formats(RANDOM_LINES_EXAMPLE):
        steps = inputs_normalized(workflow_dict=workflow_dict)
        assert steps[1]["type"] == "int"
        assert steps[1]["default"] == 3