compliance: grade on water too, and retire the two magic floats #71
Loading…
Reference in a new issue
No description provided.
Delete branch "compliance/composite-grade"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Two hardcoded floats with no provenance, no version, and no way to say which instrument they encode — the exact shape
BandingScalewas added to replace, sitting in the same crate, on the path a regulator would read.It also silently ignored water.
EedReporthas collectedwater_usage_litersall along, and the schemes that grade facilities grade on power and water, so the check discarded an axis it already had in hand.The test that demonstrates this is the reason for the deprecation, rather than an argument for it:
Three pieces
wue_milli_l_per_kwh()derives Water Usage Effectiveness as an integer, returningNonerather than 0 when IT energy is zero. WUE is undefined there, and a 0 would read as perfect water efficiency for a facility that reported nothing — the flattering direction, which is the one to refuse.CompositeRatingcombines several metric ratings into one grade under a declared rule. "Worst of" and "mean of" are both defensible and give different letters for the same facility, so the rule travels with the grade — the same reason aRatingcarries its scale.It keeps its components, so a reader sees which axis set the grade. A facility rated D on water with an A on power is a materially different thing from one rated D on both, and a bare letter cannot tell them apart.
binding_component()names the axis an operator must improve to move the letter;covers()reports whether a required axis was graded at all, because a grade that silently omits one is not the scheme's grade.grade()ties them together, taking the scales rather than embedding any. Which thresholds apply is the instrument's business, not this crate's — the same reasonBandingScalestill ships no canonical scale.Notes
is_compliantis deprecated, not deleted — it's public API, and the deprecation note carries the reasoning to the call site where a silent removal could not.Found by the 2026-08-29 sweep, which flagged both that WUE was not rateable end-to-end and that this function had survived the change meant to retire it.
Verification
50
jouleclaw-compliancetests pass (7 new) · no clippy warnings in the crate (the four reported are pre-existing, injouleclaw-coreandjouleclaw-energy).