Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/jmrplens/phonometry. Standards-conformant acoustics library for Python: measurement and metrology, docs.jmrp.io/phonometry
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307# Copyright (c) 2026. Jose Manuel Requena Plens"""Numerical conformance report for phonometry.
A maintainable registry of numerical conformance checks. Each entry pins one(standard, quantity) pair to:
* the standard designation + clause/table citation,* the normative expected value or range (from the standard's own worked examples, or a closed form synthesized to a known result),* a callable that computes the library's result, and* the tolerance.
Running the harness emits Markdown for a GitHub PR comment: a headlinesummary followed only by collapsible sections, so the comment stays compactby default. First a "Numerical validation - filters & weightings" showcase(per filter architecture IEC 61260-1 class margins and A/C/G weightingworst-case deviation vs the analytic/normative curve), then one conformancetable per domain (Standard | Quantity | Expected | Computed | Delta |Status). Every section stays collapsed while all of its rows pass and opensautomatically when any row fails.
Expected values are pulled from a single source of truth wherever the testsalready encode them: the shared ``tests/reference_data`` tables and theISO 532-1 data fixtures. Where the reference is a closed form, the harnesssynthesizes an input with a known output, so the check is self-verifying.
Design goals: deterministic, fast (< 1 min), no network, pure library calls.
The checks themselves live in the :mod:`conformance` package next to thisfile, one module per subject; what remains here is the entry point and thefacade over it, carrying the names a caller reaches for -- ``CHECKS``,``Check``, ``render_markdown``, ``main`` -- while each check keeps its ownmodule. The 500-odd private check functions are not re-exported: they areregistered, not called by name. The domain import list below is the only thing this file decides, andit is ordered on purpose: importing a domain module is what registers itschecks, ``CHECKS`` keeps registration order, and the report renders onesection per domain in that order. **That list is the report's section order.**Moving a line moves a section; adding a module adds its section where the linesits."""
from __future__ import annotations
# The report's section order. Each name here is a module of# ``conformance.domains``; importing it registers its checks, they are rendered# in the order they were registered, and so this list is the order of the# report. It is deliberately not alphabetical, which is why the import sorter# is switched off across it.# isort: offfrom conformance.domains import ( filters, filter_tests, fluids, levels, calibrators, sound_level_meters, psychoacoustics, speech, intensity, sound_power_rooms, free_field, building, service_equipment, building_prediction, outdoor, iso17534, software_quality, human_vibration, meter_verification, seat_vibration, signal_burst, personal_vibration_meter, machine_vibration, structural_damage, structural_response, vibration_immission, vibration_railway, vibration_people, vibration_prediction, vibration_railway_prediction, vibration_train_categories, intelligibility, assessment, audiometry, sel_distribution, soundscape, sound_quality, distortion, signal_analysis, underwater, aircraft, environmental_sources, wind_turbine_receptor, absorbers, program_loudness, quasi_peak, broadcast_wave, fdtd, swept_sine, ground_barriers, noise_reducing_devices, panels, plate_junctions, atmospheric_refraction, electroacoustics, random_incidence, free_field_corrections, comparison_calibration, reciprocity_calibration, induction_loop, headphones, noise_control, enclosure_cabin_insulation, in_situ_measurement, workroom_acoustics, suspended_ceilings, steam_turbines, control_valves, control_valves_hydrodynamic, silencer_measurement, vdi2081, cnossos_rail, rolling_stock_noise,)
# isort: onfrom conformance.artifact import ( _BY_DESIGN, ARTIFACT_PATH, build_document, check_id, dumps, load, write,)from conformance.compare import document_problemsfrom conformance.references import Cited, Reference, ReferenceKind, Relationfrom conformance.registry import ( _DATA, _ROOT, _TESTS, CHECKS, Binding, Check, Deviation, Kind, Outcome, Side, Tolerance, ToleranceMode, Verdict, _fmt, count, mask, numeric, record, register,)from conformance.render import ( _DOC_HEADER, _cell, _domains, _filter_verdict, _numerical_validation_section, _snap, _status, main, render_markdown,)from conformance.shared import ( _FILTER_ARCHS, FilterClass, WeightingDeviation, _filter_class, _pass_edge, _weighting_deviation,)
# Re-exported so every name the single-file harness exposed still resolves# through ``conformance_report``. The individual check callables are reached# through ``CHECKS`` (or through their own domain module), as they always were.__all__ = [ "ARTIFACT_PATH", "CHECKS", "_BY_DESIGN", "_DATA", "_DOC_HEADER", "_FILTER_ARCHS", "_ROOT", "_TESTS", "Binding", "Check", "Cited", "Deviation", "FilterClass", "Kind", "Outcome", "Reference", "ReferenceKind", "Relation", "Side", "Tolerance", "ToleranceMode", "Verdict", "WeightingDeviation", "build_document", "check_id", "document_problems", "dumps", "load", "vdi2081", "wind_turbine_receptor", "write", "_cell", "_domains", "_filter_class", "_filter_verdict", "_fmt", "_numerical_validation_section", "_pass_edge", "_snap", "_status", "_weighting_deviation", "absorbers", "aircraft", "assessment", "atmospheric_refraction", "audiometry", "broadcast_wave", "building", "building_prediction", "calibrators", "cnossos_rail", "comparison_calibration", "control_valves", "control_valves_hydrodynamic", "count", "distortion", "electroacoustics", "environmental_sources", "fdtd", "filter_tests", "filters", "fluids", "free_field", "free_field_corrections", "ground_barriers", "human_vibration", "induction_loop", "headphones", "meter_verification", "seat_vibration", "sel_distribution", "service_equipment", "soundscape", "signal_burst", "personal_vibration_meter", "intelligibility", "intensity", "iso17534", "software_quality", "levels", "machine_vibration", "structural_damage", "structural_response", "vibration_immission", "vibration_railway", "vibration_people", "vibration_prediction", "vibration_railway_prediction", "vibration_train_categories", "main", "enclosure_cabin_insulation", "in_situ_measurement", "workroom_acoustics", "suspended_ceilings", "steam_turbines", "mask", "noise_control", "numeric", "outdoor", "panels", "plate_junctions", "program_loudness", "psychoacoustics", "quasi_peak", "random_incidence", "reciprocity_calibration", "record", "register", "rolling_stock_noise", "noise_reducing_devices", "render_markdown", "signal_analysis", "silencer_measurement", "sound_level_meters", "sound_power_rooms", "sound_quality", "speech", "swept_sine", "underwater",]
if __name__ == "__main__": raise SystemExit(main())