示例#1
0
def get_workflow_name(df):
    """Extract and format the workflow name from the data frame."""
    try:
        workflow_name = df.workflow_name.iloc[0]
        workflow_name = re.sub(r'^[^_]*_', '', workflow_name)
    except KeyError:
        util.error_exit('Workflow name not found in classifications file.')
    return workflow_name
示例#2
0
def get_workflow_id(df, args):
    """Pull the workflow ID from the data-frame if it was not given."""
    if args.workflow_id:
        return args.workflow_id

    workflow_ids = df.workflow_id.unique()

    if len(workflow_ids) > 1:
        util.error_exit('There are multiple workflows in this file. '
                        'You must provide a workflow ID as an argument.')

    return workflow_ids[0]