Expand description
Battery plausibility lints — physically-grounded consistency checks that EU Battery Regulation 2023/1542 does not itself require, but that flag likely data-entry mistakes: energy/capacity arithmetic, unit-conversion consistency, material-composition sums, and date/range plausibility.
Structs§
- Battery
Lint Input - Borrowing view over the battery fields these lints inspect.
Functions§
- energy_
capacity_ mismatch - Physics check: energy (Wh) = voltage (V) × capacity (Ah). A declared
ratedEnergyWhmore thanENERGY_CAPACITY_TOLERANCE_PCTaway from the V×Ah product is more likely a data-entry error than a real spec — though a generous tolerance is kept since manufacturers sometimes rate energy at average (not nominal) discharge voltage, henceNoticenotWarning. - lint_
battery - Run every battery plausibility lint and collect the findings.
- manufacturing_
date_ in_ future - Cross-field ordering: a declared manufacturing date after “now” cannot be correct — the battery hasn’t been made yet.
- material_
composition_ sums - Sum-consistency check:
cathodeMaterial,anodeMaterial, andelectrolyteMaterialare each declared as aweightPctbreakdown of that component — none of the three currently have a hard schema or cross-field gate requiring them to sum to 100%. Fires independently per list, so 0–3 findings can result from one call. - operating_
temp_ absurd_ range - Range plausibility: no commercial battery chemistry operates outside
roughly -60°C to 150°C. A declared bound beyond that is far more likely a
unit slip (e.g. Fahrenheit entered as Celsius) than a real spec. Distinct
from
crate::batteries::chemistry::validate_operating_temp_range, which checksmin < max— this checks each bound against a plausible envelope. - rated_
capacity_ kwh_ wh_ mismatch - Unit-conversion check:
ratedCapacityKwh × 1000andratedEnergyWhdescribe the same physical quantity in different units and should match closely — unlike the voltage×capacity estimate above, there is no legitimate reason for these two to diverge by more than rounding.