Skip to content

grat.reports.catalog

Report catalog.

Report names are the keys of writers.REPORT_FILES

expand

expand(names)

Returns the requested reports plus any report they are built from.

Parameters:

Name Type Description Default
names

report names the caller asked for.

required

Returns: frozenset of report names to produce

Raises:

Type Description
KeyError

a name is not a known report.

Source code in src/grat/reports/catalog.py
def expand(names):
    """Returns the requested reports plus any report they are built from.

    Args:
        names: report names the caller asked for.

    Returns: frozenset of report names to produce

    Raises:
        KeyError: a name is not a known report.
    """
    requested = frozenset(names)

    unknown = requested - ALL_REPORTS
    if unknown:
        raise KeyError(f"unknown reports: {sorted(unknown)}")

    for name, implied in IMPLIES.items():
        if name in requested:
            requested |= implied
    return requested