Skip to content

linkbudget.checks

checks

checks.py

Post-computation sanity checks for a link budget.

check_budget inspects a computed data_list and returns a list of human-readable warnings about physically dubious or likely-wrong budgets. LinkContainer emits them via warnings.warn after compute() (unless it was constructed with check=False), and LinkContainer.check() returns the list directly.

LinkBudgetWarning

Bases: UserWarning

Category for warnings about a dubious link budget.

check_budget

check_budget(data_list: StageList, carrier_frequency: float | None = None) -> list[str]

Return a list of warning messages about data_list (a computed budget). An empty list means nothing suspicious was found.

Source code in linkbudget/checks.py
def check_budget(data_list: StageList,
                 carrier_frequency: float | None = None) -> list[str]:
    """Return a list of warning messages about ``data_list`` (a computed
    budget).  An empty list means nothing suspicious was found."""
    issues: list[str] = []
    if not data_list:
        return issues

    _check_negative_power(data_list, issues)
    _check_no_signal(data_list, issues)
    _check_repeated_noise_floor(data_list, issues)
    _check_negative_loss(data_list, issues)
    _check_carrier_frequency(data_list, carrier_frequency, issues)
    return issues