batplot 1.8.30__tar.gz → 1.8.33__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.
- batplot-1.8.33/MANIFEST.in +2 -0
- {batplot-1.8.30/batplot.egg-info → batplot-1.8.33}/PKG-INFO +28 -6
- {batplot-1.8.30 → batplot-1.8.33}/README.md +27 -5
- {batplot-1.8.30 → batplot-1.8.33}/batplot/__init__.py +1 -1
- {batplot-1.8.30 → batplot-1.8.33}/batplot/args.py +35 -10
- {batplot-1.8.30 → batplot-1.8.33}/batplot/batch.py +27 -8
- {batplot-1.8.30 → batplot-1.8.33}/batplot/batplot.py +287 -57
- batplot-1.8.33/batplot/canvas_interactive.py +1189 -0
- {batplot-1.8.30 → batplot-1.8.33}/batplot/cpc_interactive.py +161 -22
- {batplot-1.8.30 → batplot-1.8.33}/batplot/data/CHANGELOG.md +27 -6
- batplot-1.8.33/batplot/data/USER_MANUAL.md +624 -0
- {batplot-1.8.30 → batplot-1.8.33}/batplot/electrochem_interactive.py +744 -238
- {batplot-1.8.30 → batplot-1.8.33}/batplot/interactive.py +9 -13
- {batplot-1.8.30 → batplot-1.8.33}/batplot/manual.py +12 -1
- {batplot-1.8.30 → batplot-1.8.33}/batplot/modes.py +23 -3
- {batplot-1.8.30 → batplot-1.8.33}/batplot/operando.py +167 -147
- {batplot-1.8.30 → batplot-1.8.33}/batplot/operando_ec_interactive.py +531 -592
- {batplot-1.8.30 → batplot-1.8.33}/batplot/readers.py +390 -0
- {batplot-1.8.30 → batplot-1.8.33}/batplot/session.py +866 -44
- batplot-1.8.33/batplot/showcol.py +468 -0
- {batplot-1.8.30 → batplot-1.8.33}/batplot/style.py +5 -5
- {batplot-1.8.30 → batplot-1.8.33}/batplot/ui.py +7 -13
- {batplot-1.8.30 → batplot-1.8.33}/batplot/utils.py +32 -7
- {batplot-1.8.30 → batplot-1.8.33}/batplot/version_check.py +1 -2
- {batplot-1.8.30 → batplot-1.8.33/batplot.egg-info}/PKG-INFO +28 -6
- {batplot-1.8.30 → batplot-1.8.33}/batplot.egg-info/SOURCES.txt +4 -1
- batplot-1.8.33/batplot.egg-info/top_level.txt +2 -0
- {batplot-1.8.30 → batplot-1.8.33}/pyproject.toml +1 -1
- batplot-1.8.30/MANIFEST.in +0 -2
- batplot-1.8.30/batplot.egg-info/top_level.txt +0 -1
- {batplot-1.8.30 → batplot-1.8.33}/LICENSE +0 -0
- {batplot-1.8.30 → batplot-1.8.33}/NOTICE +0 -0
- {batplot-1.8.30 → batplot-1.8.33}/batplot/cif.py +0 -0
- {batplot-1.8.30 → batplot-1.8.33}/batplot/cli.py +0 -0
- {batplot-1.8.30 → batplot-1.8.33}/batplot/color_utils.py +0 -0
- {batplot-1.8.30 → batplot-1.8.33}/batplot/config.py +0 -0
- {batplot-1.8.30 → batplot-1.8.33}/batplot/converters.py +0 -0
- {batplot-1.8.30 → batplot-1.8.33}/batplot/dev_upgrade.py +0 -0
- {batplot-1.8.30 → batplot-1.8.33}/batplot/plotting.py +0 -0
- {batplot-1.8.30 → batplot-1.8.33}/batplot.egg-info/dependency_links.txt +0 -0
- {batplot-1.8.30 → batplot-1.8.33}/batplot.egg-info/entry_points.txt +0 -0
- {batplot-1.8.30 → batplot-1.8.33}/batplot.egg-info/requires.txt +0 -0
- {batplot-1.8.30 → batplot-1.8.33}/setup.cfg +0 -0
- {batplot-1.8.30 → batplot-1.8.33}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: batplot
|
|
3
|
-
Version: 1.8.
|
|
3
|
+
Version: 1.8.33
|
|
4
4
|
Summary: Interactive plotting tool for material science (1D plot) and electrochemistry (GC, CV, dQ/dV, CPC, operando) with batch processing
|
|
5
5
|
Author-email: Tian Dai <tianda@uio.no>
|
|
6
6
|
License: MIT License
|
|
@@ -57,13 +57,15 @@ Dynamic: license-file
|
|
|
57
57
|
|
|
58
58
|
## Features
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
- **
|
|
62
|
-
- **
|
|
60
|
+
With a single line of command to easily plot publication-ready plots with customized, intuitive interactive editing features such as:
|
|
61
|
+
- **Electrochemistry Plot**: Galvanostatic cycling (GC), cyclic voltammetry (CV), differential capacity (dQdV), capacity per cycle (CPC) with multi-file support
|
|
62
|
+
- **1D XY plot**: Designed for XRD, PDF, XAS (XANES/EXAFS) but also support other types
|
|
63
|
+
- **Operando Contour plot**: Correlate in-situ characterizations (XRD/PDF/XAS) with electrochemical data
|
|
63
64
|
- **Interactive plotting**: Real-time editing customized for each type of plottings
|
|
64
65
|
- **Session Persistence**: Save and reload complete plot states with `.pkl` files
|
|
65
66
|
- **Style Management**: Import/export plot styles as `.bps`/`.bpsg` files
|
|
66
67
|
- **Batch Processing**: Export each file separately with `--all`
|
|
68
|
+
- **Column preview**: `--showcol` prints numbered columns, header names when found, and the first 10 values per column (CSV, Excel, text, .mpt, .brml, Bruker .raw, etc.)
|
|
67
69
|
|
|
68
70
|
## Installation
|
|
69
71
|
|
|
@@ -249,6 +251,23 @@ batplot custom.mpt --gc --pw 0.01 3 --cd 0.2 --i
|
|
|
249
251
|
|
|
250
252
|
## Operando Mode
|
|
251
253
|
|
|
254
|
+
Contour plots from a folder of diffraction data, optionally with an electrochemistry side panel.
|
|
255
|
+
|
|
256
|
+
### Bruker operando (.brml)
|
|
257
|
+
|
|
258
|
+
For Bruker operando XRD (multi-scan .brml files named cyc1, cyc2, cyc3, etc.):
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
# Place .brml files (e.g. RA_O5_cyc1.brml, RA_O5_cyc2.brml) in the folder
|
|
262
|
+
# Use --wl for Q conversion (e.g. synchrotron λ=0.709 Å)
|
|
263
|
+
batplot RA_O5 --operando --wl 0.709 --i
|
|
264
|
+
|
|
265
|
+
# EC side panel: .mpt or Biologic DataLogger CSV (*--DataLogger.csv), sorted by cyc
|
|
266
|
+
# Time vs potential is concatenated across files (continuous time axis)
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### Standard XY files
|
|
270
|
+
|
|
252
271
|
```bash
|
|
253
272
|
# Contour from folder of .xy/.xye/.qye/.dat
|
|
254
273
|
batplot --operando --wl 1.54 --i
|
|
@@ -313,8 +332,9 @@ batplot --all --readcol 2 3 style.bps --xaxis 2theta
|
|
|
313
332
|
|
|
314
333
|
| Type | Formats |
|
|
315
334
|
|------|---------|
|
|
316
|
-
| **Electrochemistry** | `.csv` (Neware), `.mpt` (Biologic), `.xlsx` (Landt/Lanhe CPC) |
|
|
335
|
+
| **Electrochemistry** | `.csv` (Neware, Biologic DataLogger), `.mpt` (Biologic), `.xlsx` (Landt/Lanhe CPC) |
|
|
317
336
|
| **XRD / PDF** | `.xye`, `.xy`, `.qye`, `.dat`, `.csv`, `.txt`; Bruker `.brml`, `.raw` |
|
|
337
|
+
| **Operando** | `.xy`, `.xye`, `.qye`, `.dat`; Bruker `.brml` (cyc1/cyc2/cyc3); EC: `.mpt` or DataLogger `.csv` |
|
|
318
338
|
| **XAS** | `.nor`, `.chik`, `.chir` |
|
|
319
339
|
| **Generic** | Use `--readcol` and `--xaxis` for custom formats |
|
|
320
340
|
|
|
@@ -324,9 +344,11 @@ batplot --all --readcol 2 3 style.bps --xaxis 2theta
|
|
|
324
344
|
|
|
325
345
|
With `--interactive`:
|
|
326
346
|
- **Cycle/Scan Control**: Toggle visibility, change colors
|
|
347
|
+
- **Multi-file palette (EC/CV/dQdV)**: Press `c`, then type `fall viridis` (all files), `f1-5 viridis` (files 1–5), or `f1 f3 f5 4` (each file gets one color)
|
|
348
|
+
- **CPC file palette**: In `ly`/`ry` color submenu, apply palette to file range: `1-5 viridis`, `1 3 5 4`
|
|
327
349
|
- **Styling**: Line widths, markers, fonts
|
|
328
350
|
- **Axes**: Labels, limits, ticks, spine styles
|
|
329
|
-
- **Export**: Sessions (`.pkl`), styles (`.bps`/`.bpsg`), high-res images
|
|
351
|
+
- **Export**: Sessions (`.pkl`), styles (`.bps`/`.bpsg`), high-res images. Colors persist via `p` (print style), `i` (import), `s` (save session), `b` (undo)
|
|
330
352
|
- **Live Preview**: All changes update in real-time
|
|
331
353
|
|
|
332
354
|
---
|
|
@@ -6,13 +6,15 @@
|
|
|
6
6
|
|
|
7
7
|
## Features
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
9
|
+
With a single line of command to easily plot publication-ready plots with customized, intuitive interactive editing features such as:
|
|
10
|
+
- **Electrochemistry Plot**: Galvanostatic cycling (GC), cyclic voltammetry (CV), differential capacity (dQdV), capacity per cycle (CPC) with multi-file support
|
|
11
|
+
- **1D XY plot**: Designed for XRD, PDF, XAS (XANES/EXAFS) but also support other types
|
|
12
|
+
- **Operando Contour plot**: Correlate in-situ characterizations (XRD/PDF/XAS) with electrochemical data
|
|
12
13
|
- **Interactive plotting**: Real-time editing customized for each type of plottings
|
|
13
14
|
- **Session Persistence**: Save and reload complete plot states with `.pkl` files
|
|
14
15
|
- **Style Management**: Import/export plot styles as `.bps`/`.bpsg` files
|
|
15
16
|
- **Batch Processing**: Export each file separately with `--all`
|
|
17
|
+
- **Column preview**: `--showcol` prints numbered columns, header names when found, and the first 10 values per column (CSV, Excel, text, .mpt, .brml, Bruker .raw, etc.)
|
|
16
18
|
|
|
17
19
|
## Installation
|
|
18
20
|
|
|
@@ -198,6 +200,23 @@ batplot custom.mpt --gc --pw 0.01 3 --cd 0.2 --i
|
|
|
198
200
|
|
|
199
201
|
## Operando Mode
|
|
200
202
|
|
|
203
|
+
Contour plots from a folder of diffraction data, optionally with an electrochemistry side panel.
|
|
204
|
+
|
|
205
|
+
### Bruker operando (.brml)
|
|
206
|
+
|
|
207
|
+
For Bruker operando XRD (multi-scan .brml files named cyc1, cyc2, cyc3, etc.):
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
# Place .brml files (e.g. RA_O5_cyc1.brml, RA_O5_cyc2.brml) in the folder
|
|
211
|
+
# Use --wl for Q conversion (e.g. synchrotron λ=0.709 Å)
|
|
212
|
+
batplot RA_O5 --operando --wl 0.709 --i
|
|
213
|
+
|
|
214
|
+
# EC side panel: .mpt or Biologic DataLogger CSV (*--DataLogger.csv), sorted by cyc
|
|
215
|
+
# Time vs potential is concatenated across files (continuous time axis)
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### Standard XY files
|
|
219
|
+
|
|
201
220
|
```bash
|
|
202
221
|
# Contour from folder of .xy/.xye/.qye/.dat
|
|
203
222
|
batplot --operando --wl 1.54 --i
|
|
@@ -262,8 +281,9 @@ batplot --all --readcol 2 3 style.bps --xaxis 2theta
|
|
|
262
281
|
|
|
263
282
|
| Type | Formats |
|
|
264
283
|
|------|---------|
|
|
265
|
-
| **Electrochemistry** | `.csv` (Neware), `.mpt` (Biologic), `.xlsx` (Landt/Lanhe CPC) |
|
|
284
|
+
| **Electrochemistry** | `.csv` (Neware, Biologic DataLogger), `.mpt` (Biologic), `.xlsx` (Landt/Lanhe CPC) |
|
|
266
285
|
| **XRD / PDF** | `.xye`, `.xy`, `.qye`, `.dat`, `.csv`, `.txt`; Bruker `.brml`, `.raw` |
|
|
286
|
+
| **Operando** | `.xy`, `.xye`, `.qye`, `.dat`; Bruker `.brml` (cyc1/cyc2/cyc3); EC: `.mpt` or DataLogger `.csv` |
|
|
267
287
|
| **XAS** | `.nor`, `.chik`, `.chir` |
|
|
268
288
|
| **Generic** | Use `--readcol` and `--xaxis` for custom formats |
|
|
269
289
|
|
|
@@ -273,9 +293,11 @@ batplot --all --readcol 2 3 style.bps --xaxis 2theta
|
|
|
273
293
|
|
|
274
294
|
With `--interactive`:
|
|
275
295
|
- **Cycle/Scan Control**: Toggle visibility, change colors
|
|
296
|
+
- **Multi-file palette (EC/CV/dQdV)**: Press `c`, then type `fall viridis` (all files), `f1-5 viridis` (files 1–5), or `f1 f3 f5 4` (each file gets one color)
|
|
297
|
+
- **CPC file palette**: In `ly`/`ry` color submenu, apply palette to file range: `1-5 viridis`, `1 3 5 4`
|
|
276
298
|
- **Styling**: Line widths, markers, fonts
|
|
277
299
|
- **Axes**: Labels, limits, ticks, spine styles
|
|
278
|
-
- **Export**: Sessions (`.pkl`), styles (`.bps`/`.bpsg`), high-res images
|
|
300
|
+
- **Export**: Sessions (`.pkl`), styles (`.bps`/`.bpsg`), high-res images. Colors persist via `p` (print style), `i` (import), `s` (save session), `b` (undo)
|
|
279
301
|
- **Live Preview**: All changes update in real-time
|
|
280
302
|
|
|
281
303
|
---
|
|
@@ -135,7 +135,7 @@ def _print_general_help() -> None:
|
|
|
135
135
|
"What it does:\n"
|
|
136
136
|
" • XY: XRD/PDF/XAS/User defined curves\n"
|
|
137
137
|
" • EC: Galvanostatic cycling(GC)/Capacity per cycle(CPC)/Diffrential capacity(dQdV)/Cyclic Voltammetry(CV) from Neware (.csv) or Biologic (.mpt)\n"
|
|
138
|
-
" • Operando: contour
|
|
138
|
+
" • Operando: contour from .xy/.xye/.dat/.brml; Bruker .brml (cyc1/cyc2/cyc3) with optional .mpt or DataLogger CSV side panel\n"
|
|
139
139
|
" • Batch: export vector plots for all files in a directory\n"
|
|
140
140
|
" • Interactive mode: --i flag opens a menu for styling, ranges, export, and save\n\n"
|
|
141
141
|
"How to run (basics):\n"
|
|
@@ -156,7 +156,8 @@ def _print_general_help() -> None:
|
|
|
156
156
|
" batplot --cv file.mpt --i # Cyclic voltammetry\n"
|
|
157
157
|
" batplot --cpc file.csv --mass 3.52 --i # Capacity per cycle\n\n"
|
|
158
158
|
" [Operando]\n"
|
|
159
|
-
" batplot --operando --i [FOLDER] # Contour from folder\n
|
|
159
|
+
" batplot --operando --i [FOLDER] # Contour from folder\n"
|
|
160
|
+
" batplot Path/to/file --operando --wl 0.709 --i # Bruker .brml, Q conversion\n\n"
|
|
160
161
|
"Features:\n"
|
|
161
162
|
" • Interactive (--i): styling, ranges, fonts, export, sessions\n"
|
|
162
163
|
" • XRD wavelength: --wl 1.54 or file.xye:1.5406 for Q conversion\n"
|
|
@@ -167,6 +168,7 @@ def _print_general_help() -> None:
|
|
|
167
168
|
|
|
168
169
|
"More help:\n"
|
|
169
170
|
" batplot --version # Version and release info (with option to show full release notes)\n"
|
|
171
|
+
" batplot --showcol FILE [FILE...] # Preview column names + first 10 values per column\n"
|
|
170
172
|
" batplot --help # This help\n"
|
|
171
173
|
" batplot --help xy # XY file plotting guide\n"
|
|
172
174
|
" batplot --help ec # Electrochemistry (GC/dQdV/CV/CPC) guide\n"
|
|
@@ -230,6 +232,8 @@ def _print_xy_help() -> None:
|
|
|
230
232
|
" Works with --readcol for custom column layout (per-file, per-ext, or global):\n"
|
|
231
233
|
" batplot data.csv --readcol 3 4 --convert 1.54 q\n"
|
|
232
234
|
" batplot f1.txt --readcol 2 3 f2.txt --readcol 5 6 --convert 1.54 q\n"
|
|
235
|
+
" Directory: pass a folder to convert all .xy/.xye/.qye/.dat/.csv/.txt files:\n"
|
|
236
|
+
" batplot /path/to/folder --convert 0.25448 1.54\n"
|
|
233
237
|
" Examples:\n"
|
|
234
238
|
" batplot file.xye --convert 1.54 0.25\n"
|
|
235
239
|
" batplot file.xye --convert 1.54 q\n"
|
|
@@ -313,8 +317,11 @@ def _print_ec_help() -> None:
|
|
|
313
317
|
" batplot file1.csv file2.csv ./Style/style.bps --dqdv # Style from relative path\n"
|
|
314
318
|
" batplot file1.csv file2.mpt style.bpsg --cpc --mass 6 # CPC mode\n"
|
|
315
319
|
" batplot file1.csv file2.mpt ./Style/style.bpsg --cpc --mass 6 # Style+geom from relative path\n\n"
|
|
320
|
+
"Multi-file (EC/CV/dQdV): Press c, then type fall viridis (all files), f1-5 viridis (files 1–5), or f1 f3 f5 4.\n"
|
|
321
|
+
"CPC (ly/ry): Type 1-5 viridis or 1 3 5 4 for file range. Exported via p, restored via i/s/b.\n\n"
|
|
316
322
|
"Interactive (--i): choose cycles, colors/palettes, line widths, axis scales (linear/log/symlog),\n"
|
|
317
323
|
"rename axes, toggle ticks/titles/spines, print/export/import style (.bps/.bpsg), save session (.pkl).\n"
|
|
324
|
+
"Multi-file: In c (cycles/colors), type fall viridis (all files), f1-5 viridis (files 1–5), or f1 f3 f5 4 (files 1,3,5).\n"
|
|
318
325
|
"Note: Batch mode (--all) exports SVG files automatically; --i is for single-file plotting only.\n\n"
|
|
319
326
|
"Axis swapping:\n"
|
|
320
327
|
" --ro : swap x and y axes (exchange x and y values before plotting)\n"
|
|
@@ -333,7 +340,14 @@ def _print_op_help() -> None:
|
|
|
333
340
|
" batplot --operando --xaxis 2theta # Using 2theta axis\n"
|
|
334
341
|
" batplot --operando --1d --i # Plot derivatives as contour with interactive menu\n"
|
|
335
342
|
" batplot --operando --2d --i # Plot derivatives (alias for --1d)\n\n"
|
|
336
|
-
"
|
|
343
|
+
"Bruker operando (.brml):\n"
|
|
344
|
+
" • Place .brml files (e.g. XX_cyc1.brml, XX_cyc2.brml) in the folder.\n"
|
|
345
|
+
" • Each .brml is expanded into per-scan rows; files sorted by cyc1/cyc2/cyc3.\n"
|
|
346
|
+
" • Use --wl for Q conversion: batplot RA_O5 --operando --wl 0.709 --i\n"
|
|
347
|
+
" • EC side panel: .mpt or Biologic DataLogger CSV (*--DataLogger.csv), sorted by cyc.\n"
|
|
348
|
+
" • Time vs potential is concatenated across files (continuous time axis).\n\n"
|
|
349
|
+
"Standard XY files:\n"
|
|
350
|
+
" • Folder should contain .xy/.xye/.qye/.dat files.\n"
|
|
337
351
|
" • Intensity scale is auto-adjusted between min/max values.\n"
|
|
338
352
|
" • If no .qye present, provide --xaxis 2theta or set --wl for Q conversion.\n"
|
|
339
353
|
" • If a .mpt file is present, a side panel is added for dual-panel mode (time/potential/temp/etc.).\n"
|
|
@@ -404,6 +418,11 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
404
418
|
help=argparse.SUPPRESS) # SUPPRESS hides from auto-generated help
|
|
405
419
|
parser.add_argument("--version", action="store_true", dest="version",
|
|
406
420
|
help="Show version and current release info, then exit.")
|
|
421
|
+
parser.add_argument(
|
|
422
|
+
"--showcol",
|
|
423
|
+
action="store_true",
|
|
424
|
+
help=argparse.SUPPRESS,
|
|
425
|
+
)
|
|
407
426
|
parser.add_argument("--manual", action="store_true", help=argparse.SUPPRESS)
|
|
408
427
|
|
|
409
428
|
# ====================================================================
|
|
@@ -425,6 +444,8 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
425
444
|
parser.add_argument("--xaxis", type=str, help=argparse.SUPPRESS)
|
|
426
445
|
parser.add_argument("--convert", nargs=2, metavar=("FROM", "TO"),
|
|
427
446
|
help="Convert XRD data: wavelength-to-wavelength (e.g., 1.54 0.25), wavelength-to-Q (e.g., 1.54 q), or Q-to-wavelength (e.g., q 1.54). Exports to 'converted' subfolder.")
|
|
447
|
+
parser.add_argument("--extract-brml-scans", nargs="?", const="", metavar="OUT_DIR",
|
|
448
|
+
help="Extract each XRD scan from .brml file to separate .xy files. Optional OUT_DIR (default: <brml_stem>_scans).")
|
|
428
449
|
parser.add_argument("--wl", type=float, help=argparse.SUPPRESS)
|
|
429
450
|
parser.add_argument("--fullprof", nargs="+", type=float, help=argparse.SUPPRESS)
|
|
430
451
|
parser.add_argument("--norm", action="store_true", help=argparse.SUPPRESS)
|
|
@@ -478,6 +499,8 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
478
499
|
help=argparse.SUPPRESS)
|
|
479
500
|
parser.add_argument("--1d", action="store_true", dest="derivative_1d", help=argparse.SUPPRESS)
|
|
480
501
|
parser.add_argument("--2d", action="store_true", dest="derivative_2d", help=argparse.SUPPRESS)
|
|
502
|
+
parser.add_argument("--canvas", action="store_true", dest="canvas",
|
|
503
|
+
help="Canvas mode: combine multiple .pkl sessions into one layout. Use numbers to edit each panel.")
|
|
481
504
|
return parser
|
|
482
505
|
|
|
483
506
|
|
|
@@ -530,9 +553,11 @@ def parse_args(argv=None):
|
|
|
530
553
|
if argv is None:
|
|
531
554
|
argv = sys.argv[1:]
|
|
532
555
|
|
|
533
|
-
# Normalize
|
|
556
|
+
# Normalize short forms to long forms (both -x and --x for common flags)
|
|
534
557
|
_SHORT_TO_LONG = {
|
|
535
|
-
'-h': '--help', '
|
|
558
|
+
'-h': '--help', '--h': '--help',
|
|
559
|
+
'-v': '--version', '-V': '--version', '--v': '--version',
|
|
560
|
+
'-m': '--manual', '--m': '--manual',
|
|
536
561
|
'-i': '--i', '-d': '--delta', '-r': '--xrange', '-o': '--out', '-c': '--convert',
|
|
537
562
|
'-b': '--b',
|
|
538
563
|
}
|
|
@@ -674,13 +699,13 @@ def parse_args(argv=None):
|
|
|
674
699
|
ns, _unknown = parser.parse_known_args(argv)
|
|
675
700
|
if getattr(ns, "manual", False):
|
|
676
701
|
try:
|
|
677
|
-
from .manual import
|
|
678
|
-
|
|
702
|
+
from .manual import open_manual_url # Lazy import avoids matplotlib startup unless needed
|
|
703
|
+
open_manual_url()
|
|
679
704
|
if _HAS_RICH and _console:
|
|
680
|
-
_console.print(
|
|
705
|
+
_console.print("\n[green]Opened manual in browser[/green]")
|
|
681
706
|
else:
|
|
682
|
-
print(
|
|
683
|
-
except Exception as exc: # pragma: no cover -
|
|
707
|
+
print("\nOpened manual in browser")
|
|
708
|
+
except Exception as exc: # pragma: no cover - best effort
|
|
684
709
|
if _HAS_RICH and _console:
|
|
685
710
|
_console.print(f"\n[red]Failed to open manual:[/red] {exc}")
|
|
686
711
|
else:
|
|
@@ -21,6 +21,9 @@ from .readers import (
|
|
|
21
21
|
read_ec_csv_dqdv_file,
|
|
22
22
|
compute_dqdv_numerical,
|
|
23
23
|
is_cs_b_format,
|
|
24
|
+
is_biologic_datalogger_csv,
|
|
25
|
+
read_biologic_datalogger_csv,
|
|
26
|
+
read_biologic_datalogger_dqdv_file,
|
|
24
27
|
_load_csv_header_and_rows,
|
|
25
28
|
read_biologic_txt_file,
|
|
26
29
|
)
|
|
@@ -1013,8 +1016,16 @@ def batch_process_ec(directory: str, args):
|
|
|
1013
1016
|
cap_x = specific_capacity
|
|
1014
1017
|
x_label = r'Specific Capacity (mAh g$^{-1}$)'
|
|
1015
1018
|
elif ext == '.csv':
|
|
1016
|
-
|
|
1017
|
-
|
|
1019
|
+
if is_biologic_datalogger_csv(fpath):
|
|
1020
|
+
if mass_mg is None:
|
|
1021
|
+
print(f" Skipped {fname}: GC mode (Biologic DataLogger CSV) requires --mass parameter")
|
|
1022
|
+
plt.close(fig_b)
|
|
1023
|
+
continue
|
|
1024
|
+
cap_x, voltage, cycle_numbers, charge_mask, discharge_mask = \
|
|
1025
|
+
read_biologic_datalogger_csv(fpath, mass_mg=mass_mg)
|
|
1026
|
+
else:
|
|
1027
|
+
cap_x, voltage, cycle_numbers, charge_mask, discharge_mask = \
|
|
1028
|
+
read_ec_csv_file(fpath, prefer_specific=True)
|
|
1018
1029
|
x_label = r'Specific Capacity (mAh g$^{-1}$)'
|
|
1019
1030
|
else:
|
|
1020
1031
|
raise ValueError(f"Unsupported file type for GC: {ext}")
|
|
@@ -1116,13 +1127,21 @@ def batch_process_ec(directory: str, args):
|
|
|
1116
1127
|
|
|
1117
1128
|
# Try to load pre-calculated dQ/dV columns; fall back to numerical computation
|
|
1118
1129
|
_b_dqdv_header = None
|
|
1119
|
-
try:
|
|
1120
|
-
_b_dqdv_header, _, _ = _load_csv_header_and_rows(fpath)
|
|
1121
|
-
except Exception:
|
|
1122
|
-
pass
|
|
1123
|
-
|
|
1124
1130
|
_b_loaded = False
|
|
1125
|
-
if
|
|
1131
|
+
if is_biologic_datalogger_csv(fpath):
|
|
1132
|
+
if mass_mg is None or mass_mg <= 0:
|
|
1133
|
+
print(f" Skipped {fname}: dQ/dV (Biologic DataLogger CSV) requires --mass parameter")
|
|
1134
|
+
plt.close(fig_b)
|
|
1135
|
+
continue
|
|
1136
|
+
voltage, dqdv, cycles, charge_mask, discharge_mask, y_label = \
|
|
1137
|
+
read_biologic_datalogger_dqdv_file(fpath, mass_mg=mass_mg, prefer_specific=True)
|
|
1138
|
+
_b_loaded = True
|
|
1139
|
+
else:
|
|
1140
|
+
try:
|
|
1141
|
+
_b_dqdv_header, _, _ = _load_csv_header_and_rows(fpath)
|
|
1142
|
+
except Exception:
|
|
1143
|
+
pass
|
|
1144
|
+
|
|
1126
1145
|
try:
|
|
1127
1146
|
voltage, dqdv, cycles, charge_mask, discharge_mask, y_label = \
|
|
1128
1147
|
read_ec_csv_dqdv_file(fpath, prefer_specific=True)
|