Skip to main content

A Python package for electrochemical data analysis and visualisation.

Project description

redoxED

A Python package for electrochemical data analysis and visualisation.

PyPI - Python Version GitHub License PyPI - Version

Table of contents

Installation

The simplest terminal installation is to simply run:

pip install redoxED

Alternatively, to use an editable local repository, clone this repository, navigate to the directory with pyproject.toml in terminal and use:

pip install -e .

About

See notebooks for demonstration of main features.

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.

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).

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

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

redoxed-0.1.1.tar.gz (64.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

redoxed-0.1.1-py3-none-any.whl (81.4 kB view details)

Uploaded Python 3

File details

Details for the file redoxed-0.1.1.tar.gz.

File metadata

  • Download URL: redoxed-0.1.1.tar.gz
  • Upload date:
  • Size: 64.4 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for redoxed-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ed549795af81e955b69e72a86b55ae0f6be5a999f37567f03b0221ed7da5c383
MD5 e14f14f8c2dcfcf8724f99cfa06bb95e
BLAKE2b-256 73bfef658efc3fa858b8f9462d90af16710d45e4832a6acfb9d735c8bfc2841e

See more details on using hashes here.

File details

Details for the file redoxed-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: redoxed-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 81.4 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for redoxed-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 78c14a8774c356553d8469b19aff8e2e097f803ef6d997459d143e7b715c1e50
MD5 fabbd4571a29baffbec7e990bd3763ce
BLAKE2b-256 2d4fcfda4c9bc7472caead706cf97cc38bd16326bd45b617bc53568e7ebc0a11

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page