Electrochemical impedance spectroscopy fitting and parameter identification tools.
Project description
eisfit
eisfit is an open-source Python package for fitting electrochemical impedance spectroscopy (EIS) data and identifying equivalent-circuit parameters.
The base model is:
Z = jωL + R0 + (R1 || CPE1) + (R2 || CPE2) + tail
Two low-frequency tail models are available:
CPE tail, default: tail = 1 / (Qd * (jω)^nd)
Warburg tail: tail = σ / sqrt(jω)
The CPE version keeps Qd and nd free. The Warburg version is the traditional semi-infinite Warburg form, equivalent to a CPE exponent fixed at n = 0.5 with a single fitted coefficient σ.
CPE parameters:
[L, R0, R1, Q1, n1, R2, Q2, n2, Qd, nd]
Warburg parameters:
[L, R0, R1, Q1, n1, R2, Q2, n2, sigma]
Features
- CSV and Excel EIS data loading with flexible column matching
- Multi-start bounded least-squares fitting
- Robust loss and impedance-modulus weighting options
- Python functions and command-line interface
- Excel/PNG output generation for local analysis
- Public demo notebook for the Zenodo-derived repository dataset
Dataset attribution
The repository EIS_dataset example files are from:
M. Moertelmaier, M. Kasper, and S. Clark, "EIS data of 54 21700 cells", Zenodo, May 26, 2025. doi: 10.5281/zenodo.15422339.
The included metadata reports a CC-BY 4.0 license for the dataset. Keep this attribution if you redistribute the data. The PyPI package distributions intentionally do not bundle the dataset; use your own EIS files after installation.
Installation
After PyPI release:
pip install eisfit
For local development:
pip install -e ".[dev]"
Minimal package only:
pip install -e .
Python usage
Simple array-based use:
from eisfit import fit, load_eis
freq, Zexp = load_eis("my_eis.csv")
cpe = fit(freq, Zexp) # default tail="cpe"
warburg = fit(freq, Zexp, tail="warburg")
print(cpe.parameters)
print(cpe.rmse, cpe.nrmse)
One-line file-based use:
from eisfit import fit_file
result = fit_file("my_eis.csv", tail="cpe")
warburg = fit_file("my_eis.csv", tail="warburg")
Advanced use with full configuration:
from eisfit import FitConfig, fit_model_eis, load_eis
freq, Zexp = load_eis("my_eis.csv")
cfg = FitConfig(tail="cpe", n_starts=80, seed=7, max_nfev=8000)
result = fit_model_eis(freq, Zexp, cfg=cfg)
Command-line usage
Fit one file with the default CPE tail and write Excel/PNG outputs:
eisfit my_eis.csv --out-dir outputs --n-starts 40
Fit the same file with a semi-infinite Warburg tail:
eisfit my_eis.csv --tail warburg --out-dir outputs --n-starts 40
Batch fit a folder:
eisfit my_eis_folder --pattern "*.csv" --out-dir outputs --n-starts 20
Public notebook
Use examples/demo_fit_zenodo_dataset.ipynb with the repository dataset for a clean public demo.
Development checks
pytest
python -m compileall src tests
Release
PyPI releases are built from the clean public branch. See RELEASE.md for the Trusted Publishing setup and tag-based release workflow.
License
Package code is released under the MIT License. Dataset files retain their original dataset license and attribution requirements.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file eisfit-0.1.0.tar.gz.
File metadata
- Download URL: eisfit-0.1.0.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd141cf491da95fd42c6078d6046671b8e313769591b5a48df4b2d73daeed73f
|
|
| MD5 |
6ec6b2c5f8d688edb8aeda79cacc0ea0
|
|
| BLAKE2b-256 |
7cfc1cc23caeaeda0a12fd3d21c2290f44de6cc85b5fda5da6049712946efbb5
|
Provenance
The following attestation bundles were made for eisfit-0.1.0.tar.gz:
Publisher:
publish.yml on shiyunliu-battery/Battery-EIS-Fit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
eisfit-0.1.0.tar.gz -
Subject digest:
fd141cf491da95fd42c6078d6046671b8e313769591b5a48df4b2d73daeed73f - Sigstore transparency entry: 1542216776
- Sigstore integration time:
-
Permalink:
shiyunliu-battery/Battery-EIS-Fit@7272bc2726324f87da99c23d9ad461192c8174e9 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/shiyunliu-battery
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7272bc2726324f87da99c23d9ad461192c8174e9 -
Trigger Event:
push
-
Statement type:
File details
Details for the file eisfit-0.1.0-py3-none-any.whl.
File metadata
- Download URL: eisfit-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
90d03f9ca0314249f00d42f2ff8342fb99c9235e8d1f129f23c4d436579e25e3
|
|
| MD5 |
aa000ee3434742a03628c1162c38ec0f
|
|
| BLAKE2b-256 |
d272a4b99896298076796c2dc12b88cde38504cb426f2534324b0d52ffca2d06
|
Provenance
The following attestation bundles were made for eisfit-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on shiyunliu-battery/Battery-EIS-Fit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
eisfit-0.1.0-py3-none-any.whl -
Subject digest:
90d03f9ca0314249f00d42f2ff8342fb99c9235e8d1f129f23c4d436579e25e3 - Sigstore transparency entry: 1542216919
- Sigstore integration time:
-
Permalink:
shiyunliu-battery/Battery-EIS-Fit@7272bc2726324f87da99c23d9ad461192c8174e9 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/shiyunliu-battery
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7272bc2726324f87da99c23d9ad461192c8174e9 -
Trigger Event:
push
-
Statement type: