Skip to content

Every verdict reads its pass and fail flags, grades and classes from the values it holds - #949

Merged
jmrplens merged 1 commit into
fix/records-copy-at-constructionfrom
fix/verdicts-derive-their-flags
Oct 7, 2026
Merged

jmrplens merged 1 commit into
fix/records-copy-at-constructionfrom
fix/verdicts-derive-their-flags

Conversation

@jmrplens

@jmrplens jmrplens commented Oct 7, 2026

Copy link
Copy Markdown
Owner

A result no longer stores a verdict beside the readings it came from. Sixty-two result classes used to keep the flag, grade or class their function had worked out (passes, complies, qualified, the *_met and *_ok flags, the advisories, the per-band classes of the IEC 61260-1, IEC 61672-1 and IEC 61043 verdicts, the ISO 9614-2 grade, the ISO/PAS 1996-3 category, the IEC TS 61400-11-2 block status and the rest), so a result built by hand or rewritten with dataclasses.replace could hold readings that fail and a flag that says they pass. Each of them is now a read-only property, read from the values the result keeps and the limit the standard prints, and so is any figure that only fed it, such as the rounded level of an RD 1367/2007 period or the acceptance region of a trend test.

Where a verdict used to read a stored row, it now reads the measurement behind the row. The IEC 61265 result keeps the four measurements and builds its checks from them and the printed tolerances. The BS.468-4 result keeps the eleven readings and sets each beside the window Table 2 or Table 3 prints. The trend and stationarity tests read their acceptance region from the sequence, the method and alpha. An IEC TS 61400-11-2 block reads its status from its prominence and the practitioner's exclusion. The ISO 3095 track check builds its conditions from the track it holds, including the curve radius and the gradient.

The rows an IEC 61260-1 or IEC 61672-1 class is read from are copied into read-only mappings when the result is built, so a write into one, or into the dictionaries the result was built from, cannot move the class afterwards, and the class of a band is always the one its margins earn. These results still pickle.

The functions take the same arguments and return the same verdicts. What breaks is code that builds one of these results directly, or replaces one of the listed fields with dataclasses.replace: the field is gone and reading the property gives the verdict. A few results gain the field their verdict was missing, for example excess_levels_db and directivity_range_db on the ISO 3747 result, background_margin_db on the ISO 16251-1 result, modal_overlap on the ISO 10848 result, readings_percent on the BS.468-4 result, the measurements on the IEC 61265 result, excluded on a modulation block and curve_radius_m and track_gradient_ratio on the reference track check. A row of band_margins is copied with dict(row), since copy.deepcopy cannot copy a read-only mapping. The upgrading guide (docs/start/upgrading.md and both site twins) lists every class, the fields it no longer takes, what each verdict is read from and the release it first shipped in, and the API table says what each result takes and what it reads.

A test now fails on any public result that stores a verdict. It finds one by the field's type or name, as before, and also by tracing every argument a function of the package hands a public result back to what produced it: an ordering comparison, a combination of them, or a label one chose. That second half is what sees a per-band mask annotated as an array, a class held as a string or an enum member. A field either way fails unless it is listed with the reason it stays: an option the caller sets, a fact of the computation, a column of a published table, a row a verdict's own property builds, the yes or no a tester observed under IEC 61672-3, or the ISO 8297 requirement record. The ISO 8297 and IEC 60118-4 records keep their limits as fields, as before.

The boundary comparison check now reads the fields of an instance a private helper is handed the way the class itself reads them, so the ISO 3745 evaluation that runs from __post_init__ is checked again. It also no longer keeps a value worked out while a cycle was cut short, which had made the verdict on one comparison depend on which comparison of the file was read first. The comparisons it sees again are listed with their reasons.

How it was verified: the conformance report is unchanged, 1893 of 1893 checks, and every verdict of the existing tests and conformance rows reads as before. Run on the tree this branch starts from, the extended test flags 139 stored verdict fields in 61 classes; run on the previous state of the conversion, it flags the 15 fields in 12 classes the name and type rule had missed. The three new boundary check tests fail on the previous version of the check and pass on this one. New tests cover the ISO 3747 smallest-margin rule event by event and position by position, the RD 1367/2007 daily and phase allowances between 58 dB and 61 dB, the read-only rows, the derived ISO 3095 conditions and the IEC TS 61400-11-2 status. The full suite passes (27030 passed, 69 skipped), the documentation snippets pass (7488 blocks over 730 pages), the site builds and validates, and ruff, mypy and bandit are clean.

@jmrplens
jmrplens added this pull request to stack #950 October 7, 2026 15:17
@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 143 files, which is 43 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

⚙️ Run configuration
  • Configuration used: Repository: jmrplens/phonometry/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 57a366d2-44de-4f9c-817b-fc4bdaade3df
📥 Commits

Reviewing files that changed from the base of the PR and between 835d8e1 and b0f645c.

⛔ Files ignored due to path filters (1)
  • scripts/boundary_comparison_exemptions.tsv is excluded by !**/*.tsv
📒 Files selected for processing (143)
  • CHANGELOG.md
  • docs/reference/api/index.md
  • docs/start/upgrading.md
  • llms-full.txt
  • scripts/check_boundary_comparisons.py
  • scripts/conformance/domains/quasi_peak.py
  • site/public/llms/llms-start.txt
  • site/src/content/docs/es/start/upgrading.mdx
  • site/src/content/docs/reference/api/aeroacoustics/measurement-system.md
  • site/src/content/docs/reference/api/broadcast/quasi-peak.md
  • site/src/content/docs/reference/api/building/flanking-transmission.md
  • site/src/content/docs/reference/api/building/floor-covering-improvement.md
  • site/src/content/docs/reference/api/building/intensity-insulation.md
  • site/src/content/docs/reference/api/building/joint-insulation.md
  • site/src/content/docs/reference/api/building/lab-improvement.md
  • site/src/content/docs/reference/api/building/rainfall-sound.md
  • site/src/content/docs/reference/api/building/service-equipment.md
  • site/src/content/docs/reference/api/building/spain.md
  • site/src/content/docs/reference/api/electroacoustics/induction-loop.md
  • site/src/content/docs/reference/api/electroacoustics/sound-reinforcement.md
  • site/src/content/docs/reference/api/environment/impulsive-sound.md
  • site/src/content/docs/reference/api/environment/measurement.md
  • site/src/content/docs/reference/api/environment/rolling-stock-noise.md
  • site/src/content/docs/reference/api/environment/spain.md
  • site/src/content/docs/reference/api/environment/wind-turbine-modulation.md
  • site/src/content/docs/reference/api/environment/wind-turbine-receptor.md
  • site/src/content/docs/reference/api/environment/wind-turbine.md
  • site/src/content/docs/reference/api/filters/compliance.md
  • site/src/content/docs/reference/api/filters/weighting-compliance.md
  • site/src/content/docs/reference/api/hearing/audiometry.md
  • site/src/content/docs/reference/api/hearing/occupational-exposure.md
  • site/src/content/docs/reference/api/hearing/real-ear-attenuation.md
  • site/src/content/docs/reference/api/materials/suspended-ceilings.md
  • site/src/content/docs/reference/api/metrology/data-qualification.md
  • site/src/content/docs/reference/api/metrology/reciprocity-coupler.md
  • site/src/content/docs/reference/api/metrology/reciprocity-free-field.md
  • site/src/content/docs/reference/api/noise_control/cabin-insulation.md
  • site/src/content/docs/reference/api/power/free-field-qualification.md
  • site/src/content/docs/reference/api/power/intensity-compliance.md
  • site/src/content/docs/reference/api/power/reference-sound-source.md
  • site/src/content/docs/reference/api/power/sound-power-hard-walled.md
  • site/src/content/docs/reference/api/power/sound-power-in-duct.md
  • site/src/content/docs/reference/api/power/sound-power-in-situ.md
  • site/src/content/docs/reference/api/power/sound-power-intensity-points.md
  • site/src/content/docs/reference/api/power/sound-power-intensity.md
  • site/src/content/docs/reference/api/power/sound-power-special-room.md
  • site/src/content/docs/reference/api/power/turbine-noise.md
  • site/src/content/docs/reference/api/power/workstation.md
  • site/src/content/docs/reference/api/rooms/acoustics.md
  • site/src/content/docs/reference/api/rooms/spatial-decay.md
  • site/src/content/docs/reference/api/rooms/workroom-prediction.md
  • site/src/content/docs/reference/api/underwater/weighting.md
  • site/src/content/docs/reference/api/vibration/people.md
  • site/src/content/docs/reference/api/vibration/train-categories.md
  • site/src/content/docs/reference/api/vibration/transfer-stiffness.md
  • site/src/content/docs/start/upgrading.mdx
  • src/phonometry/_internal/frozen.py
  • src/phonometry/_internal/validation.py
  • src/phonometry/aircraft/measurement_system.py
  • src/phonometry/broadcast/quasi_peak.py
  • src/phonometry/building/measurement/flanking_transmission.py
  • src/phonometry/building/measurement/floor_covering_improvement.py
  • src/phonometry/building/measurement/intensity_insulation.py
  • src/phonometry/building/measurement/joint_insulation.py
  • src/phonometry/building/measurement/lab_improvement.py
  • src/phonometry/building/measurement/rainfall_sound.py
  • src/phonometry/building/measurement/service_equipment.py
  • src/phonometry/building/regulation/spain.py
  • src/phonometry/electroacoustics/induction_loop.py
  • src/phonometry/electroacoustics/sound_reinforcement.py
  • src/phonometry/emission/free_field_qualification.py
  • src/phonometry/emission/intensity_compliance.py
  • src/phonometry/emission/reference_sound_source.py
  • src/phonometry/emission/sound_power_hard_walled.py
  • src/phonometry/emission/sound_power_in_duct.py
  • src/phonometry/emission/sound_power_in_situ.py
  • src/phonometry/emission/sound_power_intensity.py
  • src/phonometry/emission/sound_power_intensity_points.py
  • src/phonometry/emission/sound_power_special_room.py
  • src/phonometry/emission/turbine_noise.py
  • src/phonometry/emission/workstation.py
  • src/phonometry/environment/assessment/impulsive_sound.py
  • src/phonometry/environment/assessment/measurement.py
  • src/phonometry/environment/assessment/spain.py
  • src/phonometry/environment/assessment/wind_turbine_modulation.py
  • src/phonometry/environment/assessment/wind_turbine_receptor.py
  • src/phonometry/environment/sources/rolling_stock_noise.py
  • src/phonometry/environment/sources/wind_turbine.py
  • src/phonometry/filters/compliance.py
  • src/phonometry/filters/weighting_compliance.py
  • src/phonometry/hearing/audiometry.py
  • src/phonometry/hearing/occupational_exposure.py
  • src/phonometry/hearing/real_ear_attenuation.py
  • src/phonometry/materials/absorbers/suspended_ceilings.py
  • src/phonometry/metrology/data_qualification.py
  • src/phonometry/metrology/reciprocity_coupler.py
  • src/phonometry/metrology/reciprocity_free_field.py
  • src/phonometry/noise_control/cabin_insulation.py
  • src/phonometry/room/acoustics.py
  • src/phonometry/room/spatial_decay.py
  • src/phonometry/room/workroom_prediction.py
  • src/phonometry/underwater/bioacoustics/weighting.py
  • src/phonometry/vibration/immission/people.py
  • src/phonometry/vibration/immission/train_categories.py
  • src/phonometry/vibration/structural/transfer_stiffness.py
  • tests/aircraft/test_aircraft_noise_system.py
  • tests/broadcast/test_quasi_peak.py
  • tests/building/measurement/test_intensity_insulation.py
  • tests/building/measurement/test_iso16251_report.py
  • tests/building/measurement/test_service_equipment.py
  • tests/building/regulation/test_spanish_building_code.py
  • tests/emission/test_intensity_compliance.py
  • tests/emission/test_sound_power_hard_walled.py
  • tests/emission/test_sound_power_in_situ.py
  • tests/emission/test_sound_power_intensity.py
  • tests/emission/test_sound_power_intensity_points.py
  • tests/emission/test_sound_power_precision.py
  • tests/emission/test_sound_power_special_room.py
  • tests/emission/test_workstation.py
  • tests/environment/assessment/test_impulse_prominence.py
  • tests/environment/assessment/test_impulsive_sound.py
  • tests/environment/assessment/test_spain.py
  • tests/environment/assessment/test_wind_turbine_modulation.py
  • tests/environment/sources/test_rolling_stock_noise.py
  • tests/environment/sources/test_wind_turbine_tonality_report.py
  • tests/filters/test_compliance.py
  • tests/filters/test_iec61260_report.py
  • tests/filters/test_pattern_evaluation.py
  • tests/filters/test_weighting_class_verifier.py
  • tests/hearing/test_occupational_exposure.py
  • tests/metrology/test_data_qualification.py
  • tests/noise_control/test_cabin_insulation.py
  • tests/result_factories.py
  • tests/room/test_iso3382_report.py
  • tests/room/test_room_frequency_axis_language.py
  • tests/stored_verdicts.py
  • tests/test_boundary_verdicts.py
  • tests/test_check_boundary_comparisons.py
  • tests/test_owns_arrays.py
  • tests/test_printed_limits.py
  • tests/underwater/bioacoustics/test_weighting.py
  • tests/vibration/structural/test_transfer_stiffness.py
  • tests/vibration/structural/test_transfer_stiffness_report.py

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Review on demand using usage pricing
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sourcery-ai

sourcery-ai Bot commented Oct 7, 2026

Copy link
Copy Markdown

Sorry @jmrplens, your pull request is larger than the review limit of 150,000 diff characters

@github-actions github-actions Bot added documentation Improvements or additions to documentation conformance Standard clause coverage, reference values or errata api Public API surface, naming and deprecations site Documentation website i18n English and Spanish translations area: aircraft Aircraft and rotorcraft noise area: broadcast Programme loudness and broadcast levels area: building Sound insulation and building acoustics area: electroacoustics Transducers, arrays and electroacoustic devices area: emission Sound power and source emission area: environment Outdoor propagation, environmental sources and noise assessment area: hearing Audiometric thresholds, hearing loss and noise exposure area: materials Absorption, impedance and material properties area: metrology Calibration, uncertainty and measurement quality area: noise control Silencers, barriers and noise control treatments area: room Room acoustics and reverberation area: underwater Underwater acoustics and propagation area: vibration Human vibration and structure-borne sound area: core Shared internals and cross-cutting code every domain depends on area: filters Octave filter banks, weightings and instrument class verification labels Oct 7, 2026
@codecov

codecov Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.50656% with 38 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.80%. Comparing base (835d8e1) to head (b0f645c).

Files with missing lines Patch % Lines
src/phonometry/emission/sound_power_intensity.py 94.25% 10 Missing ⚠️
...honometry/emission/sound_power_intensity_points.py 95.87% 4 Missing ⚠️
.../environment/assessment/wind_turbine_modulation.py 92.59% 4 Missing ⚠️
src/phonometry/metrology/data_qualification.py 89.18% 4 Missing ⚠️
src/phonometry/emission/reference_sound_source.py 92.68% 3 Missing ⚠️
...honometry/building/measurement/joint_insulation.py 95.83% 2 Missing ⚠️
src/phonometry/emission/intensity_compliance.py 90.47% 2 Missing ⚠️
src/phonometry/environment/assessment/spain.py 93.33% 2 Missing ⚠️
src/phonometry/vibration/immission/people.py 94.87% 2 Missing ⚠️
src/phonometry/emission/sound_power_hard_walled.py 96.77% 1 Missing ⚠️
... and 4 more
Additional details and impacted files
@@                         Coverage Diff                          @@
##           fix/records-copy-at-construction     #949      +/-   ##
====================================================================
- Coverage                             96.80%   96.80%   -0.01%     
====================================================================
  Files                                   443      443              
  Lines                                 88037    88771     +734     
====================================================================
+ Hits                                  85223    85933     +710     
- Misses                                 2814     2838      +24     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Numerical conformance

All 1893 conformance checks pass, across 111 domains and 523 standards

1893/1893 checks pass across 111 domains and 523 standards (227 normative designations, 125 further published sources).

Used in the tables below is how much of that clause's published tolerance the deviation consumes: 100 % sits exactly on the limit, 5 % uses a twentieth of the allowance, and a dash means the clause states no two-sided tolerance for the quantity, so there is no budget to spend. It is reported and never used to decide a verdict, which is settled at full precision before any rounding.

New checks (2)

Standard Quantity Deviation Used
IEC 61094-5:2016 6.7; ISO/IEC Guide 98-3 F.1.2.3, Example 2 Correlation of two calibrations against the same standard of 10^-4, for comparisons of 100, 10 and 1 x 10^-6, as printed 0 0 %
IEC 61094-5:2016 6.7, Table D.1; ISO/IEC Guide 98-3 5.2.2 Expanded uncertainty of the difference of two calibrations against the same LS2P, each with the budget of Table D.1 0 dB 0 %

Closest to their published limit (top 5)

The rows with the least room left, so the ones a change is most likely to push over.

Standard Quantity Deviation Used
ISO/TR 17534-3:2015 Table 3 Ground-projected path length dp, m 0.005 m 100 %
DIN 4150-2:1999-06 Annex C, Example 5 KB_FTr with hammer b) in the rest hours, Formula (5) -0.005 100 %
DIN 4150-2:1999-06 Annex C, Example 8 KB_FTm over the record with the passage maxima alone -0.0005 100 %
E DIN 4150-2:2023-08 Annex B, Table B.1 KB_FTm,Zug of the metro north by Formula (5) -0.0005 100 %
Jarvis (1996) NPL CIRA(EXT) 010 Appendix B, folio 26 Volume of the coupler of the example, v = pi r^2 L -0.00000000005 m³ 100 %

Pass Tests & coverage: 162606 tests, 0 failures (all green)
Python Version Tests Failures Coverage Status
macos-latest-3.13 27101 0 96.8% Pass Passed
macos-latest-3.14 27101 0 96.8% Pass Passed
ubuntu-latest-3.13 27101 0 96.8% Pass Passed
ubuntu-latest-3.14 27101 0 96.8% Pass Passed
windows-latest-3.13 27101 0 96.8% Pass Passed
windows-latest-3.14 27101 0 96.8% Pass Passed

Full report at this commit: docs/CONFORMANCE.md · docs/conformance.json · full CI artifacts

@jmrplens
jmrplens force-pushed the fix/verdicts-derive-their-flags branch from 3b47221 to ab69a42 Compare October 7, 2026 16:07
@jmrplens
jmrplens force-pushed the fix/verdicts-derive-their-flags branch from ab69a42 to 1a56ee4 Compare October 7, 2026 16:51
…the values it holds

A result no longer stores a verdict beside the readings it came from. Sixty-two result classes used to keep the flag, grade or class their function had worked out (`passes`, `complies`, `qualified`, the `*_met` and `*_ok` flags, the advisories, the per-band classes of the IEC 61260-1, IEC 61672-1 and IEC 61043 verdicts, the ISO 9614-2 grade, the ISO/PAS 1996-3 category, the IEC TS 61400-11-2 block status and the rest), so a result built by hand or rewritten with `dataclasses.replace` could hold readings that fail and a flag that says they pass. Each of them is now a read-only property, read from the values the result keeps and the limit the standard prints, and so is any figure that only fed it, such as the rounded level of an RD 1367/2007 period or the acceptance region of a trend test.
@jmrplens
jmrplens force-pushed the fix/verdicts-derive-their-flags branch from 1a56ee4 to b0f645c Compare October 7, 2026 18:05
@sonarqubecloud

sonarqubecloud Bot commented Oct 7, 2026

Copy link
Copy Markdown

@jmrplens
jmrplens merged commit 6a33a2e into main Oct 7, 2026
90 of 93 checks passed
@jmrplens
jmrplens deleted the fix/verdicts-derive-their-flags branch October 7, 2026 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Public API surface, naming and deprecations area: aircraft Aircraft and rotorcraft noise area: broadcast Programme loudness and broadcast levels area: building Sound insulation and building acoustics area: core Shared internals and cross-cutting code every domain depends on area: electroacoustics Transducers, arrays and electroacoustic devices area: emission Sound power and source emission area: environment Outdoor propagation, environmental sources and noise assessment area: filters Octave filter banks, weightings and instrument class verification area: hearing Audiometric thresholds, hearing loss and noise exposure area: materials Absorption, impedance and material properties area: metrology Calibration, uncertainty and measurement quality area: noise control Silencers, barriers and noise control treatments area: room Room acoustics and reverberation area: underwater Underwater acoustics and propagation area: vibration Human vibration and structure-borne sound conformance Standard clause coverage, reference values or errata documentation Improvements or additions to documentation i18n English and Spanish translations site Documentation website

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant