redoxED
A Python package for electrochemical data analysis and visualisation.
Table of contents
Installation
Choose the method that matches how you want to manage your Python environment.
Install with pip in a virtual environment
Activate your virtual environment, then install the published package:
pip install redoxED
To install the local repository in editable mode instead, clone this repository, change to its root directory (the directory containing pyproject.toml), and run:
pip install -e .
Install with uv in a virtual environment
Activate your virtual environment, then use uv’s pip-compatible installer:
uv pip install redoxED
To install a local checkout in editable mode, run this from the repository root:
uv pip install -e .
These uv pip install commands install into the active virtual environment. They do not require you to have created a uv project.
Add redoxED to a uv project
A uv project manages its own virtual environment, usually in a .venv directory. For a new project, create one and add redoxED:
uv init my-project
cd my-project
uv add redoxED
In an existing uv project, run uv add redoxED from that project’s directory. uv records the dependency in the project and installs it. uv sync installs dependencies already declared by the project; it does not add redoxED.
Running the notebooks
The example notebooks are in the notebooks/ directory. You need a checkout of this repository to access them. Run the setup commands below from the repository root.
With pip in a virtual environment
Activate your virtual environment and install redoxED from the checkout, then install the development dependency group:
pip install -e .
pip install --group dev
jupyter lab
pip install --group dev requires pip 25.1 or later. If your pip version does not support --group, install the group’s dependencies directly:
pip install -e .
pip install jupyterlab pyimpspec schemdraw sphinx
jupyter lab
With uv
To let uv create and manage the repository’s environment, run:
uv sync --group dev
uv run jupyter lab
To use an already activated virtual environment instead, run this from the repository root:
uv sync --active --group dev
jupyter lab
The sync commands install redoxED and the dependencies declared in this repository’s dev group. uv sync --active can remove packages from the active environment if they are not declared by the project.
Open a notebook from the notebooks/ directory in JupyterLab.
About
See notebooks for demonstration of main features. Notebooks 1 through to 4 demonstrate data extraction and plotting for cycling data, polarisation curves, and EIS datasets. Notebooks 5 and 6 demonstrate a workflow for EIS analysis, from validation to circuit and DRT fitting.
Echem Data Extraction
Battery cycling data, EIS, and polarisation data can be loaded directly from raw potentiostat files or csv. Alternatively, the classes defined for each data type can be instanced directly.
Integration with Validation and Circuit Fitting Packages
redoxED can be used to extract data to feed into other electrochemical analysis packages and be used to subsequently plot the results.
Before EIS data is analysed by conventional circuit analysis or distribution of relaxation times analysis, it should be validated to show compliance with linear time-invariant behaviour. redoxED can be used alongside packages such as pyimpspec that perform Kramers-Kronig or Z-HIT validation. Validation is demonstrated with Z-HIT in notebook 5.
Analysis by equivalent circuit fitting can also be performed by using other packages. Circuit fitting is again demonstrated with pyimpspec in notebook 5.
DRT Analysis
An open, transparent, and configurable implementation of distribution of relaxation times (DRT) analysis developed to support our work.
DRT is calculated from EIS spectra, based on code from https://github.com/ciuccislab/pyDRTtools and https://github.com/vyrjana/pyimpspec. The main distinction from theses solvers is the ability to explicitly choose the time constants used for calculation, independent of the frequency points provided. By default, our solver uses (1/2πf) vs (1/f) used in these other implmentations. DRT with lumped series capacitance is also implemented to support Li work. Additionally, all solver options (e.g. integration and optimisation algorithm choices) are made available for tuning by the user. Notably, the regularisation parameter optimisation algorithm was found to be important to prevent λ from sticking to initial guesses.
Additional functionality allows for peak fitting and reconstructing impedance spectra.
This module uses Tikhonov regularization and either radial basis function or piecewise linear discretization
- 10.1016/j.electacta.2015.09.097 # radial basis functions for DRT
- 10.1149/1945-7111/acbca4 # hyperparameter selection
- 10.1021/acselectrochem.5c00334 # DRTtools
Plotting
redoxED supports batch plotting of DC and AC figures including:
- Battery efficiency plots
- Other battery metrics
- Polarisation curves
- Nyquist and Bode plots
- DRT spectra
- Residuals plots for model fits.
redoxED supports LaTeX rendering for publication-quality plots with mathematical notation.
Prerequisites
For LaTeX rendering to work properly, you need a complete LaTeX distribution installed on your system. We recommend installing TeX Live (cross-platform) or MiKTeX (Windows).
- Linux: Install TeX Live via your package manager:
sudo apt-get install texlive-full - macOS: Install MacTeX (TeX Live for Mac): https://www.tug.org/mactex/
- Windows: Install TeX Live or MiKTeX: https://www.tug.org/texlive/ or https://miktex.org/
Global LaTeX Configuration
You can enable or disable LaTeX rendering globally for all plots:
from redoxed import config
# Enable LaTeX for all plots (requires LaTeX installation)
config.set_latex_mode(True)
# Disable LaTeX for all plots (uses mathtext)
config.set_latex_mode(False)
# Check current setting
print(config.get_config())
Per-Plot LaTeX Control
You can override the global setting for individual plots:
from redoxed.plots import NyquistPlot
# Use global LaTeX setting
plot1 = NyquistPlot()
# Override to disable LaTeX for this plot only
plot2 = NyquistPlot(usetex=False)
# Override to enable LaTeX for this plot only
plot3 = NyquistPlot(usetex=True)
Important Notes
⚠️ Mixed LaTeX Usage Warning: Do not mix usetex=True and usetex=False plots in the same Python session/notebook cell, as matplotlib's global settings will cause one to overwrite the other's font settings. Set the global configuration once at the beginning of your session.
✅ Recommended Approach:
# At the beginning of your notebook/script
from redoxed import config
config.set_latex_mode(True) # Set once globally
# All subsequent plots will use LaTeX
from redoxed.plots import NyquistPlot, DRTPlot
plot1 = NyquistPlot()
plot2 = DRTPlot()
❌ Avoid This:
# Don't mix LaTeX settings in the same session
plot1 = NyquistPlot(usetex=True) # Uses LaTeX
plot2 = NyquistPlot(usetex=False) # Font settings may be inconsistent
Citing/Contributing
To cite this work, please cite:
Edward Saunders, Baichen Liu, Antoni Forner-Cuenca, Clare P. Grey, Michaël De Volder, A spotter’s guide to electrochemical impedance and distribution of relaxation times spectra in redox flow cells, Journal of Power Sources, Volume 695, 2026, 241243, ISSN 0378-7753, https://doi.org/10.1016/j.jpowsour.2026.241243.
Link: https://www.sciencedirect.com/science/article/pii/S0378775326019932
This code was developed primarily for the PhD of Edward Saunders and further active development is not currently planned. Under the license, others are free to install the library, clone the repo for their own use, or duplicate the repo to make their own version if they appropriately credit this work.
Changelog
See CHANGELOG.md for details.
License
Copyright 2026 Edward Saunders
redoxED is licensed under the GPLv3 or later.
Metadata
Release files for redoxED 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| redoxed-0.1.3.tar.gz | 65.7 kB | Without provenance | Details for redoxed-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| redoxed-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for redoxed-0.1.3-py3-none-any.whl |
Total release size: 148.4 kB
Release files / redoxed-0.1.3.tar.gz
| Download URL | redoxed-0.1.3.tar.gz |
|---|---|
| Size | 65.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0153e25552d73504b42c745d86c39f84dc032a4288dff774e63beae3b2567616
|
|
BLAKE2b-256 checksum How to use checksums |
24b28a9ae9442d644002f14393bc81ef897f45ffe315e88a28b66c110a59326f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / redoxed-0.1.3-py3-none-any.whl
| Download URL | redoxed-0.1.3-py3-none-any.whl |
|---|---|
| Size | 82.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9402bb779702def1ee6adf7f27440d1afa7996a0ebcaf782d7cbc644a24fd3e6
|
|
BLAKE2b-256 checksum How to use checksums |
07cfa0a2c850de5edd86b65a5dfc62a59d52515d4d37ae7b1518a2c3ad6fad6b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for redoxED 0.1.3
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.