batplot 1.8.29__tar.gz → 1.8.30__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.
Files changed (42) hide show
  1. batplot-1.8.30/MANIFEST.in +2 -0
  2. {batplot-1.8.29/batplot.egg-info → batplot-1.8.30}/PKG-INFO +49 -42
  3. {batplot-1.8.29 → batplot-1.8.30}/README.md +48 -41
  4. {batplot-1.8.29 → batplot-1.8.30}/batplot/__init__.py +1 -1
  5. {batplot-1.8.29 → batplot-1.8.30}/batplot/args.py +10 -2
  6. {batplot-1.8.29 → batplot-1.8.30}/batplot/batch.py +4 -3
  7. {batplot-1.8.29 → batplot-1.8.30}/batplot/converters.py +3 -1
  8. {batplot-1.8.29 → batplot-1.8.30}/batplot/data/CHANGELOG.md +54 -38
  9. {batplot-1.8.29 → batplot-1.8.30}/batplot/dev_upgrade.py +4 -2
  10. {batplot-1.8.29 → batplot-1.8.30}/batplot/operando.py +8 -3
  11. {batplot-1.8.29 → batplot-1.8.30}/batplot/operando_ec_interactive.py +2 -2
  12. {batplot-1.8.29 → batplot-1.8.30}/batplot/readers.py +92 -50
  13. {batplot-1.8.29 → batplot-1.8.30}/batplot/version_check.py +3 -5
  14. {batplot-1.8.29 → batplot-1.8.30/batplot.egg-info}/PKG-INFO +49 -42
  15. {batplot-1.8.29 → batplot-1.8.30}/batplot.egg-info/SOURCES.txt +1 -2
  16. {batplot-1.8.29 → batplot-1.8.30}/pyproject.toml +2 -2
  17. batplot-1.8.30/setup.py +3 -0
  18. batplot-1.8.29/MANIFEST.in +0 -2
  19. batplot-1.8.29/batplot/data/USER_MANUAL.md +0 -623
  20. batplot-1.8.29/setup.py +0 -3
  21. {batplot-1.8.29 → batplot-1.8.30}/LICENSE +0 -0
  22. {batplot-1.8.29 → batplot-1.8.30}/NOTICE +0 -0
  23. {batplot-1.8.29 → batplot-1.8.30}/batplot/batplot.py +0 -0
  24. {batplot-1.8.29 → batplot-1.8.30}/batplot/cif.py +0 -0
  25. {batplot-1.8.29 → batplot-1.8.30}/batplot/cli.py +0 -0
  26. {batplot-1.8.29 → batplot-1.8.30}/batplot/color_utils.py +0 -0
  27. {batplot-1.8.29 → batplot-1.8.30}/batplot/config.py +0 -0
  28. {batplot-1.8.29 → batplot-1.8.30}/batplot/cpc_interactive.py +0 -0
  29. {batplot-1.8.29 → batplot-1.8.30}/batplot/electrochem_interactive.py +0 -0
  30. {batplot-1.8.29 → batplot-1.8.30}/batplot/interactive.py +0 -0
  31. {batplot-1.8.29 → batplot-1.8.30}/batplot/manual.py +0 -0
  32. {batplot-1.8.29 → batplot-1.8.30}/batplot/modes.py +0 -0
  33. {batplot-1.8.29 → batplot-1.8.30}/batplot/plotting.py +0 -0
  34. {batplot-1.8.29 → batplot-1.8.30}/batplot/session.py +0 -0
  35. {batplot-1.8.29 → batplot-1.8.30}/batplot/style.py +0 -0
  36. {batplot-1.8.29 → batplot-1.8.30}/batplot/ui.py +0 -0
  37. {batplot-1.8.29 → batplot-1.8.30}/batplot/utils.py +0 -0
  38. {batplot-1.8.29 → batplot-1.8.30}/batplot.egg-info/dependency_links.txt +0 -0
  39. {batplot-1.8.29 → batplot-1.8.30}/batplot.egg-info/entry_points.txt +0 -0
  40. {batplot-1.8.29 → batplot-1.8.30}/batplot.egg-info/requires.txt +0 -0
  41. {batplot-1.8.29 → batplot-1.8.30}/batplot.egg-info/top_level.txt +0 -0
  42. {batplot-1.8.29 → batplot-1.8.30}/setup.cfg +0 -0
@@ -0,0 +1,2 @@
1
+ include README.md LICENSE
2
+ recursive-include batplot/data CHANGELOG.md
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: batplot
3
- Version: 1.8.29
3
+ Version: 1.8.30
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
@@ -69,11 +69,14 @@ Dynamic: license-file
69
69
 
70
70
  ```bash
71
71
  pip install batplot
72
+ # It is recommended to use separate environment for batplot to aviod compatability issues with dependencies.
72
73
  ```
73
74
 
74
75
  ## Quick Start
75
76
 
76
- Tutorial: https://drive.google.com/file/d/1NTFJWNBbWW4mgz0H5ZelGjuOBWxoFgkr/view
77
+ - Tutorial: https://drive.google.com/file/d/1NTFJWNBbWW4mgz0H5ZelGjuOBWxoFgkr/view
78
+ - Tutorial files: https://github.com/chem-plot/batplot/blob/main/batplot_tutorial.zip
79
+ - Manual: https://github.com/chem-plot/batplot/blob/main/batplot_user_manual.pdf
77
80
 
78
81
  ---
79
82
 
@@ -88,12 +91,12 @@ In batplot, --xaxis is frequently used to indicate the data type.
88
91
  # Specify X-axis type (Q, 2theta, r, k, energy, time or any user defined names)
89
92
  # By defauly, batplot will skip the header lines, plot the first and second columns as x and y
90
93
  # Q and q are equivalent (case-insensitive)
91
- batplot pattern.xye --xaxis 2theta
92
- batplot data.qye --xaxis q
93
- batplot data.txt --xaxis whatever
94
+ batplot pattern.xye --xaxis 2theta --i
95
+ batplot data.qye --xaxis q --i
96
+ batplot data.txt --xaxis whatever --i
94
97
 
95
98
  # Set X-axis range
96
- batplot pattern.xye --xaxis 2theta --xrange 10 80
99
+ batplot pattern.xye --xaxis 2theta --xrange 10 80 --i
97
100
 
98
101
  # Save to file (default .svg if no extension)
99
102
  batplot pattern.xye --xaxis 2theta --out figure
@@ -104,10 +107,10 @@ batplot pattern.txt --xaxis Energy --out figure.png
104
107
 
105
108
  ```bash
106
109
  # Convert 2θ to Q using wavelength (Å), --xaxis is no longer needed as providing wavelength is implying that user wants to convert and plot the data in Q space
107
- batplot data.raw --wl 1.5406
110
+ batplot data.raw --wl 1.5406 --i
108
111
 
109
112
  # Per-file wavelength: file.xye:1.54, in this case --xaxis is also not needed and files will be plotted in Q space
110
- batplot scan1.brml:1.5406 scan2.xye:0.7093
113
+ batplot scan1.brml:1.5406 scan2.xye:0.7093 --i
111
114
 
112
115
  # Convert and export to converted/ subfolder (q and Q equivalent)
113
116
  batplot data.xye --convert 1.54 q
@@ -122,40 +125,40 @@ batplot f1.txt --readcol 2 3 f2.txt --readcol 5 6 --convert 1.54 q
122
125
 
123
126
  ```bash
124
127
  # Stack curves vertically (auto-normalizes)
125
- batplot file1.xy file2.xy --stack
128
+ batplot file1.xy file2.xy --stack --i
126
129
 
127
130
  # Control spacing between stacked curves
128
131
  batplot file1.xy file2.xy --stack --delta 0.15
129
132
 
130
133
  # Normalize intensity to 0–1 (without stacking)
131
- batplot file.xy --norm
134
+ batplot file.xy --norm --i
132
135
  ```
133
136
 
134
137
  ### Dual y-axis (right y-axis)
135
138
 
136
139
  ```bash
137
140
  # Plot selected files on the right y-axis (--ry disables --stack)
138
- batplot file1.xy --ry file2.xy --ry file3.xy file4.xy --ry --interactive
141
+ batplot file1.xy --ry file2.xy --ry file3.xy file4.xy --ry --i
139
142
  # Files 1, 2, 4 use right y-axis; file 3 uses left y-axis
140
143
 
141
144
  # With --txaxis: right y-axis curves use the top x-axis (default: shared bottom x)
142
- batplot file1.xy --ry file2.xy --txaxis --interactive
145
+ batplot file1.xy --ry file2.xy --txaxis --i
143
146
  ```
144
147
 
145
148
  ### Column selection and multi-curve
146
149
 
147
150
  ```bash
148
151
  # Read columns 2 and 3 as X, Y (1-indexed)
149
- batplot data.xy --readcol 2 3
152
+ batplot data.xy --readcol 2 3 --wl 1.54 --i
150
153
 
151
154
  # Per-file columns
152
- batplot file1.xy --readcol 2 3 file2.xy --readcol 4 5
155
+ batplot file1.xy --readcol 2 3 file2.xy --readcol 4 5 --xaxis r --i
153
156
 
154
157
  # Multiple curves from same file (cols 1,2 and 1,3)
155
- batplot data.xy --readcol 1 2 1 3
158
+ batplot data.xy --readcol 1 2 1 3 --xaxis 2theta --i
156
159
 
157
160
  # Range: col 1 as x, cols 2–20 as 19 y-curves
158
- batplot file.txt --readcol 1 2-20
161
+ batplot file.txt --readcol 1 2-20 --xaxis Energy --i
159
162
 
160
163
  # With --convert: use custom columns when converting XRD data
161
164
  batplot data.csv --readcol 3 4 --convert 1.54 q
@@ -165,10 +168,10 @@ batplot data.csv --readcol 3 4 --convert 1.54 q
165
168
 
166
169
  ```bash
167
170
  # Plot first derivative (dy/dx)
168
- batplot file.xy --1d --stack
171
+ batplot file.xy --1d --stack --i
169
172
 
170
173
  # EXAFS k-weighting
171
- batplot data.chik --chik # χ(k)
174
+ batplot data.chik --chik --i # χ(k)
172
175
  batplot data.chik --k2chik # k²χ(k), most common
173
176
  batplot data.chik --k3chik --xrange 2 12
174
177
  ```
@@ -177,9 +180,9 @@ batplot data.chik --k3chik --xrange 2 12
177
180
 
178
181
  ```bash
179
182
  # Open interactive menu for styling, ranges, export, session save
180
- batplot pattern.xye --interactive
181
- batplot file1.xy file2.xy --stack --interactive
182
- batplot allfiles --xaxis 2theta --xrange 15 75 --interactive
183
+ batplot pattern.xye --i
184
+ batplot file1.xy file2.xy --stack --i
185
+ batplot allfiles --xaxis 2theta --xrange 15 75 --i
183
186
  ```
184
187
 
185
188
  ---
@@ -197,52 +200,49 @@ GC mode plots potential vs. capacity for each charge/discharge cycle—the prima
197
200
 
198
201
  ```bash
199
202
  # From .csv (capacity in file)
200
- batplot battery.csv --gc
203
+ batplot battery.csv --gc --i
201
204
 
202
205
  # From .mpt (requires --mass in mg)
203
- batplot battery.mpt --gc --mass 7.0
206
+ batplot battery.mpt --gc --mass 7.0 --i
204
207
 
205
- # With interactive menu
206
- batplot battery.csv --gc --interactive
207
208
  ```
208
209
 
209
210
  ### Cyclic voltammetry (CV)
210
211
 
211
212
  ```bash
212
- batplot cyclic.mpt --cv
213
- batplot cyclic.mpt --cv --interactive
213
+ batplot cyclic.mpt --cv --i
214
+ batplot cyclic.mpt --cv --i
214
215
  ```
215
216
 
216
217
  ### Differential capacity (dQ/dV)
217
218
 
218
219
  ```bash
219
- batplot battery.csv --dqdv
220
- batplot battery.csv --dqdv --interactive
220
+ batplot battery.csv --dqdv --i
221
221
  ```
222
222
 
223
223
  ### Capacity per cycle (CPC)
224
224
 
225
225
  ```bash
226
226
  # Single file
227
- batplot stability.csv --cpc
228
- batplot stability.mpt --cpc --mass 5.4
227
+ batplot stability.csv --cpc --i
228
+ batplot stability.mpt --cpc --mass 5.4 --i
229
229
 
230
230
  # Multiple files with individual colors
231
- batplot file1.csv file2.mpt --cpc --mass 6.0 --interactive
231
+ batplot file1.csv file2.mpt --cpc --mass 6.0 --i
232
232
  ```
233
233
 
234
234
  ### Time vs potential
235
235
 
236
236
  ```bash
237
237
  # Plot time (h) vs potential from CSV/MPT
238
- batplot battery.csv --xaxis time --interactive
238
+ batplot battery.csv --xaxis time --i
239
239
  ```
240
240
 
241
241
  ### Potential window (custom potential–time .mpt)
242
242
 
243
243
  ```bash
244
244
  # Two columns: potential, time. Use --pw and --cd to plot as GC
245
- batplot custom.mpt --gc --pw 0.01 3 --cd 0.2 --interactive
245
+ batplot custom.mpt --gc --pw 0.01 3 --cd 0.2 --i
246
246
  ```
247
247
 
248
248
  ---
@@ -251,21 +251,28 @@ batplot custom.mpt --gc --pw 0.01 3 --cd 0.2 --interactive
251
251
 
252
252
  ```bash
253
253
  # Contour from folder of .xy/.xye/.qye/.dat
254
- batplot --operando --interactive
254
+ batplot --operando --wl 1.54 --i
255
255
 
256
256
  # With folder path
257
- batplot /path/to/data --operando --interactive
257
+ batplot /path/to/data --operando --xaxis 2theta --i
258
258
 
259
259
  # Q conversion from 2θ
260
- batplot --operando --wl 0.25995 --interactive
260
+ batplot --operando --wl 0.25995 --i
261
+
262
+ # Column selection: --readcolc for contour, --readcols for side panel (.mpt)
263
+ batplot --operando --readcolc 2 3 --readcols 1 2 --i
261
264
 
262
265
  # Derivative contour
263
- batplot --operando --1d --interactive
266
+ batplot --operando --1d --i
264
267
 
265
268
  # With CIF tick labels
266
- batplot folder phase.cif:1.54 --operando --interactive
269
+ batplot folder phase.cif:1.54 --operando --i
267
270
  ```
268
271
 
272
+ Operando column selection:
273
+ - `--readcolc <x> <y>`: columns for the contour plot (from .xy/.xye/.qye/.dat files)
274
+ - `--readcols <x> <y>`: columns for the side panel (from .mpt file)
275
+
269
276
  ---
270
277
 
271
278
  ## Plotting multiple files
@@ -273,14 +280,14 @@ batplot folder phase.cif:1.54 --operando --interactive
273
280
  ```bash
274
281
  # All XY files in current directory on same figure
275
282
  batplot allfiles
276
- batplot allfiles --stack --interactive
283
+ batplot allfiles --stack --i
277
284
 
278
285
  # Only specific extension (natural-sorted)
279
286
  batplot allxyfiles
280
- batplot "/path/to/data" allnorfiles --interactive
287
+ batplot "/path/to/data" allnorfiles --i
281
288
 
282
289
  # Explicit file list
283
- batplot file1.xye file2.qye structure.cif:1.54 --stack --interactive
290
+ batplot file1.xye file2.qye structure.cif:1.54 --stack --i
284
291
  ```
285
292
 
286
293
  ---
@@ -18,11 +18,14 @@
18
18
 
19
19
  ```bash
20
20
  pip install batplot
21
+ # It is recommended to use separate environment for batplot to aviod compatability issues with dependencies.
21
22
  ```
22
23
 
23
24
  ## Quick Start
24
25
 
25
- Tutorial: https://drive.google.com/file/d/1NTFJWNBbWW4mgz0H5ZelGjuOBWxoFgkr/view
26
+ - Tutorial: https://drive.google.com/file/d/1NTFJWNBbWW4mgz0H5ZelGjuOBWxoFgkr/view
27
+ - Tutorial files: https://github.com/chem-plot/batplot/blob/main/batplot_tutorial.zip
28
+ - Manual: https://github.com/chem-plot/batplot/blob/main/batplot_user_manual.pdf
26
29
 
27
30
  ---
28
31
 
@@ -37,12 +40,12 @@ In batplot, --xaxis is frequently used to indicate the data type.
37
40
  # Specify X-axis type (Q, 2theta, r, k, energy, time or any user defined names)
38
41
  # By defauly, batplot will skip the header lines, plot the first and second columns as x and y
39
42
  # Q and q are equivalent (case-insensitive)
40
- batplot pattern.xye --xaxis 2theta
41
- batplot data.qye --xaxis q
42
- batplot data.txt --xaxis whatever
43
+ batplot pattern.xye --xaxis 2theta --i
44
+ batplot data.qye --xaxis q --i
45
+ batplot data.txt --xaxis whatever --i
43
46
 
44
47
  # Set X-axis range
45
- batplot pattern.xye --xaxis 2theta --xrange 10 80
48
+ batplot pattern.xye --xaxis 2theta --xrange 10 80 --i
46
49
 
47
50
  # Save to file (default .svg if no extension)
48
51
  batplot pattern.xye --xaxis 2theta --out figure
@@ -53,10 +56,10 @@ batplot pattern.txt --xaxis Energy --out figure.png
53
56
 
54
57
  ```bash
55
58
  # Convert 2θ to Q using wavelength (Å), --xaxis is no longer needed as providing wavelength is implying that user wants to convert and plot the data in Q space
56
- batplot data.raw --wl 1.5406
59
+ batplot data.raw --wl 1.5406 --i
57
60
 
58
61
  # Per-file wavelength: file.xye:1.54, in this case --xaxis is also not needed and files will be plotted in Q space
59
- batplot scan1.brml:1.5406 scan2.xye:0.7093
62
+ batplot scan1.brml:1.5406 scan2.xye:0.7093 --i
60
63
 
61
64
  # Convert and export to converted/ subfolder (q and Q equivalent)
62
65
  batplot data.xye --convert 1.54 q
@@ -71,40 +74,40 @@ batplot f1.txt --readcol 2 3 f2.txt --readcol 5 6 --convert 1.54 q
71
74
 
72
75
  ```bash
73
76
  # Stack curves vertically (auto-normalizes)
74
- batplot file1.xy file2.xy --stack
77
+ batplot file1.xy file2.xy --stack --i
75
78
 
76
79
  # Control spacing between stacked curves
77
80
  batplot file1.xy file2.xy --stack --delta 0.15
78
81
 
79
82
  # Normalize intensity to 0–1 (without stacking)
80
- batplot file.xy --norm
83
+ batplot file.xy --norm --i
81
84
  ```
82
85
 
83
86
  ### Dual y-axis (right y-axis)
84
87
 
85
88
  ```bash
86
89
  # Plot selected files on the right y-axis (--ry disables --stack)
87
- batplot file1.xy --ry file2.xy --ry file3.xy file4.xy --ry --interactive
90
+ batplot file1.xy --ry file2.xy --ry file3.xy file4.xy --ry --i
88
91
  # Files 1, 2, 4 use right y-axis; file 3 uses left y-axis
89
92
 
90
93
  # With --txaxis: right y-axis curves use the top x-axis (default: shared bottom x)
91
- batplot file1.xy --ry file2.xy --txaxis --interactive
94
+ batplot file1.xy --ry file2.xy --txaxis --i
92
95
  ```
93
96
 
94
97
  ### Column selection and multi-curve
95
98
 
96
99
  ```bash
97
100
  # Read columns 2 and 3 as X, Y (1-indexed)
98
- batplot data.xy --readcol 2 3
101
+ batplot data.xy --readcol 2 3 --wl 1.54 --i
99
102
 
100
103
  # Per-file columns
101
- batplot file1.xy --readcol 2 3 file2.xy --readcol 4 5
104
+ batplot file1.xy --readcol 2 3 file2.xy --readcol 4 5 --xaxis r --i
102
105
 
103
106
  # Multiple curves from same file (cols 1,2 and 1,3)
104
- batplot data.xy --readcol 1 2 1 3
107
+ batplot data.xy --readcol 1 2 1 3 --xaxis 2theta --i
105
108
 
106
109
  # Range: col 1 as x, cols 2–20 as 19 y-curves
107
- batplot file.txt --readcol 1 2-20
110
+ batplot file.txt --readcol 1 2-20 --xaxis Energy --i
108
111
 
109
112
  # With --convert: use custom columns when converting XRD data
110
113
  batplot data.csv --readcol 3 4 --convert 1.54 q
@@ -114,10 +117,10 @@ batplot data.csv --readcol 3 4 --convert 1.54 q
114
117
 
115
118
  ```bash
116
119
  # Plot first derivative (dy/dx)
117
- batplot file.xy --1d --stack
120
+ batplot file.xy --1d --stack --i
118
121
 
119
122
  # EXAFS k-weighting
120
- batplot data.chik --chik # χ(k)
123
+ batplot data.chik --chik --i # χ(k)
121
124
  batplot data.chik --k2chik # k²χ(k), most common
122
125
  batplot data.chik --k3chik --xrange 2 12
123
126
  ```
@@ -126,9 +129,9 @@ batplot data.chik --k3chik --xrange 2 12
126
129
 
127
130
  ```bash
128
131
  # Open interactive menu for styling, ranges, export, session save
129
- batplot pattern.xye --interactive
130
- batplot file1.xy file2.xy --stack --interactive
131
- batplot allfiles --xaxis 2theta --xrange 15 75 --interactive
132
+ batplot pattern.xye --i
133
+ batplot file1.xy file2.xy --stack --i
134
+ batplot allfiles --xaxis 2theta --xrange 15 75 --i
132
135
  ```
133
136
 
134
137
  ---
@@ -146,52 +149,49 @@ GC mode plots potential vs. capacity for each charge/discharge cycle—the prima
146
149
 
147
150
  ```bash
148
151
  # From .csv (capacity in file)
149
- batplot battery.csv --gc
152
+ batplot battery.csv --gc --i
150
153
 
151
154
  # From .mpt (requires --mass in mg)
152
- batplot battery.mpt --gc --mass 7.0
155
+ batplot battery.mpt --gc --mass 7.0 --i
153
156
 
154
- # With interactive menu
155
- batplot battery.csv --gc --interactive
156
157
  ```
157
158
 
158
159
  ### Cyclic voltammetry (CV)
159
160
 
160
161
  ```bash
161
- batplot cyclic.mpt --cv
162
- batplot cyclic.mpt --cv --interactive
162
+ batplot cyclic.mpt --cv --i
163
+ batplot cyclic.mpt --cv --i
163
164
  ```
164
165
 
165
166
  ### Differential capacity (dQ/dV)
166
167
 
167
168
  ```bash
168
- batplot battery.csv --dqdv
169
- batplot battery.csv --dqdv --interactive
169
+ batplot battery.csv --dqdv --i
170
170
  ```
171
171
 
172
172
  ### Capacity per cycle (CPC)
173
173
 
174
174
  ```bash
175
175
  # Single file
176
- batplot stability.csv --cpc
177
- batplot stability.mpt --cpc --mass 5.4
176
+ batplot stability.csv --cpc --i
177
+ batplot stability.mpt --cpc --mass 5.4 --i
178
178
 
179
179
  # Multiple files with individual colors
180
- batplot file1.csv file2.mpt --cpc --mass 6.0 --interactive
180
+ batplot file1.csv file2.mpt --cpc --mass 6.0 --i
181
181
  ```
182
182
 
183
183
  ### Time vs potential
184
184
 
185
185
  ```bash
186
186
  # Plot time (h) vs potential from CSV/MPT
187
- batplot battery.csv --xaxis time --interactive
187
+ batplot battery.csv --xaxis time --i
188
188
  ```
189
189
 
190
190
  ### Potential window (custom potential–time .mpt)
191
191
 
192
192
  ```bash
193
193
  # Two columns: potential, time. Use --pw and --cd to plot as GC
194
- batplot custom.mpt --gc --pw 0.01 3 --cd 0.2 --interactive
194
+ batplot custom.mpt --gc --pw 0.01 3 --cd 0.2 --i
195
195
  ```
196
196
 
197
197
  ---
@@ -200,21 +200,28 @@ batplot custom.mpt --gc --pw 0.01 3 --cd 0.2 --interactive
200
200
 
201
201
  ```bash
202
202
  # Contour from folder of .xy/.xye/.qye/.dat
203
- batplot --operando --interactive
203
+ batplot --operando --wl 1.54 --i
204
204
 
205
205
  # With folder path
206
- batplot /path/to/data --operando --interactive
206
+ batplot /path/to/data --operando --xaxis 2theta --i
207
207
 
208
208
  # Q conversion from 2θ
209
- batplot --operando --wl 0.25995 --interactive
209
+ batplot --operando --wl 0.25995 --i
210
+
211
+ # Column selection: --readcolc for contour, --readcols for side panel (.mpt)
212
+ batplot --operando --readcolc 2 3 --readcols 1 2 --i
210
213
 
211
214
  # Derivative contour
212
- batplot --operando --1d --interactive
215
+ batplot --operando --1d --i
213
216
 
214
217
  # With CIF tick labels
215
- batplot folder phase.cif:1.54 --operando --interactive
218
+ batplot folder phase.cif:1.54 --operando --i
216
219
  ```
217
220
 
221
+ Operando column selection:
222
+ - `--readcolc <x> <y>`: columns for the contour plot (from .xy/.xye/.qye/.dat files)
223
+ - `--readcols <x> <y>`: columns for the side panel (from .mpt file)
224
+
218
225
  ---
219
226
 
220
227
  ## Plotting multiple files
@@ -222,14 +229,14 @@ batplot folder phase.cif:1.54 --operando --interactive
222
229
  ```bash
223
230
  # All XY files in current directory on same figure
224
231
  batplot allfiles
225
- batplot allfiles --stack --interactive
232
+ batplot allfiles --stack --i
226
233
 
227
234
  # Only specific extension (natural-sorted)
228
235
  batplot allxyfiles
229
- batplot "/path/to/data" allnorfiles --interactive
236
+ batplot "/path/to/data" allnorfiles --i
230
237
 
231
238
  # Explicit file list
232
- batplot file1.xye file2.qye structure.cif:1.54 --stack --interactive
239
+ batplot file1.xye file2.qye structure.cif:1.54 --stack --i
233
240
  ```
234
241
 
235
242
  ---
@@ -1,5 +1,5 @@
1
1
  """batplot: Interactive plotting for battery data visualization."""
2
2
 
3
- __version__ = "1.8.29"
3
+ __version__ = "1.8.30"
4
4
 
5
5
  __all__ = ["__version__"]
@@ -339,6 +339,10 @@ def _print_op_help() -> None:
339
339
  " • If a .mpt file is present, a side panel is added for dual-panel mode (time/potential/temp/etc.).\n"
340
340
  " • Without a .mpt file, operando-only mode shows the contour plot alone.\n"
341
341
  " • --1d / --2d: plot the first derivative (dy/dx) of each scan as a contour plot.\n\n"
342
+ "Column selection (operando-specific):\n"
343
+ " --readcolc <x> <y> : columns for contour plot (x,y in .xy/.xye/.qye/.dat files)\n"
344
+ " --readcols <x> <y> : columns for side panel (x,y in .mpt file)\n"
345
+ " Example: batplot --operando --readcolc 2 3 --readcols 1 2 --i\n\n"
342
346
  "Interactive (--i): menu has (Styles), (Operando), (Side Panel), (Options) columns.\n"
343
347
  "Resize axes/canvas, change colormap, set intensity range (oz), side-panel options,\n"
344
348
  "geometry tweaks, toggle spines/ticks/labels, print/export/import style, save session.\n"
@@ -468,6 +472,10 @@ def build_parser() -> argparse.ArgumentParser:
468
472
  help=argparse.SUPPRESS)
469
473
  parser.add_argument("--readcolcsv", nargs=2, type=int, metavar=('X_COL', 'Y_COL'),
470
474
  help=argparse.SUPPRESS)
475
+ parser.add_argument("--readcolc", nargs=2, type=int, metavar=('X_COL', 'Y_COL'),
476
+ help=argparse.SUPPRESS)
477
+ parser.add_argument("--readcols", nargs=2, type=int, metavar=('X_COL', 'Y_COL'),
478
+ help=argparse.SUPPRESS)
471
479
  parser.add_argument("--1d", action="store_true", dest="derivative_1d", help=argparse.SUPPRESS)
472
480
  parser.add_argument("--2d", action="store_true", dest="derivative_2d", help=argparse.SUPPRESS)
473
481
  return parser
@@ -541,8 +549,8 @@ def parse_args(argv=None):
541
549
  match = re.match(r'^--readcol([a-z0-9]+)$', arg)
542
550
  if match:
543
551
  ext = match.group(1) # Extract extension name
544
- # Skip predefined extensions (already in parser)
545
- if ext not in ['xy', 'xye', 'qye', 'nor', 'dat', 'csv']:
552
+ # Skip predefined extensions (already in parser) and operando-specific (readcolc, readcols)
553
+ if ext not in ['xy', 'xye', 'qye', 'nor', 'dat', 'csv', 'c', 's']:
546
554
  custom_readcol_exts.add(ext)
547
555
  i += 1
548
556
 
@@ -14,6 +14,7 @@ from .readers import (
14
14
  read_gr_file,
15
15
  read_xrd_vendor_file,
16
16
  is_bruker_raw,
17
+ loadtxt_with_decimal_comma,
17
18
  robust_loadtxt_skipheader,
18
19
  read_mpt_file,
19
20
  read_ec_csv_file,
@@ -593,20 +594,20 @@ def batch_process(directory: str, args):
593
594
  x, y = read_gr_file(fpath); e = None
594
595
  axis_mode = 'r'
595
596
  elif ext == '.nor':
596
- data = np.loadtxt(fpath, comments="#")
597
+ data = loadtxt_with_decimal_comma(fpath)
597
598
  if data.ndim == 1: data = data.reshape(1, -1)
598
599
  if data.shape[1] < 2: raise ValueError("Invalid .nor format")
599
600
  x, y = data[:,0], data[:,1]
600
601
  e = data[:,2] if data.shape[1] >= 3 else None
601
602
  axis_mode = 'energy'
602
603
  elif 'chik' in ext:
603
- data = np.loadtxt(fpath, comments="#")
604
+ data = loadtxt_with_decimal_comma(fpath)
604
605
  if data.ndim == 1: data = data.reshape(1, -1)
605
606
  if data.shape[1] < 2: raise ValueError("Invalid .chik data")
606
607
  x, y = data[:,0], data[:,1]; e = data[:,2] if data.shape[1] >= 3 else None
607
608
  axis_mode = 'k'
608
609
  elif 'chir' in ext:
609
- data = np.loadtxt(fpath, comments="#")
610
+ data = loadtxt_with_decimal_comma(fpath)
610
611
  if data.ndim == 1: data = data.reshape(1, -1)
611
612
  if data.shape[1] < 2: raise ValueError("Invalid .chir data")
612
613
  x, y = data[:,0], data[:,1]; e = data[:,2] if data.shape[1] >= 3 else None
@@ -50,6 +50,8 @@ from typing import Any, Optional
50
50
 
51
51
  import numpy as np
52
52
 
53
+ from .readers import loadtxt_with_decimal_comma
54
+
53
55
 
54
56
  def _resolve_readcol_for_file(
55
57
  fname: str,
@@ -224,7 +226,7 @@ def convert_xrd_data(
224
226
 
225
227
  # Read data from file
226
228
  try:
227
- data = np.loadtxt(fname, comments="#")
229
+ data = loadtxt_with_decimal_comma(fname)
228
230
  except Exception as e:
229
231
  print(f"Error reading {fname}: {e}")
230
232
  continue