Skip to main content

Battery Feature Lab

Version Python License

Battery Feature Lab (BFL) is a Python framework for the analysis of battery time-series measurements and electrochemical impedance spectroscopy (EIS) data. It represents measurement conditions (Operation), observed and model-derived responses (Response), and changes across observations that meet explicit comparability criteria (Evolution).

The framework produces machine-readable analysis records with traceable source references, processing provenance, method configurations, quality diagnostics, and interpretation limits. Time-series and EIS measurements are processed through distinct analysis interfaces and output schemas. For EIS, the framework retains measured spectra, evaluates linear Kramers–Kronig consistency, and estimates equivalent-circuit parameters with explicit convergence diagnostics. Parameter uncertainty, stability, and identifiability remain unassessed in the current release; numerical fit quality alone does not establish a physical interpretation.

Outputs are provided as JSON and Parquet for downstream analytical workflows and evidence-informed data reuse.

How BFL is organised

BFL analyses measurements along three complementary, capability-gated dimensions. This diagram shows conceptual and data dependencies, not the compiler's execution order or a requirement that every dimension produce an applicable result. Metadata provides context, while evidence and validation make each result traceable and define its interpretation limits.

Battery Feature Lab organisation diagram

The editable Mermaid source is retained alongside the static SVG.

Raw files are standardized by Battery Data Steward (BDS). Existing formal Battery Data Format (BDF) artifacts may instead use the optional batterydf adapter. Both routes produce the same internal quantity names and retain their provider-native report; neither route silently falls back to the other after a provider error.

BDS distribution migration

The source dependency now uses battery-data-steward>=0.7.0,<0.8; uv.lock records the artifact hash of the resolved wheel. BDS 0.7.0 renamed its Python package from battery_data_standard to battery_data_steward and no longer ships the old one; BFL imports the new package. Earlier BFL releases pinned BDS 0.6.x (BFL 0.9.0), 0.5.x (0.8.0) and 0.4.x (0.7.1, the first to use the renamed distribution); releases before 0.7.1 used the retired battery-data-standard distribution.

Use a fresh virtual environment when upgrading from a BFL release that depends on battery-data-standard. That retired distribution and battery-data-steward both install the bds module, so BFL refuses to run while battery-data-standard is installed. Recreate the environment; uninstalling only one can remove shared files.

import bds, --input-adapter bds and the conversion report filenames are unchanged. Reports record the installed distribution and version, and the export_format identifier BDS writes (battery-data-steward-export-v1 from BDS 0.7.0). Historical example outputs retain their original provider identity. See migration validation for the compatibility evidence.

Quick start

Battery Feature Lab 0.10.0 supports Python 3.11 and 3.12.

python -m pip install "battery-feature-lab==0.10.0"

For EIS analysis, install the optional providers:

python -m pip install "battery-feature-lab[eis]==0.10.0"

Analyze a raw cycler export:

import bfl

result = bfl.analyze(
    "cell.xlsx",
    output_dir="bfl_outputs/cell",
    input_adapter="bds",
    nominal_capacity_ah=None,
    temperature_column=None,
)

for path in result.files:
    print(path)

Equivalent CLI:

bfl analyze cell.xlsx --output-dir bfl_outputs/cell --input-adapter bds

For native formal-BDF input, install "battery-feature-lab[bdf]==0.10.0" and use input_adapter="bdf". The optional OpenAI notebook client is available through "battery-feature-lab[ai]==0.10.0".

Output contract

Every successful run writes exactly six artifacts. The provider report filename depends on the selected input adapter.

normalized_data.bdf.parquet
bds_conversion_report.json       # BDS input
# or bdf_validation_report.json  # formal-BDF input
analysis_metadata.json
analysis_results.json
analysis_evidence.json
analysis_validation.json

Start with analysis_results.json. It is a compact index over Operation, Response, and Evolution. Resolve a record_id in analysis_evidence.json only when source intervals, full series, method parameters, references, or detailed quality evidence are needed.

Serialized provenance uses portable artifact filenames plus SHA-256 digests. Host-local absolute paths are never written to the public JSON contract; configuration.output_dir is represented as .. The AnalysisResult Python object still returns the actual runtime paths.

import json
from pathlib import Path

root = Path("bfl_outputs/cell")
summary = json.loads((root / "analysis_results.json").read_text(encoding="utf-8"))
evidence = json.loads((root / "analysis_evidence.json").read_text(encoding="utf-8"))

record_id = summary["dimensions"]["operation"][0]["record_id"]
record = next(item for item in evidence["records"] if item["record_id"] == record_id)

Progressive capability

BFL does not require every dataset to contain every battery channel.

Available measurements Analysis that can be added
time + current phase, current-shape mode, duration-weighted current exposure, Ah throughput, current-squared exposure
+ voltage power and energy, current-step response, paired capacity profiles, per-segment capacity–voltage curves with a stated error bound, eligible pulse/ICA/DVA and cycle analyses
+ temperature thermal envelope, rest temperature response, temperature comparability gates
+ wall clock wall-clock time that the test clock did not count inside each rest (for example, a suspended test)
+ source accumulators per-segment reconciliation of the integrated current and power with the cycler's own capacity and energy counters
+ trustworthy cycle identity structurally gated cycle summaries and comparable-capacity evolution
+ nominal/reference capacity C-rate and grounded SOC-dependent provider paths where other gates also pass

Missing optional channels produce explicit not_computable metrics and not_invoked provider calls. BFL never creates a voltage channel, assumes a sampling rate, or promotes a filename token into cell metadata.

Scientific boundaries

  • Operation labels are limited to constant_current_like, constant_voltage_like, pulse_like, dynamic_current, and unmatched. BFL does not infer a named protocol.
  • Current-step delta-V/delta-I is an apparent terminal response, not intrinsic resistance or SOH.
  • Relaxation checkpoints are terminal-voltage recovery, not equilibrium OCV.
  • A capacity-aligned coordinate is not SOC unless an explicit reference establishes it.
  • Capacity evolution requires source or joined cycle identity, structural completeness, and a comparable operation signature. A short test does not support ageing or lifetime claims.
  • Metadata fields remain unknown when neither the preprocessing provider nor the caller supplies them.

Documentation

EIS

Install battery-feature-lab[eis]==0.10.0 and use bfl.analyze_eis() or bfl analyze-eis. The independent EIS path combines BDS-backed intake, explicit spectrum grouping, measurement conditions, Lin-KK consistency checks, eisfit 0.2.0 circuit fitting and condition-gated comparisons. It retains source rows, conversion operations, provider failures and interpretation limits in a modality-specific six-artifact contract.

See EIS analysis and evidence for the input declarations, comparison policy, dependency compatibility and output schemas.

Two worked examples are indexed in examples/README.md:

Source data comes from the cited CC BY 4.0 datasets and is intentionally not tracked here, nor are normalized time-series or spectrum arrays.

Development

git clone https://github.com/shiyunliu-battery/Battery-Feature-Lab.git
cd Battery-Feature-Lab
uv sync --python 3.12 --extra dev --extra ai --extra eis
uv run ruff check .
uv run pytest -q

Real-data validation instructions are kept in tests/data/real/README.md.

main is the only branch. To release, update the version in pyproject.toml, CITATION.cff and the documentation, add a ## <version> section to CHANGELOG.md, run uv lock and uv sync so the installed metadata matches, push main, and after CI passes push the tag v<version>. The tag publishes to PyPI and creates a GitHub release whose notes are that changelog section.

Citation

If Battery Feature Lab supports your work, please cite the software:

@software{liu_2026_battery_feature_lab,
  author  = {Liu, Shiyun},
  title   = {Battery Feature Lab},
  year    = {2026},
  version = {0.10.0},
  url     = {https://github.com/shiyunliu-battery/Battery-Feature-Lab},
  license = {MPL-2.0}
}

GitHub can also generate citation formats from CITATION.cff. The example datasets remain separately licensed under CC BY 4.0 and must retain their original citation and attribution: Catenaro–Onori and Zhang et al..

Metadata

Release files for battery-feature-lab 0.10.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for battery-feature-lab 0.10.0
File Size Uploaded Provenance Actions
battery_feature_lab-0.10.0.tar.gz 172.2 kB With provenance Details for battery_feature_lab-0.10.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for battery-feature-lab 0.10.0
File Interpreter ABI Platform Actions
battery_feature_lab-0.10.0-py3-none-any.whl Python 3 none any Details for battery_feature_lab-0.10.0-py3-none-any.whl

Total release size: 292.9 kB

Release files / battery_feature_lab-0.10.0.tar.gz

Download URL battery_feature_lab-0.10.0.tar.gz
Size 172.2 kB
Tags Source
SHA-256 checksum
How to use checksums
38b1c03a2a579d864cafda2a98cd03a3140471a8067699ef16959133abad50a6
BLAKE2b-256 checksum
How to use checksums
64bbe222c9353241f73491d90e8e582b97eb93fe224ce5eb47b199c86af8a27d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / battery_feature_lab-0.10.0-py3-none-any.whl

Download URL battery_feature_lab-0.10.0-py3-none-any.whl
Size 120.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
437dc567b942065ce5bac172b1024f7ef256ffcc4d861b28f91edde669d100ce
BLAKE2b-256 checksum
How to use checksums
1f9a33cc0ddcee193959ef793f464e94c8137bda01a91a9f8c3ccdc92fcc326f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Security for battery-feature-lab 0.10.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for battery_feature_lab-0.10.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page