ici-analysis 2.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ici_analysis-2.1.0/LICENSE +21 -0
- ici_analysis-2.1.0/PKG-INFO +217 -0
- ici_analysis-2.1.0/README.md +191 -0
- ici_analysis-2.1.0/analysis/__init__.py +0 -0
- ici_analysis-2.1.0/analysis/data_loader.py +407 -0
- ici_analysis-2.1.0/analysis/kinetic_analyzer.py +577 -0
- ici_analysis-2.1.0/analysis/phase_classifier.py +190 -0
- ici_analysis-2.1.0/analysis/pulse_analyzer.py +152 -0
- ici_analysis-2.1.0/analysis/regression_analyzer.py +435 -0
- ici_analysis-2.1.0/gui/__init__.py +0 -0
- ici_analysis-2.1.0/gui/components/__init__.py +0 -0
- ici_analysis-2.1.0/gui/components/export_helper.py +32 -0
- ici_analysis-2.1.0/gui/components/plot_panel.py +111 -0
- ici_analysis-2.1.0/gui/components/scroll.py +42 -0
- ici_analysis-2.1.0/gui/components/ui_column_map.py +145 -0
- ici_analysis-2.1.0/gui/sections/__init__.py +7 -0
- ici_analysis-2.1.0/gui/sections/column_map.py +145 -0
- ici_analysis-2.1.0/gui/sections/data_loading.py +736 -0
- ici_analysis-2.1.0/gui/sections/kinetics.py +684 -0
- ici_analysis-2.1.0/gui/sections/pulse.py +643 -0
- ici_analysis-2.1.0/gui/sections/regression.py +1001 -0
- ici_analysis-2.1.0/gui/theme.py +128 -0
- ici_analysis-2.1.0/ici_analysis.egg-info/PKG-INFO +217 -0
- ici_analysis-2.1.0/ici_analysis.egg-info/SOURCES.txt +42 -0
- ici_analysis-2.1.0/ici_analysis.egg-info/dependency_links.txt +1 -0
- ici_analysis-2.1.0/ici_analysis.egg-info/entry_points.txt +2 -0
- ici_analysis-2.1.0/ici_analysis.egg-info/requires.txt +8 -0
- ici_analysis-2.1.0/ici_analysis.egg-info/top_level.txt +4 -0
- ici_analysis-2.1.0/main_gui.py +171 -0
- ici_analysis-2.1.0/pyici/__init__.py +75 -0
- ici_analysis-2.1.0/pyproject.toml +58 -0
- ici_analysis-2.1.0/setup.cfg +4 -0
- ici_analysis-2.1.0/tests/test_analysis.py +74 -0
- ici_analysis-2.1.0/tests/test_assign_valid_pulses.py +50 -0
- ici_analysis-2.1.0/tests/test_characterization_realdata.py +122 -0
- ici_analysis-2.1.0/tests/test_data_loader.py +27 -0
- ici_analysis-2.1.0/tests/test_encoding.py +49 -0
- ici_analysis-2.1.0/tests/test_kinetics_R_k.py +46 -0
- ici_analysis-2.1.0/tests/test_phase_classifier.py +42 -0
- ici_analysis-2.1.0/tests/test_public_api.py +50 -0
- ici_analysis-2.1.0/tests/test_pulse_analysis.py +63 -0
- ici_analysis-2.1.0/tests/test_regression_load.py +32 -0
- ici_analysis-2.1.0/tests/test_v0_prepulse.py +66 -0
- ici_analysis-2.1.0/tests/test_window_resolution.py +67 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 José J. Arroyo Gómez
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ici-analysis
|
|
3
|
+
Version: 2.1.0
|
|
4
|
+
Summary: GUI tool for Intermittent Current Interruption (ICI) analysis of battery cycling data
|
|
5
|
+
Author: José J. Arroyo-Gómez
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/Joe-Arroyo/pyICI
|
|
8
|
+
Project-URL: Repository, https://github.com/Joe-Arroyo/pyICI
|
|
9
|
+
Keywords: electrochemistry,batteries,intermittent current interruption,internal resistance,diffusion
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: Topic :: Scientific/Engineering
|
|
15
|
+
Requires-Python: >=3.9
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
Requires-Dist: numpy>=1.24.0
|
|
19
|
+
Requires-Dist: pandas>=2.0.0
|
|
20
|
+
Requires-Dist: matplotlib>=3.7.0
|
|
21
|
+
Requires-Dist: customtkinter>=5.2.0
|
|
22
|
+
Provides-Extra: test
|
|
23
|
+
Requires-Dist: pytest>=7.0; extra == "test"
|
|
24
|
+
Requires-Dist: pytest-cov>=4.0; extra == "test"
|
|
25
|
+
Dynamic: license-file
|
|
26
|
+
|
|
27
|
+
# pyICI
|
|
28
|
+
|
|
29
|
+
**Python-based Interactive Interface for Intermittent Current Interruption (ICI) data analysis for Battery Research**
|
|
30
|
+
|
|
31
|
+
[](https://opensource.org/licenses/MIT)
|
|
32
|
+
[](https://www.python.org/downloads/)
|
|
33
|
+
|
|
34
|
+

|
|
35
|
+
|
|
36
|
+
## Overview
|
|
37
|
+
|
|
38
|
+
Intermittent current interruption (ICI) is an electrochemical technique used for the diagnostic analysis of battery systems. It involves introducing brief interruptions or pauses (1–10 seconds) into a constant current charge–discharge cycle and analyzing the voltage response during each interruption. The technique characterizes cell resistance using two parameters: the internal resistance (*R*, Ω), which captures Ohmic contributions, and the diffusion resistance coefficient (*k*, Ω s<sup>−1/2</sup>), which captures solid-state mass transport effects. Because ICI assumes a diffusion-controlled system, cycling must be performed at a comparatively slow rate of C/5 or lower.
|
|
39
|
+
|
|
40
|
+
pyICI is a GUI-based analysis tool designed for researchers working with electrochemical ICI data. The tool facilitates the calculation of *R* and *k* from datasets with one or more cycles.
|
|
41
|
+
|
|
42
|
+
Technical details of the ICI technique and associated literature can be found on the website of Dr. Matthew J. Lacey ([link here](https://lacey.se/projects/ici)), who developed the technique for routine battery analysis.
|
|
43
|
+
|
|
44
|
+
## Features
|
|
45
|
+
|
|
46
|
+
The GUI is organized into four sections:
|
|
47
|
+
|
|
48
|
+
- **Data loading & visualization**: Import and view cycling data — several files at once, with an optional overlay to compare them.
|
|
49
|
+
- Automatic ICI cycle detection for three-column files; a column-mapping dialog for files with more columns
|
|
50
|
+
- Charge / discharge classification, coloured by cycle
|
|
51
|
+
- Plots: voltage vs time (all cycles, a subset, or a single cycle, with an optional current subplot) and voltage vs capacity / specific capacity
|
|
52
|
+
- CSV export of the capacity data
|
|
53
|
+
|
|
54
|
+
- **Pulse verification**: Step through a cycle's current-interruption pulses to check they are segmented correctly.
|
|
55
|
+
- Whole-cycle overview with the selected pulse highlighted
|
|
56
|
+
- Per-pulse detail (voltage + current) and a zoom on the rest-period relaxation with *V₀* marked
|
|
57
|
+
|
|
58
|
+
- **Regression**: Interactively perform linear regression of the voltage vs $\sqrt{time}$ data during each ICI step.
|
|
59
|
+
- User-defined fit window (time or index), applied to a single pulse, a whole cycle, or all cycles, and saved per file
|
|
60
|
+
- Fit parameters (slope, intercept) evaluated with R<sup>2</sup>, using the covariance matrix for error propagation
|
|
61
|
+
- The regression fit and an R<sup>2</sup>-across-pulses plot shown together, with axis-limit controls; an "Overall check" of R<sup>2</sup> across every cycle
|
|
62
|
+
- *R* and *k* shown on the fit plot, and a secondary time axis on the ΔV-vs-√time plot
|
|
63
|
+
|
|
64
|
+
- **Kinetic analysis**: *R* and *k* calculation from the regression parameters.
|
|
65
|
+
- $R = - \frac{intercept}{I}$ and $k = - \frac{slope}{I}$, with *I* the current before the interruption
|
|
66
|
+
- *R* and *k* vs voltage, capacity, or specific capacity — coloured by cycle, with axis-limit controls and multi-file overlay
|
|
67
|
+
- Covariance-based error bars
|
|
68
|
+
- CSV export (per phase, and per file when overlaid) of *V*, *R*, *R_errors*, *k*, *k_errors* and *R*<sup>2</sup>, plus figure export (*R*, *k*, or both)
|
|
69
|
+
|
|
70
|
+
## Installation
|
|
71
|
+
|
|
72
|
+
- Compatible with Python 3.9 - 3.13
|
|
73
|
+
|
|
74
|
+
### Quick install (from PyPI)
|
|
75
|
+
|
|
76
|
+
The easiest way to get pyICI. This installs pyICI and all of its dependencies and
|
|
77
|
+
adds a `pyici` command that launches the GUI:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
pip install ici-analysis
|
|
81
|
+
pyici
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
> On **Linux** you may first need the system `tkinter` package (see the note in
|
|
85
|
+
> Step 1 below). Installing into a virtual environment is recommended (see Step 3).
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
### Install from source
|
|
90
|
+
|
|
91
|
+
Use the steps below to run the latest (unreleased) code or to develop pyICI —
|
|
92
|
+
they install from a clone of the repository.
|
|
93
|
+
|
|
94
|
+
### Step 1: **Install Python:**
|
|
95
|
+
**Windows:**
|
|
96
|
+
Download the installer from [python.org](https://www.python.org/downloads/) and run it. Make sure to check "Add Python to PATH" during installation.
|
|
97
|
+
|
|
98
|
+
**macOS:**
|
|
99
|
+
Download the installer from [python.org](https://www.python.org/downloads/), or install via Homebrew:
|
|
100
|
+
```bash
|
|
101
|
+
brew install python
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**Linux:**
|
|
105
|
+
Python is usually pre-installed. Verify with:
|
|
106
|
+
```bash
|
|
107
|
+
python3 --version
|
|
108
|
+
```
|
|
109
|
+
If not installed, use your package manager:
|
|
110
|
+
```bash
|
|
111
|
+
# Ubuntu/Debian
|
|
112
|
+
sudo apt install python3 python3-pip
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
> **Note on tkinter**: pyICI uses `tkinter` for its GUI. Installation varies by platform:
|
|
116
|
+
> - **Windows**: included with the standard Python installer, no action needed
|
|
117
|
+
> - **macOS**: included with Python from python.org. If using Homebrew: `brew install python-tk`
|
|
118
|
+
> - **Ubuntu/Debian**: `sudo apt install python3-tk`
|
|
119
|
+
> - **Fedora**: `sudo dnf install python3-tkinter`
|
|
120
|
+
> - **CentOS/RHEL**: `sudo yum install python3-tkinter`
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
### Step 2: **Download the project:**
|
|
125
|
+
Open a terminal (Command prompt on Windows, Terminal on macOS/Linux) and run:
|
|
126
|
+
```bash
|
|
127
|
+
# Clone the repository
|
|
128
|
+
git clone https://github.com/Joe-Arroyo/pyICI.git
|
|
129
|
+
cd pyICI
|
|
130
|
+
```
|
|
131
|
+
Or download the ZIP file and extract it.
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
### Step 3: Create a virtual environment (recommended)
|
|
136
|
+
|
|
137
|
+
Using a virtual environment keeps pyICI's dependencies isolated from other Python projects on your system.
|
|
138
|
+
|
|
139
|
+
**Windows (Command Prompt):**
|
|
140
|
+
```cmd
|
|
141
|
+
python -m venv venv
|
|
142
|
+
venv\Scripts\activate
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
**macOS / Linux:**
|
|
146
|
+
```bash
|
|
147
|
+
python3 -m venv venv
|
|
148
|
+
source venv/bin/activate
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
You should see `(venv)` in your terminal prompt. To deactivate later, run `deactivate`.
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
### Step4:. **Install Python dependencies:**
|
|
156
|
+
```bash
|
|
157
|
+
pip install -e . # installs pyICI; the `pyici` command then launches the GUI
|
|
158
|
+
pyici # GUI launches
|
|
159
|
+
python main_gui.py # also works
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Step 5: Run pyICI
|
|
163
|
+
|
|
164
|
+
**Windows:**
|
|
165
|
+
```bash
|
|
166
|
+
python main_gui.py
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
**macOS / Linux:**
|
|
170
|
+
```bash
|
|
171
|
+
python3 main_gui.py
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
### Step 6: Get started
|
|
177
|
+
|
|
178
|
+
See the [Tutorial](Tutorial.md) for a quick guide through pyICI's features.
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## Use as a library
|
|
183
|
+
|
|
184
|
+
Beyond the GUI, pyICI can be scripted — useful for batch-processing many files or
|
|
185
|
+
feeding *R* / *k* into your own analysis. Import everything from the top-level
|
|
186
|
+
`pyici` package (no GUI / tkinter needed):
|
|
187
|
+
|
|
188
|
+
```python
|
|
189
|
+
import pyici
|
|
190
|
+
|
|
191
|
+
# 1. Load a data file -> df_raw, cycle_list, data_format, ...
|
|
192
|
+
data = pyici.run_data_analysis("path/to/folder", "cell01.txt") # or pyici.load_data(...)
|
|
193
|
+
|
|
194
|
+
# 2. Inspect a cycle's current-interruption pulses
|
|
195
|
+
pulses = pyici.analyze_cycle_pulses(data.df_raw, cycle_num=1) # or pyici.segment_pulses(...)
|
|
196
|
+
|
|
197
|
+
# 3. Compute R (Ω) and k (Ω·s^-1/2) for some cycles, charge phase,
|
|
198
|
+
# using the default 0.1-1.0 s fit window
|
|
199
|
+
rk = pyici.compute_R_k_for_cycles( # or pyici.compute_rk(...)
|
|
200
|
+
data.df_raw, data.cycle_list, "charge",
|
|
201
|
+
"time", pyici.DEFAULT_TIME_START, pyici.DEFAULT_TIME_END, {}, mass_mg=0.0,
|
|
202
|
+
)
|
|
203
|
+
for cyc in rk:
|
|
204
|
+
print(cyc["cycle"], cyc["R"], cyc["k"])
|
|
205
|
+
|
|
206
|
+
# 4. Or write the R/k results to CSV (charge and discharge in separate files)
|
|
207
|
+
pyici.export_R_k_results(data.df_raw, data.cycle_list, output_folder="exports")
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
`pyici.load_data`, `pyici.segment_pulses` and `pyici.compute_rk` are friendly
|
|
211
|
+
aliases for the three most common calls. `print(pyici.__version__)` reports the
|
|
212
|
+
installed version.
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## AI Assistance
|
|
217
|
+
This project was developed with the assistance of Claude (Anthropic). All code has been reviewed and tested by the authors.
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# pyICI
|
|
2
|
+
|
|
3
|
+
**Python-based Interactive Interface for Intermittent Current Interruption (ICI) data analysis for Battery Research**
|
|
4
|
+
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
[](https://www.python.org/downloads/)
|
|
7
|
+
|
|
8
|
+

|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
Intermittent current interruption (ICI) is an electrochemical technique used for the diagnostic analysis of battery systems. It involves introducing brief interruptions or pauses (1–10 seconds) into a constant current charge–discharge cycle and analyzing the voltage response during each interruption. The technique characterizes cell resistance using two parameters: the internal resistance (*R*, Ω), which captures Ohmic contributions, and the diffusion resistance coefficient (*k*, Ω s<sup>−1/2</sup>), which captures solid-state mass transport effects. Because ICI assumes a diffusion-controlled system, cycling must be performed at a comparatively slow rate of C/5 or lower.
|
|
13
|
+
|
|
14
|
+
pyICI is a GUI-based analysis tool designed for researchers working with electrochemical ICI data. The tool facilitates the calculation of *R* and *k* from datasets with one or more cycles.
|
|
15
|
+
|
|
16
|
+
Technical details of the ICI technique and associated literature can be found on the website of Dr. Matthew J. Lacey ([link here](https://lacey.se/projects/ici)), who developed the technique for routine battery analysis.
|
|
17
|
+
|
|
18
|
+
## Features
|
|
19
|
+
|
|
20
|
+
The GUI is organized into four sections:
|
|
21
|
+
|
|
22
|
+
- **Data loading & visualization**: Import and view cycling data — several files at once, with an optional overlay to compare them.
|
|
23
|
+
- Automatic ICI cycle detection for three-column files; a column-mapping dialog for files with more columns
|
|
24
|
+
- Charge / discharge classification, coloured by cycle
|
|
25
|
+
- Plots: voltage vs time (all cycles, a subset, or a single cycle, with an optional current subplot) and voltage vs capacity / specific capacity
|
|
26
|
+
- CSV export of the capacity data
|
|
27
|
+
|
|
28
|
+
- **Pulse verification**: Step through a cycle's current-interruption pulses to check they are segmented correctly.
|
|
29
|
+
- Whole-cycle overview with the selected pulse highlighted
|
|
30
|
+
- Per-pulse detail (voltage + current) and a zoom on the rest-period relaxation with *V₀* marked
|
|
31
|
+
|
|
32
|
+
- **Regression**: Interactively perform linear regression of the voltage vs $\sqrt{time}$ data during each ICI step.
|
|
33
|
+
- User-defined fit window (time or index), applied to a single pulse, a whole cycle, or all cycles, and saved per file
|
|
34
|
+
- Fit parameters (slope, intercept) evaluated with R<sup>2</sup>, using the covariance matrix for error propagation
|
|
35
|
+
- The regression fit and an R<sup>2</sup>-across-pulses plot shown together, with axis-limit controls; an "Overall check" of R<sup>2</sup> across every cycle
|
|
36
|
+
- *R* and *k* shown on the fit plot, and a secondary time axis on the ΔV-vs-√time plot
|
|
37
|
+
|
|
38
|
+
- **Kinetic analysis**: *R* and *k* calculation from the regression parameters.
|
|
39
|
+
- $R = - \frac{intercept}{I}$ and $k = - \frac{slope}{I}$, with *I* the current before the interruption
|
|
40
|
+
- *R* and *k* vs voltage, capacity, or specific capacity — coloured by cycle, with axis-limit controls and multi-file overlay
|
|
41
|
+
- Covariance-based error bars
|
|
42
|
+
- CSV export (per phase, and per file when overlaid) of *V*, *R*, *R_errors*, *k*, *k_errors* and *R*<sup>2</sup>, plus figure export (*R*, *k*, or both)
|
|
43
|
+
|
|
44
|
+
## Installation
|
|
45
|
+
|
|
46
|
+
- Compatible with Python 3.9 - 3.13
|
|
47
|
+
|
|
48
|
+
### Quick install (from PyPI)
|
|
49
|
+
|
|
50
|
+
The easiest way to get pyICI. This installs pyICI and all of its dependencies and
|
|
51
|
+
adds a `pyici` command that launches the GUI:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
pip install ici-analysis
|
|
55
|
+
pyici
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
> On **Linux** you may first need the system `tkinter` package (see the note in
|
|
59
|
+
> Step 1 below). Installing into a virtual environment is recommended (see Step 3).
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
### Install from source
|
|
64
|
+
|
|
65
|
+
Use the steps below to run the latest (unreleased) code or to develop pyICI —
|
|
66
|
+
they install from a clone of the repository.
|
|
67
|
+
|
|
68
|
+
### Step 1: **Install Python:**
|
|
69
|
+
**Windows:**
|
|
70
|
+
Download the installer from [python.org](https://www.python.org/downloads/) and run it. Make sure to check "Add Python to PATH" during installation.
|
|
71
|
+
|
|
72
|
+
**macOS:**
|
|
73
|
+
Download the installer from [python.org](https://www.python.org/downloads/), or install via Homebrew:
|
|
74
|
+
```bash
|
|
75
|
+
brew install python
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**Linux:**
|
|
79
|
+
Python is usually pre-installed. Verify with:
|
|
80
|
+
```bash
|
|
81
|
+
python3 --version
|
|
82
|
+
```
|
|
83
|
+
If not installed, use your package manager:
|
|
84
|
+
```bash
|
|
85
|
+
# Ubuntu/Debian
|
|
86
|
+
sudo apt install python3 python3-pip
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
> **Note on tkinter**: pyICI uses `tkinter` for its GUI. Installation varies by platform:
|
|
90
|
+
> - **Windows**: included with the standard Python installer, no action needed
|
|
91
|
+
> - **macOS**: included with Python from python.org. If using Homebrew: `brew install python-tk`
|
|
92
|
+
> - **Ubuntu/Debian**: `sudo apt install python3-tk`
|
|
93
|
+
> - **Fedora**: `sudo dnf install python3-tkinter`
|
|
94
|
+
> - **CentOS/RHEL**: `sudo yum install python3-tkinter`
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
### Step 2: **Download the project:**
|
|
99
|
+
Open a terminal (Command prompt on Windows, Terminal on macOS/Linux) and run:
|
|
100
|
+
```bash
|
|
101
|
+
# Clone the repository
|
|
102
|
+
git clone https://github.com/Joe-Arroyo/pyICI.git
|
|
103
|
+
cd pyICI
|
|
104
|
+
```
|
|
105
|
+
Or download the ZIP file and extract it.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
### Step 3: Create a virtual environment (recommended)
|
|
110
|
+
|
|
111
|
+
Using a virtual environment keeps pyICI's dependencies isolated from other Python projects on your system.
|
|
112
|
+
|
|
113
|
+
**Windows (Command Prompt):**
|
|
114
|
+
```cmd
|
|
115
|
+
python -m venv venv
|
|
116
|
+
venv\Scripts\activate
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**macOS / Linux:**
|
|
120
|
+
```bash
|
|
121
|
+
python3 -m venv venv
|
|
122
|
+
source venv/bin/activate
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
You should see `(venv)` in your terminal prompt. To deactivate later, run `deactivate`.
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
### Step4:. **Install Python dependencies:**
|
|
130
|
+
```bash
|
|
131
|
+
pip install -e . # installs pyICI; the `pyici` command then launches the GUI
|
|
132
|
+
pyici # GUI launches
|
|
133
|
+
python main_gui.py # also works
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Step 5: Run pyICI
|
|
137
|
+
|
|
138
|
+
**Windows:**
|
|
139
|
+
```bash
|
|
140
|
+
python main_gui.py
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**macOS / Linux:**
|
|
144
|
+
```bash
|
|
145
|
+
python3 main_gui.py
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
### Step 6: Get started
|
|
151
|
+
|
|
152
|
+
See the [Tutorial](Tutorial.md) for a quick guide through pyICI's features.
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## Use as a library
|
|
157
|
+
|
|
158
|
+
Beyond the GUI, pyICI can be scripted — useful for batch-processing many files or
|
|
159
|
+
feeding *R* / *k* into your own analysis. Import everything from the top-level
|
|
160
|
+
`pyici` package (no GUI / tkinter needed):
|
|
161
|
+
|
|
162
|
+
```python
|
|
163
|
+
import pyici
|
|
164
|
+
|
|
165
|
+
# 1. Load a data file -> df_raw, cycle_list, data_format, ...
|
|
166
|
+
data = pyici.run_data_analysis("path/to/folder", "cell01.txt") # or pyici.load_data(...)
|
|
167
|
+
|
|
168
|
+
# 2. Inspect a cycle's current-interruption pulses
|
|
169
|
+
pulses = pyici.analyze_cycle_pulses(data.df_raw, cycle_num=1) # or pyici.segment_pulses(...)
|
|
170
|
+
|
|
171
|
+
# 3. Compute R (Ω) and k (Ω·s^-1/2) for some cycles, charge phase,
|
|
172
|
+
# using the default 0.1-1.0 s fit window
|
|
173
|
+
rk = pyici.compute_R_k_for_cycles( # or pyici.compute_rk(...)
|
|
174
|
+
data.df_raw, data.cycle_list, "charge",
|
|
175
|
+
"time", pyici.DEFAULT_TIME_START, pyici.DEFAULT_TIME_END, {}, mass_mg=0.0,
|
|
176
|
+
)
|
|
177
|
+
for cyc in rk:
|
|
178
|
+
print(cyc["cycle"], cyc["R"], cyc["k"])
|
|
179
|
+
|
|
180
|
+
# 4. Or write the R/k results to CSV (charge and discharge in separate files)
|
|
181
|
+
pyici.export_R_k_results(data.df_raw, data.cycle_list, output_folder="exports")
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
`pyici.load_data`, `pyici.segment_pulses` and `pyici.compute_rk` are friendly
|
|
185
|
+
aliases for the three most common calls. `print(pyici.__version__)` reports the
|
|
186
|
+
installed version.
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## AI Assistance
|
|
191
|
+
This project was developed with the assistance of Claude (Anthropic). All code has been reviewed and tested by the authors.
|
|
File without changes
|