Repository navigation
Every verdict reads its pass and fail flags, grades and classes from the values it holds - #949
Conversation
|
Important Review skippedToo 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
⛔ Files ignored due to path filters (1)
📒 Files selected for processing (143)
You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
|
Sorry @jmrplens, your pull request is larger than the review limit of 150,000 diff characters |
Codecov Report❌ Patch coverage is 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. 🚀 New features to boost your workflow:
|
Numerical conformance1893/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)
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.
|
3b47221 to
ab69a42
Compare
ab69a42 to
1a56ee4
Compare
…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.
1a56ee4 to
b0f645c
Compare
|



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*_metand*_okflags, 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 withdataclasses.replacecould 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 exampleexcess_levels_dbanddirectivity_range_dbon the ISO 3747 result,background_margin_dbon the ISO 16251-1 result,modal_overlapon the ISO 10848 result,readings_percenton the BS.468-4 result, the measurements on the IEC 61265 result,excludedon a modulation block andcurve_radius_mandtrack_gradient_ratioon the reference track check. A row ofband_marginsis copied withdict(row), sincecopy.deepcopycannot 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.