Battery cycle-life reference handbook

Inspect the native equations, reproduce the examples, and separate software evidence from the synthetic teaching lessons.

Reviewed 2026-11-19 · Source 02ed161bded2. This is a dated documentation snapshot.

Browse reference chapters

Battery cycle-life reference handbook

Reviewed source: 02ed161bded286dad4b3624961430a564715c782. Documentation snapshot: 2026-11-19. The reading view is derived from these canonical Markdown files; its date is neither a software release nor a deployment receipt.

The native Python package fits linear, power-law and logarithmic curves to cycle–capacity observations, selects a family using a late-cycle holdout, and offers bounded EOL/RUL estimates with conditional residual-bootstrap intervals. The browser teaching lab evaluates a separate synthetic exponential model. Neither interface establishes calibrated battery lifetime or pack-safety performance. bcla/core.py:18–42 bcla/core.py:299–435 docs/index.html:183–189 docs/index.html:269–273

Choose a task

Task Canonical starting point
Understand provenance and review limits Source evidence
Follow data through the system Architecture
Install the pinned source and reproduce checks Setup
Use an API, command or data format Contracts, native declarations
Run a synthetic example or examine the notebook Worked examples
Diagnose a failed fit, unavailable interval or loader error Troubleshooting
Interpret browser sliders and exports Browser model catalog
Check equations and parameter dimensions Equations, symbols, limits
Assess evidence and maintain gates Verification ledger, CI and release, toolchain
Maintain this handbook Documentation runbook, failure modes
Recover or hand over ownership Governance, recovery, decision index, portfolio integration
Plan subsequent work Twelve-month roadmap

Existing material and project records

The README, contributor guide, Oxford walkthrough, original Markdown introduction, notebook, changelog, citation metadata, license and security guidance retain their roles. Historical release notes and the dated Oxford audit remain historical records. This handbook explains the pinned source where metadata or older prose differs.

Existing learning routes remain available: browser lab, native catalog, portfolio learning paths and animation archive. The native catalog and learning-path records contain older source revisions; their labels and scripts are preserved rather than silently presented as newly audited native results. docs/native-lessons.json:8–20 docs/portfolio/lesson-config.json:16–18

Canonical file: docs/HANDBOOK.md · Back to guide navigation

Source evidence and coverage boundaries

This handbook analyzes immutable commit 02ed161bded286dad4b3624961430a564715c782, tree 47bb084efe6758920bd59101243400b9be9488a7. The complete canonical tree contains 183 entries: 152 blobs and 31 directories. All blob payloads were independently matched to their Git object IDs; 151 decode as text and one is a PNG. A file being downloaded, parsed or hashed is not equivalent to a full semantic review.

Dispositions and methods

The operational inventory assigns 74 entries ANALYZED and 109 INDEXED_ONLY with an explicit reason for each path. All 31 directory entries are indexed objects. No source entry is omitted. The following describes the scope of those labels:

Source group Review method and limit
bcla/*.py, native examples Complete native behavior, interfaces, scientific assumptions and error/write paths reviewed; native tests and synthetic examples executed separately
Native tests/ Test bodies reviewed; 190 native tests passed, 6 live skips, 13 passing subtests; 17 separate Node CSP tests passed
Notebook and generator All 14 notebook cells and generator read; 7 exact code cells executed; source notebook remains unchanged
Three CSV fixtures All rows read and parsed; 12 single-cell, 6 metadata and4 history rows; all synthetic
docs/index.html Model specs, evaluators, checkpoint and UI/export controller reviewed; active degradation checkpoints executed; CSS/artwork structurally indexed
Catalog/portfolio/waveform controllers Relevant complete state/search/copy/export/drawing logic reviewed; historical source metadata preserved; no GUI claim
Workflows, package configuration, main guides Actual events, matrices, dependencies, release/publication contracts and meaningful text reviewed
Operational security tooling Static definitions, declared gate contracts and relevant quality configuration inspected; most scanner helper bodies, security test bodies, provenance inventories, locks and native export records remain indexed-only; no exhaustive security audit or vulnerability refresh
SVG/CSS/generated asset/catalog records Structural parse, hashes, references and selected provenance; no exhaustive pixel/animation/assistive-technology review
PNG and historical README Immutable binary/history indexing; preserved, not freshly generated or treated as a new measured result

The public native catalog includes 36 declarations and 48 dataclass fields, with decorator-inclusive ranges. A complete Python AST traversal accounts for 376 definitions in 36 files, including conditional/nested/test/tooling declarations. JavaScript AST extraction covers 9 units, 65 declarations and 36 event registrations, plus embedded JSON and external script references. This supplemental extraction resolves the initial unavailable TypeScript-parser path; the initial diagnostic is retained, not relabeled. Dynamic DOM behavior and operational scanner internals retain their stated limits. Native catalog · browser catalog.

Claim anchors

Claim Immutable source
Empirical equations, bounds and parameter order bcla/core.py:18–53
Fitting, validation, bounded EOL and bootstrap bcla/core.py:57–533
Temperature helper and illustrative plotting bcla/core.py:539–566 bcla/viz.py:153–201
Loaders, metadata, normalization and EFC convention bcla/datasets.py:74–262 bcla/datasets.py:445–923
Oxford fetch/preprocessing and historical audit examples/oxford_energy_trading.py:25–257 docs/oxford-energy-trading.md:83–112
Browser model separation and exports docs/index.html:155–344 docs/index.html:469–491
Packaging and version drift pyproject.toml:5–17 bcla/init.py:15–31 CHANGELOG.md:5–17
Existing publication path .github/workflows/deploy-dashboard.yml:61–90

External technical interpretation uses the official SciPy 1.17 solver contract. Release metadata was checked through GitHub and the primary PyPI record. The Oxford record returned 403 during this review; source-declared attribution remains explicitly separate from fresh archive retrieval. Exact commands, environment versions, hashes, original failure/skip receipts and candidate identities are retained in the six specialist audit handoffs. The verification ledger states what was and was not executed.

Canonical file: docs/SOURCE_EVIDENCE.md · Back to guide navigation

Architecture and execution boundaries

The installed distribution contains bcla* and exposes the bcla console command. Native analysis uses NumPy, SciPy and Matplotlib. Checkout-only examples, data, notebook and static Pages assets are separate working surfaces. There is no model server, database or browser-to-Python execution bridge in this source. pyproject.toml:5–17 pyproject.toml:54–58 docs/index.html:155–162

Native analysis flow

  1. datasets produces seeded synthetic traces, reads a single-cell CSV/TSV, or loads a long-form table with per-cell metadata and optional interval history.
  2. core receives numerical cycle and capacity arrays. The direct fitter does not normalize or sort them; temporal validation sorts by cycle and keeps duplicate cycle groups together.
  3. Late-cycle validation chooses a family, then select_model_by_validation refits that family to all observations. best_model instead selects by an in-sample diagnostic.
  4. FitResult stores arrays, parameters, covariance and fit diagnostics. EOL scans a finite grid; the bootstrap refits one selected family and withholds bounds after any failed or censored replicate.
  5. viz returns Matplotlib objects; the CLI writes bcla_demo.png in the current working directory. bcla/datasets.py:653–923 bcla/core.py:179–404 bcla/core.py:407–533 bcla/main.py:74–178

Metadata such as temperature, C-rate, protocol, timestamps and duty-cycle intervals is preserved and summarized by loaders. It is not automatically a regressor or damage accumulation input to the capacity-fade functions. Keep the observation table and provenance beside the arrays. bcla/datasets.py:206–262 bcla/datasets.py:746–923 bcla/core.py:179–241

External data and presentation

examples/oxford_energy_trading.py is an opt-in adapter: it downloads two allowlisted Oxford files for one selected cell, canonicalizes profile timestamps, converts measured discharge throughput to EFC, and uses the same empirical fitting machinery. Its local text loader can be tested without a download. It is an example module, outside the installed bcla* package set. examples/oxford_energy_trading.py:25–108 examples/oxford_energy_trading.py:123–257 pyproject.toml:57–58

The static browser lab embeds lesson JSON and a ten-mode JavaScript evaluator. This repository configures the degradation mode. Its plots, 241-row CSV export and checkpoints are synthetic calculations in the page. The portfolio route stores personal notes/completion in local storage and exports study-plan JSON; it does not run native commands. The catalog searches linked reading and copies commands. docs/index.html:155–189 docs/index.html:419–427 docs/index.html:469–491 docs/portfolio/index.html:255–286 docs/native-lessons.html:83–131

Pages uploads the existing docs/ directory directly after validation. The new reference view is a deterministic documentation build: Markdown/CFF → Pandoc fragments → local link rewriting → static HTML/CSS. Its renderer writes only docs/reference/index.html; it neither imports bcla nor participates in scientific execution. Maintenance defines the regeneration path. .github/workflows/deploy-dashboard.yml:54–90

Canonical file: docs/developer/ARCHITECTURE.md · Back to guide navigation

Setup and reproducibility

Install one explicit revision

For the behavior documented here, use a separate checkout and environment:

git clone https://github.com/mohammadrezwankhan/battery-cycle-life-analyzer.git
cd battery-cycle-life-analyzer
git checkout e3457deb23c5aeb2dd8ac19a1214c587f00d3b2d
python -m venv .venv
. .venv/bin/activate
python -m pip install -e ".[dev]"
python -m bcla --help

The manifest declares Python ≥3.11 and minimum NumPy 1.21, SciPy 1.7, Matplotlib 3.5 and Pillow 13.0.0. The [dev] extra adds pytest; it does not pin a complete scientific environment. The separate development dependency group pins quality tools. Record the interpreter, actual resolved dependencies, platform, source SHA, input digest, selected model, random seed and parameters for a reproducible result. pyproject.toml:5–17 pyproject.toml:48–61

The author review used Python 3.12.14, NumPy 2.3.5, SciPy 1.17.0, Matplotlib 3.10.8 and pytest 9.2.0 in an external environment. These are observed review versions, not a new lockfile or proof of the whole supported matrix. Floating-point fits and bootstrap quantiles can vary with solver/library versions. The verification ledger records actual execution scope.

Reproduce local checks

BCLA_RUN_OXFORD_LIVE=0 MPLBACKEND=Agg python -m pytest -q -ra
node --test tests/browser/csp.test.mjs
python scripts/portfolio/validate_guide.py
node scripts/browser-csp.mjs --check
python docs/reference/build_reference.py --check

The native tests use tests/; the configured hardened quality suite additionally includes security-helper tests and coverage gates. The commands above do not run every hosted security scanner, every supported Python version, or Oxford live data. The browser tools declare Node ≥22. BCLA_RUN_OXFORD_LIVE=1 explicitly opts into external Oxford access; ordinary local documentation review leaves it off. pyproject.toml:81–82 .github/security/quality.json:7–21 package.json:5–13 tests/test_oxford_live.py:1–48

Preserve inputs and outputs

The CLI overwrites bcla_demo.png in its working directory. Use an output directory outside the checkout and an absolute CSV path after installing the package. The native API does not itself save analysis records. The notebook writes three PNGs; build_notebook.py overwrites the tracked notebook, so regeneration belongs in a deliberate notebook change with a reviewed diff. make notebook requires a separately provisioned Jupyter/nbconvert environment; that frontend path was not exercised in this review. bcla/main.py:161–178 build_notebook.py:181–279 Makefile:8–15

PyPI's recorded 0.3.0 distribution was published from a different commit. Installing a release package is a separate reproduction target from this source checkout; do not infer equivalence from the version string. Release identity details.

Canonical file: docs/developer/SETUP_AND_REPRODUCIBILITY.md · Back to guide navigation

APIs, CLI and data interfaces

The native declaration catalog records every source-defined public class/function/method in the six native modules, including decorator-inclusive source links and dataclass fields. Parameters without / or * are positional-or-keyword; defaults make values optional. FitResult.summary uses a keyword-only ascii_only, and EFC's query_time_s is keyword-only. Imported third-party names and private helpers are not promoted to stable APIs. bcla/core.py:57–125 bcla/datasets.py:108–114

Native object and function contracts

Entry Input/output and limits
fit_capacity_fade(cycles, capacity, model="power_law", q0_guess=None) Finite nonempty aligned 1-D arrays, cycles ≥0; returns mutable FitResult. Does not normalize, sort, require positive capacity, or enforce a per-family distinct-observation minimum before SciPy. Initial Q0 defaults to maximum capacity.
fit_all_models(cycles, capacity) Fits all three registry families and returns a name → result dictionary; an exception can stop the complete operation.
best_model(results, criterion="rmse") Returns (name, FitResult) using minimum in-sample RMSE or maximum in-sample R².
temporal_holdout_scores(..., validation_fraction=0.2) Flattens numeric inputs, stably sorts cycles, keeps duplicates together, and returns three frozen ValidationScore records; at least four distinct training and two distinct held-out cycles.
select_model_by_validation(..., criterion="rmse") Returns mutable ModelSelection; selection.validation_score exposes the selected score, including train/validation sizes. Its fit is a full-data refit, not the earlier training fit.
FitResult.project(target_cycles) Finite nonnegative scalar → finite float or ValueError. No three-times-horizon guard and no zero-capacity clamp; negative extrapolated capacity is possible.
FitResult.eol_cycle(eol_fraction=0.8) Fraction in (0, 1); first grid crossing of fitted Q0 × fraction within 0..3 max(observed cycles), otherwise None.
bootstrap_life_projection(...) Result, fraction .8, current cycle None→maximum observed cycle, confidence .95, samples 500, random state None; returns frozen LifeProjectionInterval. Samples must be integer ≥20; all replicates must fit and cross within their search window for interval bounds.
arrhenius_acceleration_factor(temperature_c, reference_c=25.0, activation_ev=0.5) Finite Celsius temperatures above absolute zero and finite activation energy → positive finite acceleration factor. Negative activation energy is accepted; this helper is not automatically coupled to fitted trajectories.
viz.capacity_fade, model_comparison, eol_vs_temperature Return Matplotlib Axes, Figure, Axes; global plotting style is applied. The comparison uses three axes; the temperature view is a separate illustrative linear-rate scaling.

bcla/core.py:57–173 bcla/core.py:179–404 bcla/core.py:407–566 bcla/viz.py:44–201

FitResult.params uses the exact keys Q0, k, α, β, a, b for the relevant family. Covariance rows/columns follow registry parameter order. Arrays and dictionaries remain mutable even inside frozen wrapper dataclasses; freezing prevents attribute reassignment, not deep mutation. bcla.__all__ re-exports LongFormCycleData and four dataset helpers; import fitting functions through bcla.core. bcla/core.py:38–42 bcla/core.py:57–173 bcla/datasets.py:206–262 bcla/init.py:15–31

File and current-profile interfaces

Interface Schema and behavior
load_cycle_data(csv_path, cycle_col="cycle", capacity_col="capacity", sep=None, normalize=True) UTF-8/BOM CSV; .tsv/.tab chooses tab unless separator supplied; exact case-sensitive headers. Returns two arrays in input row order. Normalization divides by the first input row; denominator near zero is rejected. Loader permits finite negative cycles/capacity; native fitting rejects negative cycles.
load_cycle_data_long_form(...) Required cell_id,cycle,capacity. Optional chemistry,timestamp_iso,temperature_c,c_rate,rest_time_h,cycles_per_day,depth_of_discharge,energy_throughput_wh,duty_cycle_profile,protocol,source. Unknown extra columns are not retained. Returns LongFormCycleData.
LongFormCycleData.for_cell(cell_id) Stable cycle-sorted arrays; unknown ID raises KeyError. Normalization uses each cell's earliest cycle observation, unlike the simple loader. cycles/capacity aliases reject multicell tables.
load_duty_cycle_history(...) Required cell_id,experiment_id,interval_start,interval_end. Optional direction/profile/protocol/state, temperature, C-rate, DoD, throughput and source. End must exceed start; returns (rows, interval_summaries, schema_version).
equivalent_full_cycles(time_s,current_a,nominal_capacity_ah,*,query_time_s=None) Aligned finite 1-D arrays with at least two samples; nonnegative strictly increasing seconds and positive nominal Ah. Positive current is discharge. Clips sampled current before linear interpolation/integration. Optional finite queries must fall inside the measured range; scalar becomes a one-element array.

bcla/datasets.py:74–203 bcla/datasets.py:206–262 bcla/datasets.py:445–576 bcla/datasets.py:653–923

Long-form cycles must be nonnegative; capacity need only be finite. C-rate, rest, cycles/day and Wh must be nonnegative; DoD is in [0, 1]. Temperature is only checked for finiteness. Optional missing values become None. ISO parsing accepts timezone-naive values; mixing naive and timezone-aware timestamps can fail during comparison. Interval overlap and physical agreement between the history and measured capacity are not validated. Schema version values tag the returned records rather than selecting a separate validated schema implementation. bcla/datasets.py:272–442 bcla/datasets.py:579–650 bcla/datasets.py:746–923

Native command-line interfaces

python -m bcla and the installed bcla entry point call the same function. Both choose synthetic LFP data unless --csv is provided. The command always writes bcla_demo.png; it has no output-path option. Invalid argparse choices/ranges exit with status 2; some loader/fitting exceptions propagate. pyproject.toml:54–55 bcla/main.py:9–178

Option Default / meaning
--cycles 1500 synthetic observations; ignored when CSV supplied
--model all; choices linear, power_law, logarithmic, all
--selection validation; in-sample is the alternate all-model selection route
--validation-fraction .2, strictly between 0 and 1; checked even with a single model
--bootstrap-samples 0 disables; otherwise integer ≥20; CLI uses fixed seed 42, 95% confidence and 80% threshold
--csv No path by default; single-cell simple loader, not long-form/history import
--cycle-col, --capacity-col cycle, capacity
--sep Auto comma/tab by suffix
--no-normalize False; leaves capacity in source units, which may conflict with normalized-capacity fit bounds
-h, --help Describe parser and exit without analysis

The checkout-only Oxford CLI accepts --cell (default BMR_cell1, six allowed IDs), --validation-fraction (.2), --bootstrap-samples (200) and --output (absent means no figure file). --help performs no download; analysis downloads approved archive inputs. load_oxford_cell_from_text is the offline adapter, load_oxford_cell fetches them, and run_analysis prints summary metrics and returns None after fitting. examples/oxford_energy_trading.py:207–257 examples/oxford_energy_trading.py:308–442

The notebook generator writes notebooks/demo.ipynb; the preview module writes docs/model_comparison_preview.png. These are intentional generator commands, not read-only checks. Browser and documentation commands are catalogued separately in browser interfaces and the maintenance runbook. build_notebook.py:264–279 examples/render_model_preview.py:14–27

Canonical file: docs/developer/API_CLI_AND_INTERFACES.md · Back to guide navigation

Worked examples and laboratories

1. Reproduce the bundled synthetic CSV

Run this from the pinned checkout after setup. The file has twelve observations from cycle 0 through 1100; its 3 Ah starting value is normalized to 1 by the loader. These bundled observations are synthetic demonstrations, not measured validation data. data/quickstart.csv:1–13 README.md:185–188

from bcla import core, datasets

cycles, capacity = datasets.load_cycle_data("data/quickstart.csv")
selection = core.select_model_by_validation(cycles, capacity, validation_fraction=0.2)
fit = selection.fit
interval = core.bootstrap_life_projection(fit, samples=50, random_state=42)
print(selection.model_name)
print(round(selection.validation_score.rmse, 6))
print(round(fit.eol_cycle(0.8), 3))
print(interval.successful_samples, interval.censored_samples, interval.failed_samples)

Observed on the review environment: linear, held-out RMSE 0.00101, EOL 1112.54 cycles and replicate counts 50 0 0. The split has nine training and three validation observations. Full-data fitted Q0≈0.999982906, k≈0.000179767; the 50-replicate conditional 95% EOL interval was approximately [1107.055,1121.512] cycles. That leaves a point RUL of approximately 12.540 cycles at cycle 1100. These are executed synthetic-example results, not a precision guarantee or measured lifetime forecast. The implementation and scope are in the equations. bcla/core.py:299–404 bcla/core.py:407–533

The equivalent CLI was executed successfully with --model all --bootstrap-samples 50 and an absolute quickstart CSV path; it wrote bcla_demo.png in an external output directory. For arbitrary inputs, check fit.eol_cycle(...) is None before rounding; this fixture produced a crossing, but the API does not promise one. bcla/main.py:74–178

2. Check the EFC interpolation convention

from bcla.datasets import equivalent_full_cycles

efc = equivalent_full_cycles(
    [0.0, 900.0], [8.0, -8.0], nominal_capacity_ah=16.0,
    query_time_s=[450.0, 900.0],
)
print(efc)  # [0.046875 0.0625]

This executed result integrates the line from sampled clipped currents [8,0]. Integrating a line through signed currents [8,-8] and clipping at its zero crossing would produce a different area. Choose and report the source convention when comparing an external EFC calculation. No charge throughput is counted, and cumulative EFC starts at zero at the first provided measurement. bcla/datasets.py:108–203

3. Keep metadata with one cell

from bcla.datasets import load_cycle_data_long_form

data = load_cycle_data_long_form(
    "data/cycle_metadata_example.csv",
    history_csv_path="data/cycle_duty_history_example.csv",
)
print(data.cell_ids)  # ('LFP-A', 'NMC-B')
x, q = data.for_cell("LFP-A")

The parsed fixture contains six observation rows and four history intervals, with history schema tag "2". Each cell has only three observations; do not feed this tiny schema example to the six-distinct-cycle validation route and mistake an expected rejection for a loader failure. The metadata is retained, not coupled to an aging model. data/cycle_metadata_example.csv:1–7 data/cycle_duty_history_example.csv:1–5 bcla/core.py:277–296

4. Notebook and external-data boundary

All seven exact code cells in the existing notebook were executed sequentially under Python with Matplotlib's Agg backend, in an external directory. The source notebook remained unmodified with empty outputs. Three figures were written. This verifies code-cell execution, not a Jupyter frontend, Colab install or interactive display. Its NMC seed-7 example selected power_law, reported held-out RMSE about .00366, EOL about 1071 cycles and a 100-replicate interval approximately 1066–1075 cycles. The displayed LFP/NMC comparison remains an illustrative comparison between generators. build_notebook.py:70–179 build_notebook.py:181–260

The Oxford walkthrough records a historical live-data audit dated 2026-08-31. This review ran its offline tests and CLI help, but did not download the external archive or rerun its six live cases. Before a fresh measured-data study, retain the actual input files, hashes, archive identity/license, canonicalization counts, EFC convention, holdout split and failed/censored outcomes. docs/oxford-energy-trading.md:9–33 examples/oxford_energy_trading.py:207–257 tests/test_oxford_live.py:1–48

Canonical file: docs/developer/WORKED_EXAMPLES_AND_LABS.md · Back to guide navigation

Troubleshooting

Symptom Source-supported explanation and next check
Initial guess outside bounds / implausible fit Fitter expects normalized-capacity scale through Q0∈[.5,1.5]; it does not normalize input. Check units, first-row denominator, q0_guess and family bounds. --no-normalize is not unit conversion.
Too few training/distinct cycles Validation needs four distinct early cycles and two distinct late cycles. Its fraction counts rows and duplicates move the split. Reduce holdout fraction only if a scientifically meaningful split remains; a three-row metadata fixture cannot satisfy this contract.
Constant-series R² confusing Training R² is 0 when total variance is zero; held-out R² is NaN. R²-based selection rejects nonfinite scores. Report RMSE and data variation instead of treating NaN as a good score.
eol_cycle returns None No threshold crossing in 0..3 max(cycles). This is a bounded unavailable estimate, not infinite life.
Negative project output project has no finite search horizon or nonnegative-capacity clamp. Check the requested range and empirical model validity.
Bootstrap interval unavailable Inspect requested/successful/censored/failed counts. A single censored or failed replicate withholds all bounds. Zero residual variance or insufficient residual degrees of freedom raises instead.
Unicode parameter key mismatch Power-law parameters are stored as α and β; use these keys. ASCII summary changes display text only.
Missing or mixed-cell loader result Simple loader expects exact headers; long-form requires cell IDs. Select for_cell explicitly; single-cell aliases reject multiple cells.
Unexpected normalization Simple loader uses first row; long-form uses earliest cycle per cell. Keep the raw source and normalization reference.
Timestamp comparison failure Mixed naive/aware ISO timestamps can be incomparable; standardize their time basis before loading. No overlap or calendar-aging model is inferred from timestamps.
EFC differs from another integrator Check positive-current sign convention, seconds/Ah conversion, first measurement origin and clipping-before-interpolation. Queries outside measured time range are rejected.
Oxford example cannot download Verify the allowed Oxford origin, file ID, network access and ≤32 MiB response; do not bypass the source host/redirect policy. Offline fixtures are a separate check.
Plot is missing or overwritten CLI writes current-directory bcla_demo.png; use a writable isolated working directory and Agg for headless execution.
Browser and Python disagree They implement different models and input contracts. The browser's degradation proxy is not a wrapper around SciPy fits.
Documentation CI passes but a nested link is broken Current Lychee arguments cover README, CONTRIBUTING and docs/*.md, not all nested handbook pages. Run the local handbook link/renderer checks and review new paths.

bcla/core.py:38–125 bcla/core.py:179–258 bcla/core.py:277–404 bcla/core.py:407–533 bcla/datasets.py:108–203 bcla/datasets.py:206–262 bcla/datasets.py:352–442 bcla/datasets.py:653–923 examples/oxford_energy_trading.py:66–108 bcla/main.py:161–178 docs/index.html:269–273 .github/workflows/markdown-maintenance.yml:39–45

For a reproducible issue, include the exact source SHA and interpreter/library versions, a small permitted input, the command, expected/observed behavior, and complete failure text. Keep private measurements, secrets and large raw data out of public issue reports. Runtime failures, validation rejections, skipped live tests and missing provider evidence are different outcomes; record the actual one. Security reporting and verification define the relevant boundaries.

Canonical file: docs/developer/TROUBLESHOOTING.md · Back to guide navigation

Native declaration catalog

This catalog records the 36 source-defined public declarations in the six native modules, including 48 declared dataclass fields. It is an exact source snapshot, not a compatibility promise. Decorator-inclusive links retain the dataclass/property contract; separate definition coordinates remain in the operational inventory. See API contracts for shapes, units, exceptions and write behavior. Imported third-party names and private/test/security helpers are not advertised as native user APIs.

Functions and methods below preserve positional/keyword markers and defaults. Dataclass field listings describe generated constructor inputs; field(default_factory=...) is a per-instance factory. Frozen containers do not recursively freeze their lists, dictionaries or arrays.

bcla/__main__.py

main

bcla/main.py:9–174

main() -> None

bcla/core.py

FitResult

bcla/core.py:57–125

@dataclass
class FitResult:
    model_name: str
    params: dict[str, float]
    pcov: np.ndarray
    rmse: float
    r_squared: float
    cycles: np.ndarray
    observed: np.ndarray
    predicted: np.ndarray

FitResult.project

bcla/core.py:70–84

project(self, target_cycles: float) -> float

FitResult.eol_cycle

bcla/core.py:86–111

eol_cycle(self, eol_fraction: float=0.8) -> Optional[float]

FitResult.summary

bcla/core.py:113–125

summary(self, *, ascii_only: bool=False) -> str

ValidationScore

bcla/core.py:128–137

@dataclass(frozen=True)
class ValidationScore:
    model_name: str
    rmse: float
    r_squared: float
    train_size: int
    validation_size: int
    split_cycle: float

ModelSelection

bcla/core.py:140–153

@dataclass
class ModelSelection:
    model_name: str
    fit: FitResult
    scores: dict[str, ValidationScore]
    criterion: Literal['rmse', 'r_squared']
    validation_fraction: float

ModelSelection.validation_score

bcla/core.py:150–153

@property
validation_score(self) -> ValidationScore

LifeProjectionInterval

bcla/core.py:156–173

@dataclass(frozen=True)
class LifeProjectionInterval:
    model_name: str
    confidence: float
    eol_fraction: float
    current_cycle: float
    eol_estimate: Optional[float]
    eol_lower: Optional[float]
    eol_upper: Optional[float]
    rul_estimate: Optional[float]
    rul_lower: Optional[float]
    rul_upper: Optional[float]
    requested_samples: int
    successful_samples: int
    censored_samples: int
    failed_samples: int

fit_capacity_fade

bcla/core.py:179–258

fit_capacity_fade(cycles: ArrayLike, capacity: ArrayLike, model: str='power_law', q0_guess: Optional[float]=None) -> FitResult

fit_all_models

bcla/core.py:261–263

fit_all_models(cycles: np.ndarray, capacity: np.ndarray) -> dict[str, FitResult]

best_model

bcla/core.py:266–274

best_model(results: dict[str, FitResult], criterion: Literal['rmse', 'r_squared']='rmse') -> tuple[str, FitResult]

temporal_holdout_scores

bcla/core.py:299–364

temporal_holdout_scores(cycles: ArrayLike, capacity: ArrayLike, validation_fraction: float=0.2) -> dict[str, ValidationScore]

select_model_by_validation

bcla/core.py:367–404

select_model_by_validation(cycles: ArrayLike, capacity: ArrayLike, validation_fraction: float=0.2, criterion: Literal['rmse', 'r_squared']='rmse') -> ModelSelection

bootstrap_life_projection

bcla/core.py:407–533

bootstrap_life_projection(result: FitResult, eol_fraction: float=0.8, current_cycle: Optional[float]=None, confidence: float=0.95, samples: int=500, random_state: Optional[int]=None) -> LifeProjectionInterval

arrhenius_acceleration_factor

bcla/core.py:539–566

arrhenius_acceleration_factor(temperature_c: float, reference_c: float=25.0, activation_ev: float=0.5) -> float

bcla/datasets.py

synthetic_lfp

bcla/datasets.py:17–53

synthetic_lfp(cycles: int=1500, seed: int=42, noise_std: float=0.005) -> tuple[NDArray[np.float64], NDArray[np.float64]]

synthetic_nmc

bcla/datasets.py:56–71

synthetic_nmc(cycles: int=1000, seed: int=7, noise_std: float=0.004) -> tuple[NDArray[np.float64], NDArray[np.float64]]

equivalent_full_cycles

bcla/datasets.py:108–203

equivalent_full_cycles(time_s: Any, current_a: Any, nominal_capacity_ah: float, *, query_time_s: Any | None=None) -> NDArray[np.float64]

LongFormCycleData

bcla/datasets.py:206–262

@dataclass(frozen=True)
class LongFormCycleData:
    rows: list[dict[str, Any]]
    schema_version: str
    validation_envelopes: dict[str, dict[str, Any]]
    duty_cycle_history: list[dict[str, Any]] = field(default_factory=list)
    duty_cycle_history_schema: str | None = None
    duty_cycle_history_validation: dict[str, dict[str, Any]] = field(default_factory=dict)

LongFormCycleData.cell_ids

bcla/datasets.py:217–225

@property
cell_ids(self) -> tuple[str, ...]

LongFormCycleData.cycles

bcla/datasets.py:227–238

@property
cycles(self) -> NDArray[np.float64]

LongFormCycleData.capacity

bcla/datasets.py:240–251

@property
capacity(self) -> NDArray[np.float64]

LongFormCycleData.for_cell

bcla/datasets.py:253–262

for_cell(self, cell_id: str) -> tuple[NDArray[np.float64], NDArray[np.float64]]

load_duty_cycle_history

bcla/datasets.py:445–576

load_duty_cycle_history(csv_path: str | Path, sep: str | None=None, schema_version: str='2', *, expected_cell_ids: set[str] | None=None) -> tuple[list[dict[str, Any]], dict[str, dict[str, Any]], str]

load_cycle_data

bcla/datasets.py:653–743

load_cycle_data(csv_path: str | Path, cycle_col: str='cycle', capacity_col: str='capacity', sep: str | None=None, normalize: bool=True) -> tuple[NDArray[np.float64], NDArray[np.float64]]

load_cycle_data_long_form

bcla/datasets.py:746–923

load_cycle_data_long_form(csv_path: str | Path, sep: str | None=None, normalize: bool=True, schema_version: str='1', history_csv_path: str | Path | None=None, history_schema_version: str='2') -> LongFormCycleData

bcla/viz.py

capacity_fade

bcla/viz.py:52–125

capacity_fade(result: FitResult, ax: Optional[Axes]=None, show_eol: bool=True, eol_fraction: float=0.8, title: str='Capacity Fade') -> Axes

model_comparison

bcla/viz.py:128–150

model_comparison(results: dict[str, FitResult], eol_fraction: float=0.8) -> Figure

eol_vs_temperature

bcla/viz.py:153–201

eol_vs_temperature(q0: float, k: float, cycle_range: tuple[int, int]=(0, 3000), temperatures: Optional[list[float]]=None, eol_fraction: float=0.8, ax: Optional[Axes]=None) -> Axes

examples/oxford_energy_trading.py

OxfordCellData

examples/oxford_energy_trading.py:42–54

@dataclass(frozen=True)
class OxfordCellData:
    cell_id: str
    efc: NDArray[np.float64]
    capacity_ah: NDArray[np.float64]
    normalized_capacity: NDArray[np.float64]
    profile_rows: int
    canonical_profile_rows: int
    non_increasing_transitions: int
    duplicate_samples: int
    unobserved_tail_s: float

load_oxford_cell_from_text

examples/oxford_energy_trading.py:207–247

load_oxford_cell_from_text(cell_id: str, profile_csv: str, capacity_csv: str, nominal_capacity_ah: float=NOMINAL_CAPACITY_AH) -> OxfordCellData

load_oxford_cell

examples/oxford_energy_trading.py:250–257

load_oxford_cell(cell_id: str) -> OxfordCellData

run_analysis

examples/oxford_energy_trading.py:308–418

run_analysis(cell_id: str, *, validation_fraction: float, bootstrap_samples: int, output: Path | None) -> None

main

examples/oxford_energy_trading.py:421–438

main() -> None

examples/render_model_preview.py

main

examples/render_model_preview.py:14–23

main() -> None

Package re-exports and operational surfaces

The package root re-exports LongFormCycleData, equivalent_full_cycles, load_cycle_data, load_cycle_data_long_form and load_duty_cycle_history. Fitting/visualization remain explicit submodules. The source runtime version is 0.2.0; package metadata separately declares 0.3.0. bcla/init.py:15–31 pyproject.toml:5–10

Operational entrypoints also include the notebook generator, portfolio validator, browser CSP command and repository security/quality tooling. All 376 Python class/function definitions and 24 parser registrations across 36 files are indexed separately, including conditional/nested helpers. Static extraction of security tooling is not a completed security audit. Source accounting and toolchain state those limits.

Canonical file: docs/developer/API_REFERENCE.md · Back to guide navigation

Browser model and control inventory

The active lesson kind is degradation. Its JavaScript runs independently of native Python and external measurements. Source docs/index.html bundles ten teaching model kinds; this review executed the eight configured degradation checkpoints and structurally enumerated the remaining kinds. Their presence is not a claim that this site exposes ten active lessons or that all ten models were numerically validated. docs/index.html:155–238

Pure exports and inputs

LabSimulation exports MODEL_SPECS, getModelSpec(kind), resolveParameters(kind, provided), evaluateModel(kind, provided, time) and checkCheckpoint(checkpoint, metrics). An unknown kind throws. Parameter values must be finite JavaScript numbers; they are clamped to source bounds or replaced by defaults. UI steps do not quantize programmatic values. Time is clamped to the selected mode horizon, with nonfinite time replaced by zero. Metric output is a plain object. docs/index.html:239–254 docs/index.html:328–344

Checkpoint comparisons accept >=/gte, <=/lte, >/gt, </lt, ==/=/eq/≈. Nonfinite/unknown values or unsupported operators return status invalid; numerical comparison returns pass or fail. Absolute tolerance expands inclusive/equality comparisons, while strict inequalities ignore it. This verifies one formula fixture, not physical calibration. docs/index.html:328–341

Bundled model specs

Kind Model time / horizon Input keys Metric keys
battery 6 h capacityAh, currentA, resistanceOhm, ambientC, initialSoc socPct, voltageV, temperatureC, powerKW
thermal 60 min heatW, coolingWK, capacityJPerK, ambientC temperatureC, heatRemovedW, storedEnergyKJ, residualW
degradation 1000 cycles fadePer1000Pct, temperatureC, cRate, initialCapacityAh retentionPct, capacityAh, resistanceGrowthPct, throughputKWh
grid 24 h demandKW, solarKW, batteryKW, carbonGPerKWh gridImportKW, solarOutputKW, renewablePct, emissionsKgPerH
cooling 60 min serverCount, utilizationPct, ambientC, coolingEfficiency itKW, coolingKW, pue, inletC
agents 30 min arrivalRate, agentCount, serviceRate, coordinationPct backlog, throughput, utilizationPct, waitMinutes
markets 24 h baseSpreadBps, feeBps, slippageBps, notionalUSD spreadBps, netEdgeBps, netPnlUSD, costUSD
control 20 s setpoint, damping, naturalFrequency, gain output, error, velocity, overshootPct
security 60 min alertRate, analystCount, reviewRate, automationPct backlog, coveragePct, reviewedAlerts, workloadPct
charging 120 min capacityKWh, chargerKW, initialSoc, efficiencyPct socPct, chargingKW, energyAddedKWh, lossKW

The active exponential equations, units and parameter bounds are described in equations and symbols. Each bundled specification also states its own teaching assumptions. No inactive mode is imported into the native empirical model registry. docs/index.html:167–238 bcla/core.py:38–42

Active checkpoint observations

Module Metric at model time Observed value Source expected / tolerance
module-1 retentionPct at 1000 cycles 83.527021141 == 83.527021 ± 0.02
module-1 capacityAh at 1000 cycles 83.527021141 == 83.527021 ± 0.02
module-2 retentionPct at 1000 cycles 74.321505943 == 74.321506 ± 0.02
module-2 capacityAh at 1000 cycles 74.321505943 == 74.321506 ± 0.02
module-3 retentionPct at 1000 cycles 65.724664717 == 65.724665 ± 0.02
module-3 throughputKWh at 1000 cycles 302.168154383 == 302.168154 ± 0.02
module-4 retentionPct at 1000 cycles 90.483741804 == 90.483742 ± 0.02
module-4 capacityAh at 1000 cycles 45.241870902 == 45.241871 ± 0.02

These are actual Node evaluations of the exact source inline model script and canonical lesson configuration, whose embedded JSON was checked for equality. No DOM, canvas, download, storage, clipboard or assistive-technology interaction was executed. Lesson inputs and expectations are retained in the pinned configuration.

UI and file/state contracts

Surface Source-defined behavior
Main lab Sliders update the current synthetic parameters; timeline controls model time; Run/Pause and reset affect animation state. The plotted/exported series has 241 evenly spaced samples including both endpoints.
Checkpoints Presets choose lesson inputs and the first fixed checkpoint time; each check can use its own fixed time. A module completion record is in memory and denotes a prior verified experiment, not a native test.
CSV export battery-cycle-life-analyzer-synthetic-telemetry.csv; time, metric and input_ columns, numerical values formatted to 12 significant digits and CRLF rows. No measured data is imported.
Configuration dialog Shows/downloads canonical embedded lesson JSON; clipboard API has a selection/copy fallback.
LabDashboard Frozen wrapper exposes getState() with copied parameter values plus evaluateModel and getModelSpec; no native Python bridge.
Portfolio guide Local-storage key includes repository and historical source revision; stores reviewed IDs, notes and motion preference. Study-plan export includes execution_status: not_executed_by_this_guide.
Native catalog Text/tag filters combine search with all selected tags; copy buttons copy displayed commands with fallback selection. It does not execute them.
Animation archive Gallery loads media after explicit play; waveform controls alter decorative drawing, not a battery simulation.

docs/index.html:350–427 docs/index.html:461–491 docs/portfolio/index.html:255–286 docs/native-lessons.html:83–131 docs/animations/gallery.js:1–20 docs/animations/waveform.html:154–215

The existing browser pages retain their historical native/catalog provenance and original scripts, styling and configs. The handbook adds navigation and a dated current source explanation. Actual keyboard, responsive, storage/export and published-page checks belong to a supported browser review and remain unclaimed here.

Canonical file: docs/developer/BROWSER_MODEL_CATALOG.md · Back to guide navigation

Implemented equations and explanatory derivations

Let nn denote the supplied cycle coordinate and q(n)q(n) the capacity on the caller's scale, normally a normalized fraction. For the Oxford adapter, nn is discharge EFC. The package does not convert a cycle count to calendar time or couple metadata to the fitted equations. These are empirical algebraic curves, not an electrochemical state model, ODE/PDE or pack-safety simulation. bcla/core.py:18–42 bcla/datasets.py:206–262 examples/oxford_energy_trading.py:207–247

1. Three fitted families

Registry name Implemented equation Bounds, in registry order
linear q(n)=Q0−knq(n)=Q_0-kn Q0∈[.5,1.5]Q_0\in[.5, 1.5], k∈[0,1]k\in[0, 1]
power_law q(n)=Q0−αnβq(n)=Q_0-\alpha n^\beta Q0∈[.5,1.5]Q_0\in[.5, 1.5], α∈[0,5]\alpha\in[0, 5], β∈[.1,2]\beta\in[.1, 2]
logarithmic q(n)=Q0−aln(1+bn)q(n)=Q_0-a\ln(1+bn) Q0∈[.5,1.5]Q_0\in[.5, 1.5], a∈[0,1]a\in[0, 1], b∈[0,105]b\in[0, 10^5]

All three have the fitted intercept q(0)=Q0q(0)=Q_0. There is no independently imposed physical initial condition or spatial boundary condition. On nonnegative nn, their permitted fade coefficients produce nonincreasing curves, including constant curves when a required coefficient is zero. This is a mathematical property of the chosen formulas/bounds, not evidence of physical calibration. bcla/core.py:18–42

For a positive threshold fraction f<1f<1, the following continuous roots are explanatory derivations, not the implemented EOL algorithm:

nf=Q0(1−f)k,nf=(Q0(1−f)α)1/β,nf=exp(Q0(1−f)/a)−1b.n_f=\frac{Q_0(1-f)}{k},\qquad n_f=\left(\frac{Q_0(1-f)}{\alpha}\right)^{1/\beta},\qquad n_f=\frac{\exp(Q_0(1-f)/a)-1}{b}.

These expressions require positive denominators/coefficient combinations; zero fade may have no finite crossing. The exponential expression can overflow. Do not substitute the formulas for the source's explicit finite-window and finite-value checks. bcla/core.py:86–111

2. Fitting and diagnostics

The source calls curve_fit with parameter bounds and maxfev=50_000. It supplies no weights, analytic Jacobian, solver method or uncertainty scale. Its initial guess is Q0=max(y) unless provided; linear kk uses the first/last input rows with a 10−610^{-6} denominator offset and floor 10−810^{-8}; power-law starts at (α,β)=(.01,.6)(\alpha,\beta)=(.01,.6); logarithmic starts at (a,b)=(.02,.1)(a, b)=(.02,.1). Input rows are not sorted by this direct fit. bcla/core.py:179–241

Under the SciPy 1.17 curve_fit contract, bounds select default trf, absent sigma gives unweighted least squares, and the Jacobian is numerical. pcov is a local linear approximation with the default residual-based scaling, not a lifetime confidence interval. Optimization is local; model adequacy and identifiability require separate assessment.

For NN observations and residuals ri=yi−q̂(ni)r_i=y_i-\hat q(n_i), the stored diagnostics are

RMSE=1N∑iri2,R2=1−∑iri2∑i(yi−y‾)2.\mathrm{RMSE}=\sqrt{\frac{1}{N}\sum_i r_i^2},\qquad R^2=1-\frac{\sum_i r_i^2}{\sum_i(y_i-\bar y)^2}.

The denominator in RMSE is NN, not residual degrees of freedom. When observed variance is zero, training R² is stored as 0; held-out R² is NaN. These diagnostics describe the supplied arrays, not physical uncertainty. bcla/core.py:243–258 bcla/core.py:339–364

3. Chronological validation and full-data refit

The validation route flattens arrays, stably sorts by cycle, and starts with max(2,⌈Nv⌉)\max(2,\lceil Nv\rceil) late rows for requested fraction vv. It moves the boundary to keep equal-cycle groups together and at least two distinct held-out cycle values. At least four distinct training cycle values are required for the current three-parameter maximum, with at least six distinct values overall. Each family is fitted only on earlier observations and scored on later ones. Selection then refits the chosen family to all sorted observations. bcla/core.py:277–404

This avoids splitting equal cycle coordinates across training and validation. It does not prove independent cells, stationary conditions or future forecast accuracy. The same holdout chooses the family, so its winning score is a selection diagnostic rather than a separate untouched final test. Duplicates within a partition still contribute as repeated observations; there is no grouping by cell or experiment beyond caller selection.

4. Bounded EOL and residual bootstrap

For horizon H=3maxiniH=3\max_i n_i, eol_cycle evaluates 100000 equally spaced points in [0,H][0, H] and returns the first where q̂(n)≤fQ0\hat q(n)\le fQ_0. Otherwise it returns None. With H>0H>0, grid spacing is H/99,999H/99{,}999. For a continuous monotone curve whose crossing is in-range, the grid result is at or just after that root, up to one grid spacing apart subject to floating-point behavior. The threshold is relative to the fitted Q0Q_0, not necessarily the first recorded capacity. project has neither this horizon restriction nor a capacity clamp. bcla/core.py:70–111

The bootstrap centers residuals, resamples them independently with replacement at the original cycle coordinates, forms synthetic responses yi*=q̂(ni)+ri*y_i^*=\hat q(n_i)+r_i^*, and refits the same selected family. It requires more observations and distinct cycles than fitted parameters plus positive residual variation. Refit failures are counted separately from replicates with no in-window EOL. Every requested replicate must be successful before percentile bounds are returned. bcla/core.py:407–533

With confidence cc, successful bounds use empirical quantiles (1−c)/2(1-c)/2 and 1−(1−c)/21-(1-c)/2. RUL is max(0,nf−ncurrent)\max(0, n_f-n_{\mathrm{current}}) for the point estimate and each replicate. The default current coordinate is the largest observed cycle. These intervals condition on the selected model and the resampling assumptions; they do not include model-family selection, protocol uncertainty, calibration error, measurement uncertainty not represented by residuals, or serial/heteroscedastic residual structure. Censored or failed replicates must not be silently dropped to manufacture finite bounds. bcla/core.py:435–533

5. Current throughput and Oxford preprocessing

For measured samples tit_i in seconds and current IiI_i in amperes, define Ii+=max(Ii,0)I_i^+=\max(I_i, 0). The implemented interval increment is

ΔEFCi=(Ii++Ii+1+)(ti+1−ti)2⋅3600⋅Qnom,Ah.\Delta\mathrm{EFC}_i=\frac{(I_i^++I_{i+1}^+)(t_{i+1}-t_i)}{2\cdot3600\cdot Q_{\mathrm{nom, Ah}}}.

EFC begins at zero at the first measurement. For query offset u∈[0,Δti]u\in[0,\Delta t_i], the partial interval uses the integral of the linearly interpolated clipped samples:

ΔEFC(u)=Ii+u+(Ii+1+−Ii+)u2/(2Δti)3600Qnom,Ah.\Delta\mathrm{EFC}(u)=\frac{I_i^+u+(I_{i+1}^+-I_i^+)u^2/(2\Delta t_i)}{3600Q_{\mathrm{nom, Ah}}}.

This defines an interpolation convention; it is not generally equal to clipping a linearly interpolated signed-current trace. Only discharge throughput is counted. Seconds/Ah units and current sign must be supplied consistently. bcla/datasets.py:108–203

The Oxford text adapter stably sorts profile time, averages duplicate-time currents and records affected counts. Fully nonfinite trailing profile rows can be removed; partially nonfinite or interior invalid rows are rejected. Capacity check times must be strictly increasing with positive finite capacities. A single final capacity check beyond the current profile can be capped only when the gap is ≤1800 s and final absolute current ≤1 mA. First-check capacity provides the normalization reference; nominal 16 Ah sets the EFC denominator. These repairs and conventions are separate from the empirical fitter. examples/oxford_energy_trading.py:25–54 examples/oxford_energy_trading.py:123–247

6. Temperature helper and browser proxy

The native helper returns

$$AF=\exp\left[\frac{E_a}{k_B}\left(\frac{1}{T_{\rm ref, K}}-\frac{1}{T_K}\right)\right],\qquad k_B=8.617333262\times10^{-5}\ \mathrm{eV/K},\quad T_K=T_C+273.15.$$

Default $T_{\rm ref}=25^\circ$C and Ea=.5E_a=.5 eV. It rejects nonfinite values and temperatures at/below absolute zero, and requires a finite positive result. Negative activation energy is allowed; the usual increasing-temperature acceleration interpretation assumes Ea>0E_a>0. Native fitted curves do not call this helper. The temperature plot explicitly scales an illustrative linear rate by AFAF, independently of fitting. bcla/core.py:539–566 bcla/viz.py:153–201

The browser instead uses kb=(fb/100000)exp((TC−25)/20)Crk_b=(f_b/100000)\exp((T_C-25)/20)\sqrt{C_r} and s(n)=exp(−kbn)s(n)=\exp(-k_bn) over a fixed 1000-cycle window. Its metrics are retention 100s100 s, capacity Q0,AhsQ_{0, Ah}s, resistance-growth proxy 200(1−s)200(1-s), and throughput 3.7Q0,Ah(1−s)/(1000kb)3.7Q_{0, Ah}(1-s)/(1000k_b) kWh. The last expression is the analytic integral of remaining capacity under the page's 3.7 V assumption. It does not solve an EOL threshold or fit observations. The base coefficient 18 does not mean exactly 18% loss at 1000 cycles: at default temperature/rate it gives about 83.527% retention. docs/index.html:183–189 docs/index.html:269–273

Canonical file: docs/math-and-physics/EQUATIONS_AND_DERIVATIONS.md · Back to guide navigation

Parameters, symbols and units

Native fitting coordinates

Symbol / code field Meaning and unit Source constraint/default
nn, cycles Cycle coordinate; may represent cycles or explicitly derived discharge EFC Finite, nonnegative for fitting; caller owns coordinate meaning
qq, capacity Capacity, normally normalized fraction Fitter does not normalize; Q0 bounds imply a scale near 1
Q0 Fitted capacity at coordinate zero, same unit as qq [.5, 1.5]; guess max observed capacity
k Linear fade per cycle/EFC [0, 1]; unit q/nq/n
α, β Power-law scale and exponent α [0, 5], unit q/nβq/n^\beta; β [.1, 2], dimensionless
a, b Logarithmic amplitude and inverse coordinate a [0, 1], unit qq; b [0, 100000], unit n−1n^{-1}
pcov Approximate parameter covariance matrix Registry parameter order; shape 2×2 or 3×3, mixed parameter units
rmse, r_squared Root mean square residual / explained-variance diagnostic RMSE in capacity units; R² dimensionless
validation_fraction Requested late observation-row fraction .2, in (0, 1); actual group-aware split can differ
split_cycle First held-out cycle coordinate Stored on ValidationScore with train_size and validation_size
eol_fraction Threshold divided by fitted initial capacity .8, in (0, 1)
current_cycle RUL reference coordinate Default maximum observed cycle; nonnegative finite
confidence, samples, random_state Bootstrap quantile coverage, replicate count, RNG seed .95, 500, None; explicit examples set seed 42

bcla/core.py:38–173 bcla/core.py:179–241 bcla/core.py:299–404 bcla/core.py:407–533

Experimental metadata and EFC

Field Unit / interpretation
time_s, query_time_s Seconds, measured range; query order is retained
current_a A; positive discharge, negative charge clipped at samples
nominal_capacity_ah Positive Ah; Oxford default 16 Ah
temperature_c °C metadata; loader requires finite values, not a physical temperature envelope
c_rate Nonnegative C-rate metadata; no automatic fitter coupling
rest_time_h, cycles_per_day Hours / observation-segment aggregate cycling rate
depth_of_discharge Fraction [0, 1]
energy_throughput_wh Nonnegative Wh metadata; distinct from discharge EFC
timestamp_iso, interval start/end ISO-parsed time strings; use a consistent timezone convention
interval_seconds Positive interval duration computed by history loader
schema_version, history schema Returned metadata tags, defaults "1" and "2"

bcla/datasets.py:74–203 bcla/datasets.py:352–576 bcla/datasets.py:746–923 examples/oxford_energy_trading.py:25–29

Separate temperature and browser inputs

The native arrhenius_acceleration_factor(temperature_c, reference_c=25.0, activation_ev=0.5) uses Celsius inputs converted to Kelvin and eV activation energy. Its Boltzmann constant is 8.617333262e-5 eV/K. bcla/core.py:539–566

Browser degradation input Default Accepted parameter range Unit
fadePer1000Pct 18 2–40, UI step 1 Displayed % / 1k cycles; exponential coefficient input
temperatureC 25 10–50, step 1 °C
cRate 1 .2–3, step .1 C
initialCapacityAh 100 10–200, step 5 Ah

The evaluator clamps finite numeric inputs to these bounds and substitutes defaults for missing/nonfinite values. UI steps do not quantize programmatic API values. Browser time clamps to 0–1000 cycles. These are display/model-domain limits, not experimentally validated cell operating limits. docs/index.html:183–189 docs/index.html:239–254

Canonical file: docs/math-and-physics/PARAMETERS_AND_SYMBOLS.md · Back to guide navigation

Assumptions, evidence and validity limits

What the implementation supports

This is an empirical curve-fitting and teaching package. Three bounded-parameter families can summarize a supplied capacity trace; chronological validation compares forward prediction on later observations from that trace; EOL/RUL is conditional on the chosen family, threshold and bounded extrapolation rule. Finite outputs and passed software tests do not establish chemistry calibration, operational safety or out-of-domain predictive accuracy. bcla/core.py:18–42 bcla/core.py:299–435

There is no electrochemical state, spatial thermal field, calendar-aging law, rainflow model, online estimator, pack balancing logic, SOC safety constraint or degradation coupling to the preserved duty-cycle metadata in the native fitter. The Arrhenius helper and temperature plot are separate illustrations. The source gives an empirical intercept, not measured physical initial/boundary conditions for an ODE or PDE. bcla/core.py:179–241 bcla/core.py:539–566 bcla/viz.py:153–201 bcla/datasets.py:746–923

Data and statistical assumptions

  • Synthetic fixtures: LFP/NMC labels identify seeded formulas with additive Gaussian noise and clipping; they do not constitute validated chemistry benchmarks. CSV examples are schema/demo data. bcla/datasets.py:17–71 README.md:185–188 data/cycle_metadata_example.csv:1–7
  • Observation scale: capacity normalization is a loader choice, not a fitter operation. The simple and long-form loaders use different reference observations. Preserve raw units, reference capacity and measurement protocol. bcla/datasets.py:653–743 bcla/datasets.py:893–923
  • Holdout scope: one chronological split within supplied observations neither groups multiple cells nor tests a genuinely independent final dataset. The model-selection score and full-data fit have different training histories. bcla/core.py:277–404
  • Residual bootstrap: resampling centered residuals assumes their exchangeability for this analysis. Serial dependence, heteroscedasticity, model-family uncertainty and protocol/measurement uncertainty require separate treatment. Bounds are withheld after any censored or failed replicate. bcla/core.py:407–533
  • Projection: the EOL window is a computational policy, not a demonstrated validity range. A None estimate means no supported crossing was returned. Direct project can extrapolate farther and return negative capacity. bcla/core.py:70–111
  • Timestamp/throughput convention: metadata is not automatically aligned to model parameters. EFC integrates the interpolant of clipped current samples, and Oxford preprocessing repairs/counts irregular times under explicit rules. bcla/datasets.py:108–203 examples/oxford_energy_trading.py:123–247

The Oxford adapter identifies an external measured dataset and its source-declared licensing, but this review downloaded no data. Its dated 2026-08-31 audit is preserved as a historical report. Offline fixture tests, native synthetic examples and current source inspection do not independently reproduce the measured-data table or establish present archive availability. docs/oxford-energy-trading.md:9–25 docs/oxford-energy-trading.md:83–112 tests/test_oxford_live.py:1–48

Software and presentation limits

The tested local environment was Python 3.12, not all declared supported versions or every possible dependency resolution. No complete native security scanner rebuild, vulnerability-database refresh, live PyPI installation, browser interaction, screen-reader audit or published deployment verification was performed by the author. The existing configured gates remain separate integration requirements. Verification ledger.

The browser uses a fixed synthetic 1000-cycle exponential proxy with its own temperature/rate formula, resistance-growth proxy and illustrative throughput. It does not ingest the native fitted parameters, data files or confidence intervals. Its eight passed checkpoint fixtures establish agreement with that implemented proxy at stated inputs. They do not validate field behavior or the nine other bundled model kinds. docs/index.html:155–189 docs/index.html:269–273 docs/index.html:469–491

Before expanding scientific claims, specify the intended population/protocol, coordinate definition, normalization, admissible domain, independent validation data, error metrics and uncertainty sources. The roadmap makes those proposed studies explicit; this documentation change does not implement them.

Canonical file: docs/math-and-physics/ASSUMPTIONS_AND_LIMITS.md · Back to guide navigation

Oxford grid-battery real-data example

Section 03 · Reproduce / parameters

This opt-in example applies the bcla workflow to the University of Oxford's energy-trading battery degradation dataset. The source contains one year of operation for six 16 Ah lithium-ion cells following three grid-trading control strategies, with per-cell current profiles and 13 capacity checks per cell.

The repository does not bundle, mirror, or relicense the dataset. The example downloads original files from the Oxford Research Archive at runtime. Each download is capped at 32 MiB before decoding; the largest official profile was 8.87 MiB during the 2026-08-31 audit. A larger response is rejected rather than read into memory without a bound.

  • Official dataset record: https://ora.ox.ac.uk/objects/uuid:9aae61af-2949-49f1-8ad5-6aea448979e5
  • Dataset DOI: 10.5287/bodleian:gJPdDzvP4
  • Data license: ODC Open Database License (ODbL) 1.0; individual contents are covered by the Database Contents License (DbCL) 1.0.

Run it

From an installed source checkout:

python examples/oxford_energy_trading.py --cell BMR_cell1

To save a diagnostic figure or disable the residual bootstrap:

python examples/oxford_energy_trading.py \
  --cell BMR_cell1 \
  --bootstrap-samples 0 \
  --output oxford_bmr_cell1.png

The six supported cell IDs are BMP_cell1, BMP_cell2, BMR_cell1, BMR_cell2, SPM_cell1, and SPM_cell2.

Converting measured current to EFC

The capacity files report profile_time_s and capacity_Ah; they do not report a laboratory cycle index. Relabeling elapsed time as cycle count would be misleading. The example instead aligns each capacity check with its cell's measured time_s,current_A profile and estimates cumulative discharge equivalent full cycles:

EFC(t) = integral(max(I(t), 0) dt) / (3600 * Q_nominal)

Positive current is discharge in the source data, negative current is charge, and Q_nominal is the stated 16 Ah cell capacity. Charging samples are clipped to zero before trapezoidal integration. The result is discharge-throughput EFC, not elapsed days, commanded cycles, or a count of laboratory charge/discharge procedures.

The official files contain a small number of duplicate or reversed profile-time rows. The example makes its repair observable: it stable-sorts profile time, averages current at identical timestamps, and prints the number of affected transitions and duplicate samples. Each final capacity check also trails the last near-zero-current sample by less than 1,004 seconds. The example caps that small tail to the last observation only when the gap is at most 1,800 seconds and the last absolute measured current is at most 1 mA; it prints the gap. Only that single final capacity check may be capped. Anything outside those conditions is rejected.

Saved figures relabel the horizontal axis as Measured Discharge EFC; they do not present this throughput estimate as a laboratory cycle count. Solid lines cover the observed window and dashed lines show only the bounded projection to EOL, or to the three-times-observed limit when EOL is unsupported. The console output states the chronological training/holdout sizes and reports bounded EOL, RUL, and bootstrap censoring diagnostics explicitly.

Live source audit

The following values were reproduced from the original ORA files on 2026-08-31 using the same canonicalization and integration code:

Cell Capacity checks Measured discharge EFC Final retention
BMP cell 1 13 412.37 97.53%
BMP cell 2 13 410.12 97.56%
BMR cell 1 13 1558.15 85.97%
BMR cell 2 13 1557.65 85.15%
SPM cell 1 13 689.23 98.35%
SPM cell 2 13 689.93 98.23%

The measured EFC is lower than an estimate from commanded schedules because the tester enforced voltage limits and entered constant-voltage operation when necessary. That is why the measured per-cell current files are primary here.

Interpretation limits

  • EFC integration is approximate because logging was irregular and samples were not guaranteed exactly at current transitions.
  • Thirteen monthly capacity checks provide a compact demonstration, not broad forecast validation or independent-cell cross-validation.
  • The 20% chronological holdout contains three observations. Report that small sample alongside every validation score.
  • Bounded EOL can be unsupported, and bootstrap replicates can be censored. The example prints those outcomes instead of dropping them.
  • The empirical fits do not model electrochemistry, cell safety, dispatch, or future protocol changes.

Citation

When using the data, follow the archive's attribution and ODbL/DbCL terms and cite the dataset:

Reniers, J. M., Mulder, G., and Howey, D. A. (2020). Oxford energy trading battery degradation dataset. University of Oxford.

The source readme also requests citation of the related work, including:

Reniers, J. M., Mulder, G., and Howey, D. A. "Improving optimal control of grid-connected lithium-ion batteries through more accurate battery and degradation modelling." Journal of Power Sources 379 (2018), 91-102. 10.1016/j.jpowsour.2018.01.004

Canonical file: docs/oxford-energy-trading.md · Back to guide navigation

Verification evidence ledger

Source under review: 02ed161bded286dad4b3624961430a564715c782, tree 47bb084efe6758920bd59101243400b9be9488a7. Review date: 2026-11-19. Source, local documentation candidate, eventual PR head, merge commit and deployed Pages revision are separate identities. This page reports author evidence; independent QA and provider delivery records must bind their own exact revisions.

Executed and inspected evidence

Check Observed result What it establishes
Complete source object inventory 183 entries: 152 blobs and 31 directories; all payload Git IDs verified Coverage accounting, not full semantic review of every asset/tool
Existing native pytest suite, Python 3.12 190 passed, 6 skipped, 13 subtests passed Actual local source tests; six Oxford live tests opted out
Existing browser CSP test suite 17 passed Policy/parser fixtures and source documents; no GUI interaction
Existing portfolio validator 4 learning paths validated Paths, canonical config agreement and selected SVG/structure
Native and Oxford --help Passed Parser/help execution; Oxford help downloads nothing
Quickstart API and CLI Passed; selected linear, 9/3 split, 50 successful bootstrap replicates Synthetic source fixture and output behavior
EFC interpolation example [.046875,.0625] at 450/900 s Clipped-sample convention for one explicit fixture
Exact notebook code cells 7 executed, 3 PNGs written externally Sequential Python cell execution; not Jupyter/Colab/frontend validation
Active browser degradation checkpoints 8 passed in Node Exact inline pure evaluator and configured fixtures; no DOM execution
Python interface extraction 36 native public declarations, 48 dataclass fields; 376 total declarations in 36 Python files Decorator-inclusive static source accounting; internal/tooling declarations remain distinguished
JavaScript extraction 9 parsed units, 65 declarations, 36 event registrations TypeScript 5.9.3 AST plus scoped controller review; dynamic DOM behavior remains unverified
Final documentation package checks Canonical paths, local links/fragments, CFF, source locators, renderer freshness, static HTML/CSP and authorized diff checked Documentation consistency on the local candidate; no external-link reachability or publication claim

Native tests and contracts are source-located in tests. The local command receipt retains the six explicit live skips; a skip is not a passed measured-data check. The native test output also includes an external pytest/AnyIO deprecation warning; it is preserved in the review log. tests/test_oxford_live.py:1–48 tests/test_notebook.py:1–50 tests/browser/csp.test.mjs:1–232

The initial external example harness referenced ModelSelection.train_size, which does not exist. The author corrected the harness to selection.validation_score.train_size after checking the source and reran it successfully. This was a verification-harness failure, not an application failure; the initial receipt remains retained. Source model/data/notebook bytes were unchanged. bcla/core.py:128–153

Provider evidence and unexecuted scope

The read-only exact-source check-run response contained 35 successful records, including repeated contexts from different runs. Statuses were empty. These are historical source-revision results, not candidate-head CI. Examples include CodeQL Python and Python quality tests. Complete observed pagination and raw responses are retained in the audit records.

Not executed by the author: live Oxford downloads, a fresh PyPI wheel installation, the full hosted security/coverage pipeline, native OpenGrep rebuild or vulnerability database audit, all supported Python versions, browser rendering/keyboard/screen-reader tests, release publishing, merge or deployed-site verification. Existing historical Oxford and release assertions remain dated source records.

Before integration, inspect the actual PR head and complete applicable protection settings; refresh checks, reviews and expected head immediately before merging. After merge, map Pages' deployment to the merged SHA and inspect the changed handbook route. A green older run, an open PR or a page returning HTTP 200 does not establish those outcomes. Delivery procedure.

Canonical file: docs/maintainer/VERIFICATION_EVIDENCE_LEDGER.md · Back to guide navigation

CI, release and existing publication

Configured workflows

The table describes the pinned YAML, not a list of checks known to be required by branch protection. Preserve job names, matrices, required contexts, tag coverage, security scans and environment gates. The repository instructions require a successful-run baseline before changing timeouts and measured Actions usage before claiming savings. This documentation package changes no workflow. AGENTS.md:1–3

Workflow Trigger / scope Jobs and declared caps
tests.yml All PRs; main pushes Python 3.11 and 3.12 matrix, 20 min; 3.12 enables Oxford live tests and renders a preview; artifact 14 days
hardened-ci.yml PR, main push, merge group, manual, Monday 06:23 UTC Five security modes: SAST 90 min, others 40 min; seven quality modes 60 min; artifacts 14 days
codeql.yml PR, main push, merge group, manual, Monday 07:47 UTC Python and JavaScript/TypeScript analysis, 45 min; SARIF gate
no-codex-attribution.yml PR, merge group, main pushes and all tags human-authorship-policy, 5 min; metadata/commit-message patterns
markdown-maintenance.yml Path-filtered Markdown/CFF PRs and main pushes; manual links, 30 min; Lychee checks README, CONTRIBUTING,docs/*.md
portfolio-dashboard-check.yml Path-filtered PRs/main pushes; all tag pushes validate, 5 min; no manual trigger
package-validation.yml PR changes to workflows, pyproject or bcla/** Build/Twine and isolated candidate-wheel smoke, 30 min; docs-only changes do not match
published-package-smoke.yml Manual or PR changing its own workflow Python 3.9/3.12 installed PyPI 0.3.0 smoke, 10 min
publish-pypi.yml v* tag pushes Test matrix 20 min → build 15 min → publishing 30 min with pypi environment/OIDC
deploy-dashboard.yml main pushes matching docs/assets/self; manual Validate 5 min → deploy 10 min,github-pages environment; raw docs/ upload

.github/workflows/tests.yml:1–65 .github/workflows/hardened-ci.yml:1–112 .github/workflows/codeql.yml:1–63 .github/workflows/no-codex-attribution.yml:1–103 .github/workflows/markdown-maintenance.yml:1–45 .github/workflows/portfolio-dashboard-check.yml:1–28 .github/workflows/package-validation.yml:1–59 .github/workflows/published-package-smoke.yml:1–70 .github/workflows/publish-pypi.yml:1–109 .github/workflows/deploy-dashboard.yml:1–90

GitHub does not apply path filters to tag pushes; the portfolio workflow's tag coverage is therefore broader than its branch paths. Official workflow syntax. The authorship job checks commit metadata strings; it does not establish human authorship or cryptographic signature validity. It reports offending commits/metadata and the checked count, not an echoed selected revision range. .github/workflows/no-codex-attribution.yml:45–103

The hardened Python quality target includes native and security-helper tests with branch coverage. Its numerical-core policy requires both line and branch coverage ≥95% for the declared bcla source set; the 190 local native tests are not a replacement for that full configured gate. Python lint is repository-wide Ruff, so the added documentation renderer must comply. .github/security/quality.json:7–21 .github/security/quality.py:59–125

Revision-aware integration

The 2026-11-19 metadata read observed protected main, an empty complete repository-ruleset response, and a 403 from classic branch-protection access. Empty rulesets do not establish absent classic requirements. The integration owner must inspect authorized settings and refresh them before merging; do not infer signature, review or status requirements from sibling repositories or admin permissions. Branch metadata · Rulesets.

  1. Bind the independently reviewed candidate tree to the actual commit and PR head; verify the remote diff contains only approved docs/navigation/build-helper changes.
  2. Resolve required checks and reviews against that head. If a synthetic merge/queue revision is used, record the mapped head and base. Preserve skipped, missing, failed and inaccessible outcomes explicitly.
  3. Refresh branch requirements, head/base and review state; merge only through the ordinary permitted route with an expected-head guard. Keep a concrete PR and blocker if a required gate is unresolved.
  4. Record the merged SHA separately from the original source/candidate identities. Documentation merge does not itself authorize or create a version tag or PyPI release.

Release identity drift

The source declares pyproject.toml version0.3.0, while bcla.__version__ is0.2.0 and the changelog still labels 0.3.0 “Pending release.” All are preserved. The observed GitHub release records are v0.2.0 and v0.1.0; a v0.3.0 tag points to 65df747ccf1ff0d2427ab8ba321b4c6839d0ad3b. pyproject.toml:5–10 bcla/init.py:15–15 CHANGELOG.md:5–17 GitHub releases · Tag refs.

The primary PyPI record identifies 0.3.0 artifacts uploaded 2026-10-08, with Trusted Publishing provenance for that same 65df747c… commit and publishing run 37781483550. This was metadata retrieval, not a new installation or audit of the distribution. Align version/changelog/runtime identity in a separate owner-reviewed release change; do not retag existing releases to disguise drift.

Pages publication and rollback

The workflow uploads the entire docs/ directory; it has no Jekyll build step despite the retained docs/_config.yml. Therefore docs/reference/index.html must already be regenerated in the reviewed commit. After deployment, inspect /battery-cycle-life-analyzer/reference/, its visible source/date, internal anchors and navigation from all three existing surfaces. Trace the deployment to the actual merged SHA. The author has not verified this candidate live. .github/workflows/deploy-dashboard.yml:61–90 docs/_config.yml:1–4

To recover a bad documentation release, prepare a scoped revert PR through the same gates, regenerate any affected derived HTML, and verify the resulting deployment identity. Do not delete history, force-push a protected branch or weaken settings. Archive the failed run and exact affected revision before retrying.

Canonical file: docs/maintainer/CI_CD_AND_RELEASE_PLAYBOOK.md · Back to guide navigation

Toolchain and dependency matrix

Layer Declared source contract Observed review / qualification
Python runtime ≥3.11 (classifiers for 3.11 and 3.12) 3.12.14 locally; hosted matrix is separate evidence
Scientific dependencies NumPy ≥1.21, SciPy ≥1.7, Matplotlib ≥3.5, Pillow ≥13.0.0 NumPy 2.3.5, SciPy 1.17.0, Matplotlib 3.10.8
Build setuptools≥77.0.3, wheel No fresh candidate wheel build/install by author
Package dev extra pytest 9.2.0 in external review environment
Development group Ruff 0.17.4, mypy 2.4.1, pytest 9.2.0, pytest-cov 7.1.0, Hypothesis 6.170.14, SciPy stubs 1.17.0.2 Distinct from .[dev]; full quality installation/gates not inferred from pytest alone
Browser tools Node ≥22; lockfile; ESLint 9.39.5, TypeScript 5.9.3, Prettier 3.9.10 and related packages Node pure-model/CSP checks executed; AST extraction used external TypeScript 5.9.3
Notebook nbformat 4.5 with Python 3.11 metadata; optional Colab bootstrap Seven source cells executed under3.12/Agg; no Jupyter frontend/Colab install
Documentation reading view Python standard library and Pandoc command Pandoc 3.1.11.1 used; renderer adds no application dependency
CFF validation Existing CFF 1.2.0 Official1.2.0 JSON schema; duplicate-key rejection and functioning URI/date-time formats
CI scanners Repository-pinned scanner inputs, hashes and source manifests Operational inventory retained; no fresh full scanner rebuild or vulnerability audit

pyproject.toml:1–17 pyproject.toml:51–86 package.json:1–28 build_notebook.py:264–279 CITATION.cff:1–16 .github/security/README.md:1–42

No new Python/npm application dependencies or lockfile changes accompany the handbook. The external review environment inherited scientific libraries and installed the declared pytest/Ruff versions; this is not a fully locked reconstruction of a hosted runner. Record actual resolved versions whenever publishing numerical outputs. CFF parsing used PyYAML's string-scalar mode for this string-valued record with duplicate-key rejection; that validation is not a general YAML 1.2 conformance claim.

The source maintains separate Python/scanner requirements and an npm lock. Dependabot config defines weekly groups, cooldowns and scoped update constraints. Treat those as declarations, not evidence that current dependencies are vulnerability-free. Update manifests/locks together and run the existing quality/security gates; preserve action SHA pinning and version compatibility. .github/dependabot.yml:1–82 AGENTS.md:1–3

make test runs native tests;make demo writes a CLI plot;make notebook executes through Jupyter;make clean deletes caches/build outputs. Each has different effects and prerequisites. Do not run generation/cleanup as an assumed read-only verification. Makefile:1–15

Canonical file: docs/maintainer/TOOLCHAIN_AND_DEPENDENCY_MATRIX.md · Back to guide navigation

Failure modes and source-backed technical debt

The following are observations and proposed follow-up work, not application fixes made by this documentation package. Roadmap IDs define acceptance and ownership.

Finding Consequence Current handling / proposal
Package/runtime/changelog release identity differs A version string alone cannot identify the analyzed code Pin source; BCLA-01 aligns metadata with an explicit release decision
Simple versus long-form normalization reference differs Unsorted input can change the scaling and comparability of results Document both references; preserve raw measurements; BCLA-02 adds explicit preprocessing contracts
Metadata history accepts independent rows without interval overlap/physical consistency checks Preserved context may be mistaken for validated aging exposure Keep metadata separate from model inputs; BCLA-02 proposes semantic validation
EFC clips samples before interpolation Zero-crossing intervals may differ from another integrator Report convention; BCLA-02 evaluates alternatives with explicit fixtures and compatibility policy
One holdout chooses the model; bootstrap fixes that family Reported error/interval omit selection and wider uncertainty State conditioning; BCLA-05 studies grouped/temporal validation and resampling
EOL grid bound and unrestricted project differ A finite extrapolation may look more authoritative than supported evidence Separate APIs; BCLA-05 evaluates domain-aware projection policies
External Oxford fetch lacks a retained immutable input receipt in this review Historical table is not a fresh reproduced measured-data result Keep dated attribution; BCLA-04 proposes input manifests and offline replay
Root/nested docs have incomplete Lychee coverage; rendering is manual Passing current links job does not cover the new handbook Local full checks; BCLA-03 proposes separately reviewed coverage/freshness CI
Historical catalog/source revisions remain embedded Readers can mistake old indexed materials for current native review Add dated current handbook navigation; BCLA-06 proposes a reproducible catalog refresh
Broad minimum scientific dependencies and separate quality tools Re-running on another environment can change numerical results or tool compatibility Record exact environment; BCLA-07 measures a compatible reproducibility matrix
Heavy security/native scanner operational surface Native test pass does not establish complete security-pipeline health Preserve receipts/gates; BCLA-07 measures actual provider costs without dropping checks
Single attributed owner; backup/recovery staffing undeclared Operational recovery relies on undocumented access knowledge Role-based recovery runbook; BCLA-08 assigns and exercises a second maintainer

pyproject.toml:5–17 bcla/init.py:15–15 CHANGELOG.md:5–17 bcla/datasets.py:108–203 bcla/datasets.py:352–576 bcla/datasets.py:653–923 bcla/core.py:70–111 bcla/core.py:299–533 examples/oxford_energy_trading.py:97–108 .github/workflows/markdown-maintenance.yml:39–45 docs/native-lessons.json:8–20 .github/security/quality.py:59–125 CITATION.cff:5–10

No CircleCI or Buildkite configuration appears in the complete pinned tree. The implemented provider is GitHub Actions; absent optional connectors do not block local documentation work. Required provider gates still need their actual current policy and revision evidence before integration.

Canonical file: docs/maintainer/FAILURE_MODES_AND_TECH_DEBT.md · Back to guide navigation

Documentation maintenance runbook

One canonical source

Edit Markdown, the existing CFF where separately authorized, and docs/reference/chapters.json. The handbook HTML is a generated snapshot. Do not maintain independent prose in docs/reference/index.html. The manifest records the full analyzed source SHA and review date; input hashes embedded in HTML cover chapters, renderer, manifest and CSS. Updating those metadata fields requires an actual source review, not only a date change.

python docs/reference/build_reference.py
python docs/reference/build_reference.py --check
node scripts/browser-csp.mjs --check
node --test tests/browser/csp.test.mjs
python scripts/portfolio/validate_guide.py
python -m ruff check docs/reference/build_reference.py
git diff --check

The renderer requires Pandoc on PATH, uses only Python's standard library, and writes one fixed output file. It rewrites links between included chapters into local anchors, keeps existing docs routes relative, and points repository source files outside docs/ to immutable GitHub URLs. Source-linked native signatures must include decorators as well as definitions. Check all path and fragment destinations after adding/renaming a heading or chapter.

Review sequence

  1. Start with a pinned source tree and a complete inventory. Identify changed scientific assumptions, API signatures, loaders, CLI behavior, tests, workflow events and existing publication routes.
  2. Update the smallest affected canonical pages with exact source line citations. Label inferred limitations, proposals, historic claims and actual executed outcomes separately.
  3. Run the affected existing checks. Keep source-only execution receipts tied to their original SHA/time; if a later docs-only candidate reuses them, show that their runtime inputs are unchanged. Regenerate the guide and validate its exact content, links, CSP, unique IDs and chapter anchors.
  4. Compare the entire candidate diff. Preserve application/scientific code, workflows, dependencies, results, notebook, license and existing citation content unless a separate change authorizes them.
  5. Obtain independent review of the exact candidate tree. After merge, bind deployment identity and inspect the live changed route; retain blockers and skipped work honestly.

Existing presentation and gate constraints

Keep the orange/cream/purple palette, readable content width, visible focus, skip link, responsive contents navigation, scrollable tables, native MathML and print styles. The reference view has no scripts or network data fetch. Its CSP follows the existing repository policy generator, with the policy meta tag first in head; do not weaken or remove it to make a build pass. Existing scripts, inline style hashes and config payloads on the three old surfaces remain unchanged by the navigation additions. scripts/browser-csp.mjs:1–40 scripts/browser-csp.mjs:95–225

The source link workflow currently checks only README, CONTRIBUTING and top-level docs/*.md. A new nested page is not covered merely because it triggers that workflow. Until a separately reviewed CI change broadens coverage, perform the complete local Markdown/HTML link and source-range check and retain its results. Pages uploads committed files directly, so freshness must be checked before commit. .github/workflows/markdown-maintenance.yml:39–45 .github/workflows/deploy-dashboard.yml:79–90

The existing Oxford guide and catalog are dated artifacts. Preserve useful historical content and annotate newer facts in the current handbook; avoid silently relabeling an old dataset audit or an old source revision. The notebook generator writes the notebook itself; a docs update must not regenerate it incidentally. docs/oxford-energy-trading.md:83–112 build_notebook.py:275–279

Canonical file: docs/maintainer/DOCS_MAINTENANCE_RUNBOOK.md · Back to guide navigation

Governance and scope

The repository is owned by mohammadrezwankhan; the existing citation and package metadata attribute the software to Mohammad Rezwan Khan. The tracked license is MIT. No backup maintainer, service-level agreement or formal governance committee is declared in the reviewed source. Roles below are a proposed operating arrangement, not invented appointments. CITATION.cff:1–16 pyproject.toml:18–20 LICENSE:1–21

Role Accountability
Repository owner / release maintainer Scope, access recovery, applicable protection settings, release approval and provenance
Scientific reviewer Model assumptions, units, preprocessing conventions, validation design and uncertainty claims
Contributor / documentation author Source-grounded change, exact evidence, reproducible examples and narrow diff
Independent reviewer Candidate-specific factual, interface, scientific and operational review
Integration owner Exact tree/commit mapping, current gates, expected-head merge and deployment verification

Scope of the software and this package

The native package implements empirical curve fitting, temporal family selection, bounded EOL/RUL estimates, residual bootstrap, loaders and plotting. The browser is a separate educational model. External measured-data validation, production BMS use, calibrated chemistry inference and safety certification are outside the evidence established here. The assumptions page is the claim boundary. bcla/core.py:18–42 bcla/core.py:299–435 docs/index.html:155–189

This change adds canonical documentation, a derived static reading view and small navigation links. It preserves native algorithms, tests, workflows, dependencies, notebook/data/results, license and existing citation metadata. Scientific/model/dependency/security-policy changes proposed by the roadmap require separate review and evidence.

The software's MIT license does not establish a license for external Oxford data. The adapter/walkthrough records that dataset's separate ODbL/DbCL attribution; preserve source provenance and verify applicable permissions before redistributing external data or derived material. No dataset was mirrored or newly licensed by this documentation work. docs/oxford-energy-trading.md:9–25

Change decisions and ownership evidence

Use ordinary PR review with an independently reviewable diff. Record the source SHA, what behavior or claim changes, validation evidence and any unresolved constraints. Operational policy comes from actual authorized GitHub settings, not assumptions from a sibling repository. Keep declared conventions, executed observations, historical records and proposed design decisions distinct. Decision index · CI/release procedure.

Assign a second maintainer and record authorized access/recovery ownership outside public docs before claiming reduced bus factor. Publish only information appropriate for this public repository; never place credentials, private measurements or private portfolio details in a public README, issue or roadmap.

Canonical file: docs/owner/GOVERNANCE_AND_SCOPE.md · Back to guide navigation

Recovery and continuity runbook

This is a proposed recovery procedure grounded in the existing package, workflows and publication route. A recovery exercise, named backup maintainer and recovery-time objective have not been established by this documentation review. pyproject.toml:5–58 .github/workflows/publish-pypi.yml:1–109 .github/workflows/deploy-dashboard.yml:61–90

Preserve the recoverable unit

Keep an authorized repository backup including Git refs/history, code, docs, tests, dependency manifests/locks, workflows, notebook and citation/license. Preserve release distributions with digests and their publishing source/run identities. Separately retain the actual applicable GitHub branch/environment settings and access ownership in a restricted operational record; do not put credentials or recovery codes in Git. External Oxford data needs its own source identity, retrieval date, digest, licensing record and preprocessing receipts if a study relies on it. examples/oxford_energy_trading.py:25–54 docs/oxford-energy-trading.md:9–25

Restore in evidence order

  1. Establish authorized access. The account/service owner restores access through existing recovery procedures. Preserve protection settings and environment requirements; do not bypass them to make a restoration appear successful.
  2. Choose the exact target. Record the desired source commit, release tag/distribution and documentation deployment independently. Resolve the version drift described in the release playbook before promising a particular installed version.
  3. Reconstruct locally. Clone the recorded source, provision an isolated environment, record resolved packages, and run native tests with live Oxford access off. Execute the synthetic quickstart and inspect actual outputs.
  4. Restore documentation. Verify canonical Markdown/CFF, regenerate the static reference, run local links/CSP/guide checks, and review the entire diff. The notebook and preview are separate generators; do not overwrite them incidentally.
  5. Revalidate hosted gates. Create a normal restoration/revert PR. Observe checks/reviews on its exact head and the current branch policy. Keep any unavailable required gate explicitly blocked.
  6. Restore public delivery. Merge with an expected-head guard; map the Pages deployment to that merge and inspect the visible handbook content and navigation. A PyPI recovery is a separate tagged release process with owner authorization and package provenance.

Setup, verification and publication supply commands and evidence boundaries.

When a result cannot be reproduced

Compare input bytes and preprocessing counts first, then source SHA, dependency versions, seed, model family, split, bootstrap settings and EOL horizon. A historical Oxford audit without its original input receipts cannot be relabeled as a new reproduction. Preserve failed/censored outcomes and record the missing material. Roll back erroneous docs by a scoped reviewed revert and verify its deployment; preserve the old evidence for diagnosis.

Roadmap BCLA-08 proposes a second-person clean-environment recovery exercise with explicit success/failure records and an owner-approved recovery-time target. No staffing or timing commitment is implied.

Canonical file: docs/owner/BUS_FACTOR_RECOVERY_RUNBOOK.md · Back to guide navigation

Portfolio integration

The current distribution depends on NumPy, SciPy and Matplotlib; it declares no runtime dependency on another portfolio repository. The interfaces for reuse are cycle/capacity arrays, explicitly described CSV/history records, fitted results and reproducible evidence. Do not pass a browser proxy output into a scientific workflow as measured data. pyproject.toml:13–17 bcla/datasets.py:74–107 bcla/core.py:57–173

Proposed public integration Required contract before implementation
Battery thermal notes Treat a thermal trajectory as explicit exposure metadata first. A calibrated temperature-dependent aging law, units and validation dataset would be separate work; the current fitter does not consume it.
Battery power models Define current sign, sampling/interpolation, nominal Ah and usable capacity before converting a profile to discharge EFC. Keep power simulation, measured data and empirical aging validation separate.
Voltrl An economic degradation term must not be presented as a calibrated physical lifetime model merely because both involve batteries. Define independent units, calibration and comparison objectives before any coupling.
Shared documentation practice Reuse source inventory, exact-revision evidence, CFF validation and a canonical-Markdown rendering pattern. Keep each repository's actual CI/security policy and scientific contract independent.

These rows are proposals, not implemented dependencies or claims that one repository validates another. Cycle-life's current side of the boundary is explicit in its independent Arrhenius helper, empirical fitter, EFC convention and metadata-only loader. bcla/core.py:179–241 bcla/core.py:539–566 bcla/datasets.py:108–203 bcla/datasets.py:746–923

For a shared study, define a versioned input/output schema and immutable source commits; retain raw inputs, units, transformations, licenses, expected failure cases and separate native/browser provenance. Require tests at the boundary and an independent measured-data validation plan before extending claims. The current synthetic fixture labels are not a cross-project benchmark. Roadmap distinguishes reusable documentation work from exploratory scientific coupling.

This public document includes only public project references. Operational inventories and any private research material remain in appropriately restricted records, outside public portfolio synthesis.

Canonical file: docs/owner/PORTFOLIO_INTEGRATION.md · Back to guide navigation

Architecture decision index

This index records source-observed choices and proposed decisions. It does not invent historical approval dates or claim that formal ADRs existed before this handbook.

Record Status at the reviewed source Evidence / decision boundary
OBS-01: three empirical curve families Implemented Registry formulas, parameter order and bounds; adding a family affects validation minima, result interpretation and plotting. bcla/core.py:18–53 bcla/viz.py:128–150
OBS-02: chronological selection, then full-data refit Implemented Duplicate cycle groups stay together; holdout selects the family; fitting all observations is a distinct stage. bcla/core.py:277–404
OBS-03: bounded grid EOL and strict bootstrap availability Implemented 100000-point search to 3× maximum observed cycle; no interval after any censor/failure. bcla/core.py:86–111 bcla/core.py:407–533
OBS-04: separate metadata and numerical fitting Implemented Long-form history is retained and summarized but not passed as model regressors. bcla/datasets.py:746–923 bcla/core.py:179–241
OBS-05: discharge-only sampled-current integration Implemented Clip samples before interpolation; caller supplies nominal Ah and timestamp basis. bcla/datasets.py:108–203
OBS-06: browser teaching proxy and source-linked guide Implemented Offline JavaScript model and local personal learning state; no native engine execution. docs/index.html:155–189 docs/portfolio/index.html:255–286
DOC-01: canonical Markdown with derived static reference Proposed by this documentation change Fixed source/date/manifest, reproducible renderer, existing navigation/style and CSP preserved; independent QA/integration required.
PRO-01: release identity reconciliation Proposed, BCLA-01 Align package/runtime/changelog/tag/distribution identity through a separately reviewed release decision.
PRO-02: uncertainty and data-contract expansion Proposed, BCLA-02/BCLA-04/BCLA-05/BCLA-09 Decide backward compatibility, measured-data provenance and statistical assumptions before adding behavior.

For a future accepted ADR, include the problem, alternatives, scientific/operational consequences, explicit owner decision, source/evidence links, compatibility/migration plan and verification criteria. Supersede a decision with a new record; preserve the earlier rationale and its applicable revision. Link each implementation PR and resulting release separately from the proposal date.

Canonical file: docs/owner/ADR/ADR-0000-INDEX.md · Back to guide navigation

Twelve-calendar-month development roadmap

Proposed window: 2026-11-19 through 2027-11-18 inclusive (end-exclusive 2027-11-19). Dates, effort and role assignments are planning estimates, not funded or staffed commitments. This documentation package implements none of the application, workflow, dependency or scientific changes below.

Now covers 2026-11-19–12-31; Next covers 2027 Q1; Later covers 2027 Q2; Horizon covers 2027-07-01–11-18. Effort is focused person-days, not elapsed delivery time. Each item retains evidence, dependency, uncertainty and verification requirements.

Now

BCLA-01 — One unambiguous identity for installed code and release records.

Correctness / release integrity · P1 · Proposed 2026-11-19–2026-12-31.

Reconcile pyproject, runtime version and changelog with the existing tag/distribution provenance; add a packaging identity check through a separate release PR.

Evidence: pyproject.toml:5–10 bcla/init.py:15–15 CHANGELOG.md:5–17 .github/workflows/publish-pypi.yml:55–78

Owner role: Release maintainer with independent reviewer. Dependencies: None. Effort: 1–3 person-days. Confidence: High.

Risks: Changing a public version field or release narrative can misidentify historical distributions. Unresolved assumptions: Owner chooses the intended next release and compatibility policy; existing tags remain intact.

Acceptance criteria:

  • Installed distribution metadata and runtime version agree for a newly tested release candidate.
  • Changelog distinguishes already published artifacts from future changes and cites the publishing source/run.

Verification: Build and install the candidate wheel outside its checkout; inspect version fields and provenance; run existing package gates.

BCLA-02 — Explicit preprocessing and time/throughput conventions.

Correctness / data contracts · P1 · Proposed 2026-11-19–2026-12-31.

Design backward-compatible normalization-reference and EFC interpolation contracts; evaluate timezone, interval overlap and metadata consistency validation with fixtures before changing defaults.

Evidence: bcla/datasets.py:108–203 bcla/datasets.py:352–576 bcla/datasets.py:653–923

Owner role: Data-interface maintainer and scientific reviewer. Dependencies: None. Effort: 4–7 person-days. Confidence: Medium.

Risks: Changing normalization or zero-crossing integration silently changes existing numerical results. Unresolved assumptions: Expected input time basis and compatibility requirements can be agreed by users.

Acceptance criteria:

  • Examples cover unsorted normalization, duplicate/aware/naive timestamps, interval overlap and signed-current zero crossings.
  • Any proposed alternate convention is explicit and legacy behavior has a migration decision.

Verification: Review numerical fixtures against independent hand calculations; run loader/EFC/domain tests and document compatibility results.

BCLA-03 — All canonical documentation receives repeatable local and hosted coverage.

Maintainability / documentation verification · P1 · Proposed 2026-11-19–2026-12-31.

Propose an ordinary CI change for nested Markdown/CFF links, source locator/decorator checks and deterministic handbook freshness while retaining existing jobs and CSP gates.

Evidence: .github/workflows/markdown-maintenance.yml:39–45 .github/workflows/deploy-dashboard.yml:79–90 scripts/browser-csp.mjs:247–286

Owner role: Documentation maintainer with CI reviewer. Dependencies: None. Effort: 2–4 person-days. Confidence: High.

Risks: Unpinned renderer behavior or broad network link checks may be flaky or expensive. Unresolved assumptions: A supported pinned rendering environment and network-link policy can be selected.

Acceptance criteria:

  • An intentionally broken nested link and stale generated guide each fail a focused check.
  • Existing required contexts, matrices, release/tag coverage and CSP remain intact.

Verification: Exercise positive/negative docs fixtures and observe a candidate-head Actions run before merging.

Next

BCLA-04 — A measured-data study can be replayed from explicitly identified inputs.

Reproducibility / measured-data provenance · P1 · Proposed 2027-01-01–2027-03-31.

Add an owner-approved Oxford input receipt/cache design with raw digests, archive/license metadata and canonicalization counts; define offline replay separately from opt-in live availability checks.

Evidence: examples/oxford_energy_trading.py:25–108 examples/oxford_energy_trading.py:123–257 docs/oxford-energy-trading.md:83–112 tests/test_oxford_live.py:1–48

Owner role: Data steward and scientific reviewer. Dependencies: BCLA-02. Effort: 4–8 person-days. Confidence: Medium.

Risks: Archive access or licensing/redistribution constraints may limit replayable materials. Unresolved assumptions: Permitted retention/redistribution and source stability are confirmed before mirroring.

Acceptance criteria:

  • Every reported result identifies raw inputs, source version, preprocessing policy and EFC denominator.
  • Offline replay and live-fetch status have separate, reproducible pass/failure records.

Verification: Reproduce a selected cell from authorized frozen inputs in a clean environment and compare transformations/metrics with tolerances.

BCLA-05 — Evaluate uncertainty and selection beyond one conditional residual bootstrap.

Scientific validity / uncertainty · P1 · Proposed 2027-01-01–2027-03-31.

Design grouped/rolling validation, residual-dependence diagnostics and model-selection uncertainty studies; compare explicit EOL horizon/root policies while preserving unavailable/censored outcomes.

Evidence: bcla/core.py:70–111 bcla/core.py:277–404 bcla/core.py:407–533

Owner role: Statistical/scientific reviewer. Dependencies: BCLA-02, BCLA-04. Effort: 8–15 person-days. Confidence: Medium.

Risks: Sparse capacity checks and nonstationarity may not support precise intervals or model comparisons. Unresolved assumptions: There are enough independent cells/protocols and observations to identify the proposed validation design.

Acceptance criteria:

  • Study separates selection holdout from untouched evaluation and reports sample/group counts.
  • Coverage/censor/failure behavior is measured on known synthetic scenarios and suitable independent data; null results remain reportable.

Verification: Review a preregistered analysis protocol, independent implementations/fixtures where feasible, and out-of-sample error/interval coverage summaries.

BCLA-06 — Existing learning routes expose the current native-source guide without provenance ambiguity.

Usability / source provenance · P2 · Proposed 2027-01-01–2027-03-31.

Design a reproducible native-catalog/portfolio refresh with clear historic versus current revisions and explicit separation of browser proxy parameters from native fits.

Evidence: docs/native-lessons.json:8–20 docs/portfolio/lesson-config.json:16–18 docs/index.html:183–189 docs/index.html:469–491

Owner role: Documentation/presentation maintainer. Dependencies: BCLA-03. Effort: 3–6 person-days. Confidence: High.

Risks: Rewriting embedded configuration can invalidate CSP hashes or personal-note storage keys. Unresolved assumptions: A versioned migration policy preserves existing links and learning records.

Acceptance criteria:

  • Generated catalog links bind to their declared source revision and retain historical context.
  • Keyboard, reduced-motion, export and small-screen behavior are reviewed through an actual browser.

Verification: Regenerate deterministically, run existing guide/CSP checks, compare old/new state contracts and perform independent browser checks.

Later

BCLA-07 — Measured reproducibility and CI cost data support future toolchain decisions.

Maintainability / CI economics · P2 · Proposed 2027-04-01–2027-06-30.

Record a scientific environment matrix and successful provider-run timing baselines, then evaluate dependency bounds, caching and duplicate-event opportunities without dropping validation.

Evidence: pyproject.toml:13–17 pyproject.toml:60–86 .github/workflows/tests.yml:16–65 .github/workflows/hardened-ci.yml:19–112 AGENTS.md:1–3

Owner role: Maintainer and CI owner. Dependencies: BCLA-01, BCLA-03. Effort: 4–8 person-days. Confidence: Medium.

Risks: Native scanner builds, network data and runner changes can dominate timings; tighter bounds can exclude supported users. Unresolved assumptions: Actions usage and comparable successful-run telemetry are available.

Acceptance criteria:

  • A recorded baseline names run, job, source, duration and cap before any timeout proposal.
  • Any claimed savings use before/after measured usage and preserve required contexts, matrices, scans, tag coverage and environments.

Verification: Re-run comparable revisions/environments, report variation and retained gate coverage, and review any separate workflow/lock change.

BCLA-08 — A second authorized maintainer can recover code, evidence and delivery.

Governance / recovery · P2 · Proposed 2027-04-01–2027-06-30.

Assign backup ownership, document restricted access/recovery custody and rehearse a clean-environment restoration with source/distribution/Pages identities kept separate.

Evidence: CITATION.cff:5–10 .github/workflows/publish-pypi.yml:87–109 .github/workflows/deploy-dashboard.yml:61–90

Owner role: Repository owner and designated backup maintainer. Dependencies: BCLA-01, BCLA-03, BCLA-04. Effort: 2–5 person-days. Confidence: Medium.

Risks: Account, environment or data access may remain concentrated with one owner. Unresolved assumptions: A backup maintainer accepts the role and authorized recovery paths are available.

Acceptance criteria:

  • A second person reproduces the chosen source and handbook from retained records.
  • The exercise logs failures and recovery time without bypassing protections or exposing secrets.

Verification: Independent witnessed recovery drill, gate/deployment identity check and owner approval of residual risks and target recovery time.

Horizon

BCLA-09 — Determine what additional physical/operating claims independent evidence can support.

Exploratory research / validation · P3 · Proposed 2027-07-01–2027-11-18.

Design a separately versioned measured-cell study across controlled conditions; evaluate whether metadata/thermal exposure or richer models improve prediction with explicit units, baselines and uncertainty.

Evidence: bcla/core.py:18–42 bcla/core.py:539–566 bcla/datasets.py:746–923 docs/index.html:183–189

Owner role: Scientific owner with independent domain/data reviewers. Dependencies: BCLA-04, BCLA-05, BCLA-07, BCLA-08. Effort: 10–20 person-days for study design and pilot, not full validation/certification. Confidence: Low.

Risks: Data scarcity, confounding, protocol shifts and parameter non-identifiability may prevent stronger claims. Unresolved assumptions: Lawfully usable independent measured data and qualified domain review become available.

Acceptance criteria:

  • Protocol states target population, coordinate/units, held-out groups, baselines and uncertainty before fitting.
  • Pilot distinguishes synthetic teaching, empirical calibration and independent validation, and publishes limitations or null outcomes.

Verification: Independent protocol review and reproducible pilot with fixed input receipts, untouched evaluation data and explicit claim boundaries.

Canonical file: ROADMAP.md · Back to guide navigation

Changelog

All notable changes to this project are documented in this file.

[Unreleased]

[0.3.1] - Pending release

Package and plotting fixes

  • Require Python 3.11 or newer and Pillow 13.0.0 or newer for every installation.
  • Keep deeply degraded capacity observations and low custom end-of-life thresholds visible in capacity plots.

Scientific hardening audit (2026-11-21)

  • Solve bounded EOL crossings with continuous root finding instead of discretized scan.
  • Harden normalized-capacity fitting, finite solver results and covariance, distinct cycles, and chronological input shapes.
  • Reject negative physical cycle/capacity observations in CSV and long-form loaders.
  • Give actionable CLI errors for invalid inputs and write figures with atomic replacement.
  • Keep the runtime version aligned with the distribution metadata.
  • Add adversarial regression coverage and audit evidence under audit/2026-11-21/.
  • Second-pass hardening: reject incompatible timestamp awareness and non-finite long-form normalized values; block negative late holdout capacity; surface Q0/power-law beta fitted constraint warnings; reject manually constructed EOL results with invalid degradation parameters.
  • Preserve cell-level duty-cycle history provenance when cell/experiment identifiers contain the delimiter: escape individual key components and verify distinct envelopes with an adversarial regression.
  • Independently recheck four Oxford measured cells against their source archive without redistributing licensed measurements; leave two large BMR cells and cross-browser accessibility explicitly unverified.

[0.3.0] - 2026-10-08 (published distribution; see release note)

The date is recorded in the maintainer release playbook as the PyPI 0.3.0 distribution upload; GitHub currently has a v0.3.0 tag but no matching published GitHub Release object. Editing this note does not re-tag, republish, or deploy anything.

Added

  • Discharge equivalent-full-cycle integration for measured current time series, including partial-interval queries and strict input validation.
  • An opt-in Oxford grid-battery real-data example with ODbL attribution, measured-profile canonicalization diagnostics, and bounded EOL reporting.

[0.2.0] - 2026-08-26

Added

  • Chronological late-cycle holdout scoring and validation-based model selection.
  • Residual-bootstrap EOL/RUL intervals with bounded-projection censoring and fit-failure reporting.
  • Optional version-2 timestamped duty-cycle history with interval validation, operating-context preservation, and a synthetic example.

Changed

  • The multi-model CLI now uses validation-based selection by default; explicit in-sample RMSE selection remains available for compatibility and diagnostics.
  • Temporal validation now keeps duplicate cycle indices together, rejects underidentified splits, and requires non-negative cycle indices.
  • Bootstrap bounds are withheld after any censoring or fit failure and require residual degrees of freedom plus positive residual variance.

[0.1.0] - 2026-07-25

Added

  • Linear, power-law, and logarithmic battery capacity-fade models.
  • RMSE and R-squared diagnostics with lowest-RMSE model selection.
  • Bounded end-of-life projection with an explicit unsupported-result path.
  • Synthetic LFP and NMC demonstration datasets.
  • CSV/TSV import for cycle-capacity data with normalization and validation.
  • Provenance-aware long-form cycling data with validation-envelope metadata.
  • Arrhenius temperature acceleration comparison.
  • Publication-ready Matplotlib visualizations.
  • Command-line interface and Colab demonstration notebook.
  • Tests across Python 3.9, 3.10, 3.11, and 3.12.
  • MIT license and contributor guidance.

Documentation snapshot — 2026-11-19

This documentation-only package adds a canonical developer/scientific/maintainer/owner handbook, source/interface accounting, a reproducible static reading view, existing-site navigation and a proposed twelve-calendar-month roadmap. Native numerical code, workflows, dependencies, notebook/data/results, license and citation content are preserved.

This entry does not announce a software release or certify a deployment. Existing release headings above remain historical source text. The release playbook records the observed difference between package/runtime/changelog and published artifact identities.

Canonical file: CHANGELOG.md · Back to guide navigation

Citation metadata

Existing CFF, preserved verbatim:

cff-version: 1.2.0
message: "If you use Battery Cycle-Life Analyzer in research or teaching, please cite this software."
type: software
title: "Battery Cycle-Life Analyzer"
authors:
  - family-names: Khan
    given-names: Mohammad Rezwan
    orcid: "https://orcid.org/0000-0002-1532-0598"
repository-code: "https://github.com/mohammadrezwankhan/battery-cycle-life-analyzer"
url: "https://github.com/mohammadrezwankhan/battery-cycle-life-analyzer"
license: MIT
keywords:
  - battery degradation
  - cycle life
  - remaining useful life
  - capacity fade

Canonical file: CITATION.cff · Back to guide navigation

Security and responsible reporting

This repository provides local scientific tooling and static teaching pages. Its model results are empirical/synthetic under documented assumptions; no BMS, pack-protection or operational safety assurance is established by passing software checks. Scientific limits.

Reporting

For a suspected vulnerability, use the repository's private security-advisory reporting route if it is enabled, or arrange a private channel with the repository owner before sharing sensitive detail. No dedicated security inbox, response SLA or supported-version policy is declared in the pinned source; do not treat a package author's no-reply address as a monitored incident inbox. The owner identity is available in the existing citation metadata and repository.

A useful report includes the affected immutable revision, component, minimal permitted reproduction, impact, actual output and relevant environment. Keep credentials, unpublished measurements and exploit-sensitive data out of public issues. Ordinary numerical questions and documentation defects can use a public issue with non-sensitive fixtures.

Source-defined boundaries

The repository configures hardened security/quality workflows, CodeQL and a browser CSP checker. Configuration and historical success are not a current security certification. Retain actual scanner reports, source identity and failure evidence, and follow the complete applicable merge policy. Maintainer playbook. .github/workflows/hardened-ci.yml:1–112 .github/workflows/codeql.yml:1–63

Software licensing and external dataset licensing remain separate; preserve the source's Oxford attribution and verify rights before redistributing external measurements. docs/oxford-energy-trading.md:9–25

Canonical file: SECURITY.md · Back to guide navigation

Contributing

Thank you for helping improve Battery Cycle-Life Analyzer. Focused changes that make the models easier to inspect, validate, or use with real cycling data are especially welcome.

Before you start

  • Search existing issues and pull requests before opening a duplicate.
  • Open an issue before a large API change or a new degradation-model family.
  • Do not include confidential, proprietary, or personally identifiable data.
  • Only contribute datasets that you have the right to redistribute, and document their source, chemistry, protocol, units, and license.

Development setup

Fork and clone the repository, then create an isolated environment:

python -m venv .venv

Activate it on Linux or macOS:

source .venv/bin/activate

Or on Windows PowerShell:

.\.venv\Scripts\Activate.ps1

Install the project and development dependencies:

python -m pip install --upgrade pip
python -m pip install -e ".[dev]"

Make a focused change

  1. Create a branch from the latest main.
  2. Keep model equations, bounds, assumptions, and units explicit.
  3. Add or update tests for behavioral changes.
  4. Update the README or docstrings when the public API or interpretation changes.
  5. Avoid committing generated figures, build artifacts, or private datasets unless they are intentionally part of the documentation.

Verify the change

Run the complete test suite:

python -m pytest -v

For changes that affect the command-line demo, also run:

python -m bcla --model all

The GitHub Actions workflow repeats the tests on all supported Python versions.

To regenerate the README and Pages comparison preview from the same 1,000-cycle synthetic NMC example (seed 7), run:

python -m examples.render_model_preview

Inspect docs/model_comparison_preview.png before committing a visual change. The Python 3.12 CI job also uploads this render as the model-comparison-preview artifact for review.

Pull requests

In the pull-request description, explain:

  • the engineering or user problem being addressed;
  • the chosen approach and any new assumptions;
  • how the result was verified;
  • any compatibility, numerical, or data-provenance considerations.

Keep pull requests small enough to review. Maintainers may ask that unrelated changes be split into separate submissions.

Reporting problems

For numerical or model-fitting problems, include a minimal reproducible example with:

  • Python and dependency versions;
  • the selected model and parameter settings;
  • a small non-confidential data sample or synthetic reproducer;
  • expected and observed behavior;
  • the complete error message, if applicable.

Please do not use the issue tracker for battery-safety decisions. Consult a qualified battery engineer and the cell manufacturer's documentation for safety-critical work.

Maintaining the reference handbook

Use the documentation runbook for source citations, canonical Markdown, the derived static reading view and complete link/CSP checks. Follow the API contracts, scientific limits and verification ledger when changing claims or examples. Keep native code, notebook outputs, dependencies and release metadata out of an unrelated documentation change.

The roadmap contains proposals with acceptance criteria, not preapproved application changes. The governance page defines review roles without inventing staffing or historical approvals.

Canonical file: CONTRIBUTING.md · Back to guide navigation