batplot 1.8.36__tar.gz → 1.8.38__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.36/batplot.egg-info → batplot-1.8.38}/PKG-INFO +1 -1
  2. {batplot-1.8.36 → batplot-1.8.38}/batplot/__init__.py +1 -1
  3. {batplot-1.8.36 → batplot-1.8.38}/batplot/batch.py +4 -1
  4. {batplot-1.8.36 → batplot-1.8.38}/batplot/batplot.py +7 -2
  5. {batplot-1.8.36 → batplot-1.8.38}/batplot/data/CHANGELOG.md +8 -0
  6. {batplot-1.8.36 → batplot-1.8.38}/batplot/interactive.py +20 -4
  7. {batplot-1.8.36 → batplot-1.8.38/batplot.egg-info}/PKG-INFO +1 -1
  8. {batplot-1.8.36 → batplot-1.8.38}/pyproject.toml +1 -1
  9. {batplot-1.8.36 → batplot-1.8.38}/LICENSE +0 -0
  10. {batplot-1.8.36 → batplot-1.8.38}/MANIFEST.in +0 -0
  11. {batplot-1.8.36 → batplot-1.8.38}/NOTICE +0 -0
  12. {batplot-1.8.36 → batplot-1.8.38}/README.md +0 -0
  13. {batplot-1.8.36 → batplot-1.8.38}/batplot/args.py +0 -0
  14. {batplot-1.8.36 → batplot-1.8.38}/batplot/canvas_interactive.py +0 -0
  15. {batplot-1.8.36 → batplot-1.8.38}/batplot/cif.py +0 -0
  16. {batplot-1.8.36 → batplot-1.8.38}/batplot/cli.py +0 -0
  17. {batplot-1.8.36 → batplot-1.8.38}/batplot/color_utils.py +0 -0
  18. {batplot-1.8.36 → batplot-1.8.38}/batplot/config.py +0 -0
  19. {batplot-1.8.36 → batplot-1.8.38}/batplot/converters.py +0 -0
  20. {batplot-1.8.36 → batplot-1.8.38}/batplot/cpc_interactive.py +0 -0
  21. {batplot-1.8.36 → batplot-1.8.38}/batplot/data/USER_MANUAL.md +0 -0
  22. {batplot-1.8.36 → batplot-1.8.38}/batplot/dev_upgrade.py +0 -0
  23. {batplot-1.8.36 → batplot-1.8.38}/batplot/electrochem_interactive.py +0 -0
  24. {batplot-1.8.36 → batplot-1.8.38}/batplot/manual.py +0 -0
  25. {batplot-1.8.36 → batplot-1.8.38}/batplot/modes.py +0 -0
  26. {batplot-1.8.36 → batplot-1.8.38}/batplot/operando.py +0 -0
  27. {batplot-1.8.36 → batplot-1.8.38}/batplot/operando_ec_interactive.py +0 -0
  28. {batplot-1.8.36 → batplot-1.8.38}/batplot/plotting.py +0 -0
  29. {batplot-1.8.36 → batplot-1.8.38}/batplot/readers.py +0 -0
  30. {batplot-1.8.36 → batplot-1.8.38}/batplot/session.py +0 -0
  31. {batplot-1.8.36 → batplot-1.8.38}/batplot/showcol.py +0 -0
  32. {batplot-1.8.36 → batplot-1.8.38}/batplot/style.py +0 -0
  33. {batplot-1.8.36 → batplot-1.8.38}/batplot/ui.py +0 -0
  34. {batplot-1.8.36 → batplot-1.8.38}/batplot/utils.py +0 -0
  35. {batplot-1.8.36 → batplot-1.8.38}/batplot/version_check.py +0 -0
  36. {batplot-1.8.36 → batplot-1.8.38}/batplot.egg-info/SOURCES.txt +0 -0
  37. {batplot-1.8.36 → batplot-1.8.38}/batplot.egg-info/dependency_links.txt +0 -0
  38. {batplot-1.8.36 → batplot-1.8.38}/batplot.egg-info/entry_points.txt +0 -0
  39. {batplot-1.8.36 → batplot-1.8.38}/batplot.egg-info/requires.txt +0 -0
  40. {batplot-1.8.36 → batplot-1.8.38}/batplot.egg-info/top_level.txt +0 -0
  41. {batplot-1.8.36 → batplot-1.8.38}/setup.cfg +0 -0
  42. {batplot-1.8.36 → batplot-1.8.38}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: batplot
3
- Version: 1.8.36
3
+ Version: 1.8.38
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
@@ -1,5 +1,5 @@
1
1
  """batplot: Interactive plotting for battery data visualization."""
2
2
 
3
- __version__ = "1.8.36"
3
+ __version__ = "1.8.38"
4
4
 
5
5
  __all__ = ["__version__"]
@@ -703,8 +703,11 @@ def batch_process(directory: str, args):
703
703
  if ext and ext not in args._batch_warned_extensions and ext not in known_axis_ext:
704
704
  args._batch_warned_extensions.add(ext)
705
705
  print(f" Note: Reading '{ext}' files as 2-column (x, y) data with x-axis = {args.xaxis}")
706
+ elif getattr(args, 'wl', None) is not None:
707
+ # .txt / generic text: --wl implies XRD Q conversion (matches main batplot.py)
708
+ axis_mode = 'Q'
706
709
  else:
707
- raise ValueError(f"Unknown file type: {fname}. Use --xaxis [Q|2theta|r|k|energy|rft] or batplot --help for help.")
710
+ raise ValueError(f"Unknown file type: {fname}. Use --xaxis [Q|2theta|r|k|energy|rft], or --wl for XRD Q, or batplot --help for help.")
708
711
 
709
712
  # Convert to Q if needed
710
713
  if axis_mode == 'Q' and ext not in ('.qye', '.gr', '.nor'):
@@ -3733,12 +3733,17 @@ def batplot_main() -> int: # type: ignore
3733
3733
  elif any_chir:
3734
3734
  axis_mode = "rft"
3735
3735
  elif any_txt:
3736
- # .txt is generic, require --xaxis
3736
+ # .txt is generic: need --xaxis unless XRD context is clear from --wl or file:wl (same as .xy without ext hint).
3737
3737
  if args.xaxis:
3738
3738
  # Normalize case: 'q' or 'Q' → 'Q' (uppercase), everything else lowercase
3739
3739
  axis_mode = "Q" if args.xaxis.upper() == "Q" else args.xaxis.lower()
3740
+ elif getattr(args, 'wl', None) is not None or any_lambda:
3741
+ axis_mode = "Q"
3740
3742
  else:
3741
- raise ValueError("Unknown file type. Use: batplot file.txt --xaxis [Q|2theta|r|k|energy|rft] or batplot --help for help.")
3743
+ raise ValueError(
3744
+ "Unknown file type for .txt. Add --xaxis [Q|2theta|r|k|energy|rft], or use --wl for XRD Q conversion, "
3745
+ "or batplot --help."
3746
+ )
3742
3747
  elif any_lambda or any_cif or any_xrd_vendor:
3743
3748
  # XRD vendor formats (.raw, .brml, .xrdml, .rasx) are 2theta; CIF is Q; file:wl implies Q domain
3744
3749
  if args.xaxis and args.xaxis.lower() in ("2theta","two_theta","tth"):
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.8.38] - 2026-04-03
4
+ - Bug fixes
5
+
6
+
7
+ ## [1.8.37] - 2026-03-31
8
+ - Bug fixes
9
+
10
+
3
11
  ## [1.8.36] - 2026-03-30
4
12
  - Bug fixes
5
13
 
@@ -91,10 +91,12 @@ class _FilterIMKWarning:
91
91
  self.original_stderr.flush()
92
92
 
93
93
 
94
- def _safe_input(prompt: str = "") -> str:
94
+ def _safe_input(prompt: str = "", *, cancel_on_interrupt: bool = True) -> str:
95
95
  """Wrapper around input() that suppresses macOS IMKCFRunLoopWakeUpReliable warnings.
96
-
97
- This is a harmless macOS system message that appears when using input() in terminals.
96
+
97
+ On **Ctrl+C** (or EOF on stdin), returns ``""`` by default so prompts behave like cancel
98
+ and the interactive menu keeps running instead of exiting with a traceback.
99
+ Set ``cancel_on_interrupt=False`` to re-raise (e.g. tests).
98
100
  """
99
101
  # Filter stderr to hide macOS IMK warnings while preserving other errors
100
102
  original_stderr = sys.stderr
@@ -102,7 +104,21 @@ def _safe_input(prompt: str = "") -> str:
102
104
  try:
103
105
  result = input(prompt)
104
106
  return result
105
- except (KeyboardInterrupt, EOFError):
107
+ except KeyboardInterrupt:
108
+ if cancel_on_interrupt:
109
+ try:
110
+ print()
111
+ except Exception:
112
+ pass
113
+ return ""
114
+ raise
115
+ except EOFError:
116
+ if cancel_on_interrupt:
117
+ try:
118
+ print()
119
+ except Exception:
120
+ pass
121
+ return ""
106
122
  raise
107
123
  finally:
108
124
  sys.stderr = original_stderr
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: batplot
3
- Version: 1.8.36
3
+ Version: 1.8.38
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
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "batplot"
7
- version = "1.8.36"
7
+ version = "1.8.38"
8
8
  description = "Interactive plotting tool for material science (1D plot) and electrochemistry (GC, CV, dQ/dV, CPC, operando) with batch processing"
9
9
  authors = [
10
10
  { name = "Tian Dai", email = "tianda@uio.no" }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes