batplot 1.0.1__tar.gz → 1.0.2__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.0.1 → batplot-1.0.2}/PKG-INFO +2 -2
- batplot-1.0.2/batplot/__init__.py +1 -0
- {batplot-1.0.1 → batplot-1.0.2}/batplot/batplot.py +42 -26
- {batplot-1.0.1 → batplot-1.0.2}/batplot.egg-info/PKG-INFO +2 -2
- {batplot-1.0.1 → batplot-1.0.2}/pyproject.toml +4 -8
- batplot-1.0.1/batplot/__init__.py +0 -1
- {batplot-1.0.1 → batplot-1.0.2}/batplot.egg-info/SOURCES.txt +0 -0
- {batplot-1.0.1 → batplot-1.0.2}/batplot.egg-info/dependency_links.txt +0 -0
- {batplot-1.0.1 → batplot-1.0.2}/batplot.egg-info/entry_points.txt +0 -0
- {batplot-1.0.1 → batplot-1.0.2}/batplot.egg-info/requires.txt +0 -0
- {batplot-1.0.1 → batplot-1.0.2}/batplot.egg-info/top_level.txt +0 -0
- {batplot-1.0.1 → batplot-1.0.2}/setup.cfg +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: batplot
|
|
3
|
-
Version: 1.0.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 1.0.2
|
|
4
|
+
Summary: Interactive plotting for XRD, PDF, and XAS data (.xye, .xy, .qye, .dat, .csv, .gr, .nor, .chik, .chir)
|
|
5
5
|
Author-email: Your Name <your@email.com>
|
|
6
6
|
Requires-Python: >=3.7
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# This file marks the batplot directory as a Python package.
|
|
@@ -26,6 +26,7 @@ plt.rcParams.update({
|
|
|
26
26
|
'font.size': 16
|
|
27
27
|
})
|
|
28
28
|
|
|
29
|
+
|
|
29
30
|
def normalize_label_text(text: str) -> str:
|
|
30
31
|
if not text:
|
|
31
32
|
return text
|
|
@@ -1969,7 +1970,7 @@ def interactive_menu(fig, ax, y_data_list, x_data_list, labels, orig_y,
|
|
|
1969
1970
|
for ln, st in zip(ax.lines, stored_styles):
|
|
1970
1971
|
if 'color' in st: ln.set_color(st['color'])
|
|
1971
1972
|
if 'linewidth' in st: ln.set_linewidth(st['linewidth'])
|
|
1972
|
-
if 'linestyle' in st:
|
|
1973
|
+
if 'linestyle' in st:
|
|
1973
1974
|
try: ln.set_linestyle(st['linestyle'])
|
|
1974
1975
|
except Exception: pass
|
|
1975
1976
|
if 'alpha' in st and st['alpha'] is not None: ln.set_alpha(st['alpha'])
|
|
@@ -2505,7 +2506,7 @@ def interactive_menu(fig, ax, y_data_list, x_data_list, labels, orig_y,
|
|
|
2505
2506
|
for c_idx, line_idx in enumerate(indices):
|
|
2506
2507
|
ax.lines[line_idx].set_color(colors[c_idx])
|
|
2507
2508
|
fig.canvas.draw()
|
|
2508
|
-
print(f"Applied '{palette_name}' to curves: " +
|
|
2509
|
+
print(f"Applied '{palette_name}' to curves: " +
|
|
2509
2510
|
", ".join(str(i+1) for i in indices))
|
|
2510
2511
|
else:
|
|
2511
2512
|
print("Unknown color submenu option.")
|
|
@@ -3262,34 +3263,49 @@ def interactive_menu(fig, ax, y_data_list, x_data_list, labels, orig_y,
|
|
|
3262
3263
|
# ---------------- Argument Parsing ----------------
|
|
3263
3264
|
parser = argparse.ArgumentParser(
|
|
3264
3265
|
description="batplot: Plot diffraction / PDF / XAS data (.xye, .xy, .qye, .dat, .csv, .gr, .nor, .chik, .chir)\n"
|
|
3266
|
+
" --delta or -d : vertical offset between curves (default 0.0 if --stack)\n"
|
|
3267
|
+
" --xrange min max : X-axis range (2θ or Q), Example: --xrange 2 10\n"
|
|
3268
|
+
" --out or -o : output image filename (default SVG), Example: --out figure.svg\n"
|
|
3269
|
+
" --xaxis : X-axis type override if the file extension is neither .xye nor .qye (2theta, Q, or r for PDF)\n"
|
|
3270
|
+
" --wl : global wavelength (Å) for Q conversion, Example: --wl 1.5406\n"
|
|
3271
|
+
" --fullprof : FullProf matrix: xstart xend xstep [wavelength], Example: --fullprof 2 10 0.02 1.5406\n"
|
|
3272
|
+
" --raw : plot raw intensity values instead of normalized\n"
|
|
3273
|
+
" --stack : stack curves from top to bottom\n"
|
|
3274
|
+
"test"
|
|
3275
|
+
" --interactive : keep figure open for interactive editing\n\n"
|
|
3276
|
+
"Example usages:\n"
|
|
3277
|
+
" batplot file1.xye:1.5406 file2.qye --stack --interactive\n"
|
|
3278
|
+
" batplot file1.dat file2.dat --xaxis Q --wl 1.5406 --delta 1.0 --out figure.svg\n"
|
|
3279
|
+
" batplot file1.xy file2.xy --xaxis 2theta --raw --xrange 2 10\n"
|
|
3280
|
+
" batplot file1.qye file2.xye:1.54 structure1.cif structure2.cif --stack --interactive\n\n"
|
|
3265
3281
|
"Extra usage:\n"
|
|
3266
3282
|
" batplot FOLDER -> batch export all supported files in FOLDER to FOLDER/batplot_svg/*.svg\n"
|
|
3267
|
-
" batplot all -> batch export all supported files in current directory to ./batplot_svg/*.svg",
|
|
3283
|
+
" batplot all -> batch export all supported files in current directory to ./batplot_svg/*.svg\n",
|
|
3268
3284
|
formatter_class=argparse.RawDescriptionHelpFormatter
|
|
3269
3285
|
)
|
|
3270
|
-
parser.add_argument("files", nargs="*", help="Files to plot. Optionally specify wavelength per file: file.xye")
|
|
3271
|
-
parser.add_argument("--delta", "-d", type=float, default=None,
|
|
3272
|
-
|
|
3273
|
-
#parser.add_argument("--autoscale", action="store_true", help="Scale offsets relative to max intensity per curve")
|
|
3274
|
-
parser.add_argument("--xrange", nargs=2, type=float, help="X-axis range: min max (2θ or Q), Example: --xrange 2 10")
|
|
3275
|
-
parser.add_argument("--out", "-o", type=str, help="Output image filename (default SVG), Example: --out figure.svg")
|
|
3276
|
-
#parser.add_argument("--errors", action="store_true", help="Plot error bars if present")
|
|
3277
|
-
parser.add_argument("--xaxis", choices=["2theta", "Q", "r"],
|
|
3278
|
-
|
|
3279
|
-
#parser.add_argument("--convert", "-c", nargs="+", help="Convert .xye/.dat files to .qye using --wl")
|
|
3280
|
-
parser.add_argument("--wl", type=float, help="Global wavelength (Å) for Q conversion, Example: --wl 1.5406 (alternatively specify per file with ':', Example: file.xye:1.5406)")
|
|
3281
|
-
parser.add_argument("--fullprof", nargs="+", type=float, help="FullProf matrix: xstart xend xstep [wavelength], Example: --fullprof 2 10 0.02 1.5406")
|
|
3282
|
-
parser.add_argument("--raw", action="store_true", help="Plot raw intensity values instead of normalized")
|
|
3283
|
-
#parser.add_argument("--savefig", type=str, help="Save figure object for later editing (.pkl)")
|
|
3284
|
-
parser.add_argument("--stack", action="store_true",
|
|
3285
|
-
|
|
3286
|
-
parser.add_argument("--interactive", action="store_true", help="Keep figure open for interactive editing\n")
|
|
3287
|
-
parser.add_argument("Example usages:")
|
|
3288
|
-
parser.add_argument("batplot file1.xye file2.qye:1.5406 --stack --interactive")
|
|
3289
|
-
parser.add_argument("batplot file1.dat --xaxis Q --wl 1.5406 --delta 0.1 --out figure.svg")
|
|
3290
|
-
parser.add_argument("batplot file1.xy file2.xy --raw --xrange 2 10")
|
|
3291
|
-
parser.add_argument("batplot file1.qye file2.xye:1.54 structure1.cif structure2.cif --stack --interactive")
|
|
3292
|
-
parser.add_argument("batplot all")
|
|
3286
|
+
# parser.add_argument("files", nargs="*", help="Files to plot. Optionally specify wavelength per file: file.xye")
|
|
3287
|
+
# parser.add_argument("--delta", "-d", type=float, default=None,
|
|
3288
|
+
# help="Vertical offset between curves (default 0.0 if --stack). Example: --delta 0.2")
|
|
3289
|
+
# #parser.add_argument("--autoscale", action="store_true", help="Scale offsets relative to max intensity per curve")
|
|
3290
|
+
# parser.add_argument("--xrange", nargs=2, type=float, help="X-axis range: min max (2θ or Q), Example: --xrange 2 10")
|
|
3291
|
+
# parser.add_argument("--out", "-o", type=str, help="Output image filename (default SVG), Example: --out figure.svg")
|
|
3292
|
+
# #parser.add_argument("--errors", action="store_true", help="Plot error bars if present")
|
|
3293
|
+
# parser.add_argument("--xaxis", choices=["2theta", "Q", "r"],
|
|
3294
|
+
# help="X-axis type override (2theta, Q, or r for PDF)")
|
|
3295
|
+
# #parser.add_argument("--convert", "-c", nargs="+", help="Convert .xye/.dat files to .qye using --wl")
|
|
3296
|
+
# parser.add_argument("--wl", type=float, help="Global wavelength (Å) for Q conversion, Example: --wl 1.5406 (alternatively specify per file with ':', Example: file.xye:1.5406)")
|
|
3297
|
+
# parser.add_argument("--fullprof", nargs="+", type=float, help="FullProf matrix: xstart xend xstep [wavelength], Example: --fullprof 2 10 0.02 1.5406")
|
|
3298
|
+
# parser.add_argument("--raw", action="store_true", help="Plot raw intensity values instead of normalized")
|
|
3299
|
+
# #parser.add_argument("--savefig", type=str, help="Save figure object for later editing (.pkl)")
|
|
3300
|
+
# parser.add_argument("--stack", action="store_true",
|
|
3301
|
+
# help="Stack curves from top to bottom")
|
|
3302
|
+
# parser.add_argument("--interactive", action="store_true", help="Keep figure open for interactive editing\n")
|
|
3303
|
+
# parser.add_argument("Example usages:")
|
|
3304
|
+
# parser.add_argument("batplot file1.xye file2.qye:1.5406 --stack --interactive")
|
|
3305
|
+
# parser.add_argument("batplot file1.dat --xaxis Q --wl 1.5406 --delta 0.1 --out figure.svg")
|
|
3306
|
+
# parser.add_argument("batplot file1.xy file2.xy --raw --xrange 2 10")
|
|
3307
|
+
# parser.add_argument("batplot file1.qye file2.xye:1.54 structure1.cif structure2.cif --stack --interactive")
|
|
3308
|
+
# parser.add_argument("batplot all")
|
|
3293
3309
|
|
|
3294
3310
|
args = parser.parse_args()
|
|
3295
3311
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: batplot
|
|
3
|
-
Version: 1.0.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 1.0.2
|
|
4
|
+
Summary: Interactive plotting for XRD, PDF, and XAS data (.xye, .xy, .qye, .dat, .csv, .gr, .nor, .chik, .chir)
|
|
5
5
|
Author-email: Your Name <your@email.com>
|
|
6
6
|
Requires-Python: >=3.7
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ["setuptools
|
|
2
|
+
requires = ["setuptools", "wheel"]
|
|
3
3
|
build-backend = "setuptools.build_meta"
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "batplot"
|
|
7
|
-
version = "1.0.
|
|
8
|
-
description = "
|
|
7
|
+
version = "1.0.2"
|
|
8
|
+
description = "Interactive plotting for XRD, PDF, and XAS data (.xye, .xy, .qye, .dat, .csv, .gr, .nor, .chik, .chir)"
|
|
9
9
|
authors = [
|
|
10
|
-
|
|
10
|
+
{ name = "Your Name", email = "your@email.com" }
|
|
11
11
|
]
|
|
12
12
|
readme = "README.md"
|
|
13
13
|
requires-python = ">=3.7"
|
|
@@ -18,7 +18,3 @@ dependencies = [
|
|
|
18
18
|
|
|
19
19
|
[project.scripts]
|
|
20
20
|
batplot = "batplot.batplot:main"
|
|
21
|
-
|
|
22
|
-
[tool.setuptools.packages.find]
|
|
23
|
-
where = ["."]
|
|
24
|
-
include = ["batplot*"]
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# batplot package init
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|