Skip to main content

Module battery

Module battery 

Source
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§

BatteryLintInput
Borrowing view over the battery fields these lints inspect.

Functions§

energy_capacity_mismatch
Physics check: energy (Wh) = voltage (V) × capacity (Ah). A declared ratedEnergyWh more than ENERGY_CAPACITY_TOLERANCE_PCT away 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, hence Notice not Warning.
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, and electrolyteMaterial are each declared as a weightPct breakdown 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 checks min < max — this checks each bound against a plausible envelope.
rated_capacity_kwh_wh_mismatch
Unit-conversion check: ratedCapacityKwh × 1000 and ratedEnergyWh describe 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.