#!/usr/bin/env python3 """Descriptive least-cost envelopes over the prespecified 5–10% receiver-error range.""" import csv import json from pathlib import Path HERE=Path(__file__).resolve().parent def identify(row): return None if row is None else (row['method'],row['grid'],row['modes_per_patch'],row.get('requested_cfl')) def selected(row): if row is None:return None keys=('grid','method','dimension','modes_per_patch','requested_cfl','total_receiver_error', 'alternative_reference_total_receiver_error','total_seconds','minimum_total_seconds','maximum_total_seconds') return {key:row.get(key) for key in keys} def calculate(cfg,rows): lower,upper=min(cfg['smooth_receiver_tolerances']),max(cfg['smooth_receiver_tolerances']) materials={} interval_rows=[] for material in cfg['smooth_materials']: candidates=[row for row in rows if row['material']==material and 'total_seconds' in row] breaks=sorted({lower,upper}|{row[key] for row in candidates for key in ('total_receiver_error','alternative_reference_total_receiver_error') if lower