Metadata-Version: 2.4
Name: aswift
Version: 1.0.4
Summary: ASWIFT peak fitting utilities for square-wave voltammetry
Author-email: Max Yates <mlyates@stanford.edu>
License-Expression: MIT
Project-URL: Homepage, https://github.com/Soh-Lab/aswift
Project-URL: Repository, https://github.com/Soh-Lab/aswift
Project-URL: Documentation, https://github.com/Soh-Lab/aswift#readme
Project-URL: Soh Lab Website, https://sohlab.stanford.edu/
Keywords: electrochemistry,square-wave voltammetry,peak fitting,SWV
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering :: Chemistry
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=2.0
Requires-Dist: scipy>=1.15
Requires-Dist: pybaselines>=1.2
Provides-Extra: batch
Requires-Dist: pandas>=2.2; extra == "batch"
Provides-Extra: plot
Requires-Dist: matplotlib>=3.10; extra == "plot"
Requires-Dist: pandas>=2.2; extra == "plot"
Provides-Extra: viewer
Requires-Dist: matplotlib>=3.10; extra == "viewer"
Requires-Dist: pandas>=2.2; extra == "viewer"
Requires-Dist: plotly>=6.0.0; extra == "viewer"
Requires-Dist: pypalmsens==1.11.0; extra == "viewer"
Requires-Dist: pythonnet<3.1,>=3.0.5; extra == "viewer"
Requires-Dist: streamlit>=1.46; extra == "viewer"
Requires-Dist: watchdog>=6.0; extra == "viewer"
Provides-Extra: developer
Requires-Dist: aswift[viewer]; extra == "developer"
Requires-Dist: pytest>=8.0; extra == "developer"
Requires-Dist: pydantic==2.11.4; extra == "developer"
Provides-Extra: all
Requires-Dist: aswift[developer]; extra == "all"
Dynamic: license-file

# ASWIFT

<p align="center">
  <img src="https://raw.githubusercontent.com/Soh-Lab/aswift/main/docs/assets/aswift-logo-banner.png" alt="ASWIFT: automated square-wave voltammetry signal fitting" width="640">
</p>

ASWIFT fits square-wave voltammetry (SWV) traces and extracts peak signal,
background, peak voltage, full-prominence peak width, and baseline-subtracted
full-prominence peak area. Use the no-code ASWIFT Viewer for interactive
analysis, or install the Python package to build ASWIFT into a custom workflow.

## Installation

ASWIFT requires Python 3.12 or newer. Install the core fitting utilities with:

```bash
pip install aswift
```

Install the viewer, pandas CSV helpers, plotting tools, and PalmSens
`.pssession` support with:

```bash
pip install "aswift[viewer]"
```

PalmSens support uses `pypalmsens`, which requires the
[Microsoft .NET 9 Runtime](https://dotnet.microsoft.com/en-us/download/dotnet/9.0).

## ASWIFT Viewer

Launch the viewer from an activated Python environment:

```bash
aswift-viewer
```

![Annotated overview of the ASWIFT Viewer interface](https://raw.githubusercontent.com/Soh-Lab/aswift/main/docs/assets/aswift-viewer-overview.png)

The viewer loads CSV, JSON, and PalmSens `.pssession` data; fits individual or
batched voltammograms; visualizes fitted backgrounds and peaks; and exports
raw and normalized results with their associated metadata.

Under **Input**, enable **Peak potential range** to select the most prominent
peak within typed lower and upper limits in volts. Leave it unchecked for
automatic peak selection. Allow enough range for peak drift. A trace with no
eligible peak is reported as a failed fit.

Use **Normalize** with typed start and end sample indices. Both limits are
included, so 0–4 uses the first five samples as the reference.

## Python API

```python
import numpy as np
from aswift import aswift_fit, plot_fit_result

volts = np.asarray([...], dtype=float)
current = np.asarray([...], dtype=float)

result = aswift_fit(volts, current)
print(result.peak_signal, result.peak_voltage)
ax = plot_fit_result(result)
```

The returned `FitResult` includes the peak signal, background, voltage,
full-prominence width and area, peak profile, background profile, and combined
fitted current. ASWIFT also provides dataframe and PalmSens helpers for batch
workflows. Single-trace and batch fitting methods accept
`expected_potential_range=(-0.35, -0.20)` to restrict peak selection to an
inclusive potential range in volts.

## Documentation and support

See the [full documentation and examples](https://github.com/Soh-Lab/aswift#readme)
on GitHub. Please [open an issue](https://github.com/Soh-Lab/aswift/issues) for
bug reports, questions, feedback, or feature requests.

## Citation

If you use ASWIFT in your research, please cite:

> Yates, M., Ji, J., Yee, S., & Soh, H. T. (2026). Robust Regularization
> Enables Automated, Real-Time Square-Wave Voltammetry Signal Quantification.
> *bioRxiv*. [https://doi.org/10.64898/2026.07.25.740173](https://doi.org/10.64898/2026.07.25.740173)

Machine-readable citation metadata is available in
[`CITATION.cff`](https://github.com/Soh-Lab/aswift/blob/main/CITATION.cff).

## License

ASWIFT is licensed under the MIT License. See the
[license](https://github.com/Soh-Lab/aswift/blob/main/LICENSE) for details.
