Beispiel #1
0
def get_dataset_items(summary: dict, warnings: list) -> list:
    items = [
        get_dataset_overview(summary),
        get_dataset_reproduction(summary),
    ]

    if warnings:
        items.append(get_dataset_warnings(warnings))

    return items
Beispiel #2
0
def get_dataset_items(summary, date_start, date_end, warnings):
    items = [
        get_dataset_overview(summary),
        get_dataset_reproduction(summary, date_start, date_end),
    ]

    count = len([
        warning for warning in warnings if warning.message_type not in [
            MessageType.UNIFORM,
            MessageType.UNIQUE,
            MessageType.REJECTED,
            MessageType.CONSTANT,
        ]
    ])
    if count > 0:
        items.append(get_dataset_warnings(warnings, count))

    return items
Beispiel #3
0
def get_dataset_items(summary: dict, warnings: list) -> list:
    """Returns the dataset overview (at the top of the report)

    Args:
        summary: the calculated summary
        warnings: the warnings

    Returns:
        A list with components for the dataset overview (overview, reproduction, warnings)
    """
    items = [
        get_dataset_overview(summary),
        get_dataset_reproduction(summary),
    ]

    if warnings:
        items.append(get_dataset_warnings(warnings))

    return items
Beispiel #4
0
def get_dataset_items(summary: dict, warnings: list) -> list:
    """Returns the dataset overview (at the top of the report)

    Args:
        summary: the calculated summary
        warnings: the warnings

    Returns:
        A list with components for the dataset overview (overview, reproduction, warnings)
    """
    metadata = {
        key: config["dataset"][key].get(str) for key in config["dataset"].keys()
    }

    items = [
        get_dataset_overview(summary),
        get_dataset_reproduction(summary, metadata),
    ]

    if warnings:
        items.append(get_dataset_warnings(warnings))

    return items