batplot 1.8.3__tar.gz → 1.8.4__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.
Potentially problematic release.
This version of batplot might be problematic. Click here for more details.
- {batplot-1.8.3/batplot.egg-info → batplot-1.8.4}/PKG-INFO +4 -9
- {batplot-1.8.3 → batplot-1.8.4}/batplot/__init__.py +1 -1
- {batplot-1.8.3 → batplot-1.8.4}/batplot/batplot.py +19 -18
- {batplot-1.8.3/batplot_backup_20251221_101150 → batplot-1.8.4/batplot}/cli.py +14 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot/session.py +104 -148
- {batplot-1.8.3 → batplot-1.8.4/batplot.egg-info}/PKG-INFO +4 -9
- batplot-1.8.4/batplot.egg-info/requires.txt +4 -0
- {batplot-1.8.3 → batplot-1.8.4}/pyproject.toml +4 -9
- batplot-1.8.3/batplot.egg-info/requires.txt +0 -4
- {batplot-1.8.3 → batplot-1.8.4}/LICENSE +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/MANIFEST.in +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/README.md +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/USER_MANUAL.md +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot/args.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot/batch.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot/cif.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot/color_utils.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot/config.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot/converters.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot/cpc_interactive.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot/data/USER_MANUAL.md +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot/electrochem_interactive.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot/interactive.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot/manual.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot/modes.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot/operando.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot/operando_ec_interactive.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot/plotting.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot/readers.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot/style.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot/ui.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot/utils.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot/version_check.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot.egg-info/SOURCES.txt +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot.egg-info/dependency_links.txt +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot.egg-info/entry_points.txt +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot.egg-info/top_level.txt +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251121_223043/__init__.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251121_223043/args.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251121_223043/batch.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251121_223043/batplot.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251121_223043/cif.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251121_223043/cli.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251121_223043/color_utils.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251121_223043/config.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251121_223043/converters.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251121_223043/cpc_interactive.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251121_223043/electrochem_interactive.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251121_223043/interactive.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251121_223043/modes.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251121_223043/operando.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251121_223043/operando_ec_interactive.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251121_223043/plotting.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251121_223043/readers.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251121_223043/session.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251121_223043/style.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251121_223043/ui.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251121_223043/utils.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251121_223043/version_check.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251221_101150/__init__.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251221_101150/args.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251221_101150/batch.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251221_101150/batplot.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251221_101150/cif.py +0 -0
- {batplot-1.8.3/batplot → batplot-1.8.4/batplot_backup_20251221_101150}/cli.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251221_101150/color_utils.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251221_101150/config.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251221_101150/converters.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251221_101150/cpc_interactive.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251221_101150/electrochem_interactive.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251221_101150/interactive.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251221_101150/manual.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251221_101150/modes.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251221_101150/operando.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251221_101150/operando_ec_interactive.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251221_101150/plotting.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251221_101150/readers.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251221_101150/session.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251221_101150/style.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251221_101150/ui.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251221_101150/utils.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/batplot_backup_20251221_101150/version_check.py +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/setup.cfg +0 -0
- {batplot-1.8.3 → batplot-1.8.4}/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.4
|
|
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
|
|
@@ -31,20 +31,15 @@ Project-URL: Issues, https://github.com/TianDai1729/batplot/issues
|
|
|
31
31
|
Classifier: Programming Language :: Python
|
|
32
32
|
Classifier: Programming Language :: Python :: 3
|
|
33
33
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
34
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
35
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
36
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
37
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
38
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
39
34
|
Classifier: Programming Language :: Python :: 3.13
|
|
40
35
|
Classifier: Operating System :: OS Independent
|
|
41
36
|
Classifier: Intended Audience :: Science/Research
|
|
42
37
|
Classifier: Topic :: Scientific/Engineering :: Visualization
|
|
43
|
-
Requires-Python:
|
|
38
|
+
Requires-Python: <3.14,>=3.13
|
|
44
39
|
Description-Content-Type: text/markdown
|
|
45
40
|
License-File: LICENSE
|
|
46
|
-
Requires-Dist: numpy
|
|
47
|
-
Requires-Dist: matplotlib
|
|
41
|
+
Requires-Dist: numpy==2.3.4
|
|
42
|
+
Requires-Dist: matplotlib==3.10.7
|
|
48
43
|
Requires-Dist: rich>=10.0.0
|
|
49
44
|
Requires-Dist: openpyxl>=3.0.0
|
|
50
45
|
Dynamic: license-file
|
|
@@ -1793,37 +1793,38 @@ def batplot_main() -> int:
|
|
|
1793
1793
|
except ModuleNotFoundError as e:
|
|
1794
1794
|
# Handle numpy._core and other module import errors
|
|
1795
1795
|
if '_core' in str(e) or 'numpy' in str(e).lower():
|
|
1796
|
+
# Try to extract version info before the error
|
|
1797
|
+
from .session import _try_extract_version_from_pickle, _get_current_numpy_version
|
|
1798
|
+
saved_versions = _try_extract_version_from_pickle(sess_path)
|
|
1799
|
+
current_numpy = _get_current_numpy_version()
|
|
1800
|
+
|
|
1801
|
+
saved_numpy = saved_versions.get('numpy', 'unknown')
|
|
1802
|
+
|
|
1796
1803
|
print(f"\nERROR: NumPy version mismatch detected when loading: {sess_path}")
|
|
1797
1804
|
print("This session was saved with a different NumPy version.")
|
|
1805
|
+
print()
|
|
1806
|
+
print(f"Session was saved with: NumPy {saved_numpy}")
|
|
1807
|
+
print(f"Currently installed: NumPy {current_numpy}")
|
|
1808
|
+
print()
|
|
1798
1809
|
print("The error 'No module named numpy._core' indicates:")
|
|
1799
1810
|
print(" - Session saved with NumPy 2.0+ but loading with NumPy <2.0, OR")
|
|
1800
1811
|
print(" - Session saved with NumPy <2.0 but loading with NumPy 2.0+")
|
|
1801
|
-
print(
|
|
1802
|
-
print("
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1812
|
+
print()
|
|
1813
|
+
print("Solutions:")
|
|
1814
|
+
if saved_numpy != 'unknown':
|
|
1815
|
+
print(f" 1. Install matching version: pip install 'numpy=={saved_numpy}'")
|
|
1816
|
+
else:
|
|
1817
|
+
print(" 1. Try installing NumPy <2.0: pip install 'numpy<2.0'")
|
|
1818
|
+
print(" OR try installing NumPy 2.0+: pip install 'numpy>=2.0'")
|
|
1819
|
+
print(" 2. Recreate the session from original data files")
|
|
1807
1820
|
else:
|
|
1808
1821
|
print(f"\nERROR: Module import error when loading: {sess_path}")
|
|
1809
1822
|
print(f"Error: {e}")
|
|
1810
1823
|
print("This usually indicates a package version mismatch.")
|
|
1811
|
-
print("Try installing matching package versions or recreate the session.")
|
|
1812
1824
|
exit(1)
|
|
1813
1825
|
except Exception as e:
|
|
1814
1826
|
print(f"Failed to load session: {e}")
|
|
1815
1827
|
exit(1)
|
|
1816
|
-
|
|
1817
|
-
# Check package version compatibility (if version info is available)
|
|
1818
|
-
try:
|
|
1819
|
-
from .session import _get_package_versions, _check_package_compatibility
|
|
1820
|
-
saved_versions = sess.get('package_versions', {})
|
|
1821
|
-
current_versions = _get_package_versions()
|
|
1822
|
-
if saved_versions and not _check_package_compatibility(saved_versions, current_versions, sess_path):
|
|
1823
|
-
exit(1)
|
|
1824
|
-
except Exception:
|
|
1825
|
-
# If compatibility checking fails, continue anyway (backward compatibility)
|
|
1826
|
-
pass
|
|
1827
1828
|
# If it's an EC GC session, load and open EC interactive menu directly
|
|
1828
1829
|
if isinstance(sess, dict) and sess.get('kind') == 'ec_gc':
|
|
1829
1830
|
try:
|
|
@@ -59,6 +59,20 @@ def main(argv: Optional[list] = None) -> int:
|
|
|
59
59
|
>>> main()
|
|
60
60
|
0
|
|
61
61
|
"""
|
|
62
|
+
# ====================================================================
|
|
63
|
+
# STEP 0: PYTHON VERSION CHECK
|
|
64
|
+
# ====================================================================
|
|
65
|
+
# Check if Python version is 3.13 (required for batplot)
|
|
66
|
+
# ====================================================================
|
|
67
|
+
if sys.version_info.major != 3 or sys.version_info.minor != 13:
|
|
68
|
+
current_version = f"{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}"
|
|
69
|
+
print(f"\n⚠️ WARNING: Python version mismatch detected!")
|
|
70
|
+
print(f" batplot requires Python 3.13")
|
|
71
|
+
print(f" Currently running: Python {current_version}")
|
|
72
|
+
print(f"\n This may cause compatibility issues.")
|
|
73
|
+
print(f" Please install Python 3.13 and use it to run batplot.")
|
|
74
|
+
print(f" Continuing anyway, but expect potential issues...\n")
|
|
75
|
+
|
|
62
76
|
# ====================================================================
|
|
63
77
|
# STEP 1: VERSION CHECK (NON-BLOCKING)
|
|
64
78
|
# ====================================================================
|
|
@@ -36,114 +36,71 @@ import os
|
|
|
36
36
|
|
|
37
37
|
import matplotlib.pyplot as plt
|
|
38
38
|
import numpy as np
|
|
39
|
-
import sys
|
|
40
39
|
|
|
41
40
|
from .utils import _confirm_overwrite
|
|
42
41
|
from .color_utils import ensure_colormap
|
|
43
42
|
|
|
44
43
|
|
|
45
|
-
def
|
|
46
|
-
"""
|
|
44
|
+
def _try_extract_version_from_pickle(filename: str) -> Dict[str, str]:
|
|
45
|
+
"""Try to extract package_versions from a pickle file even if it fails to fully load.
|
|
46
|
+
|
|
47
|
+
Note: This may not work if pickle.load() fails completely due to missing modules.
|
|
48
|
+
In that case, we can't extract version info, but we can still show current version.
|
|
47
49
|
|
|
48
50
|
Returns:
|
|
49
|
-
dict
|
|
51
|
+
dict with package versions, or empty dict if extraction fails
|
|
50
52
|
"""
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
# Also track Python version
|
|
64
|
-
versions['python'] = f"{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}"
|
|
65
|
-
|
|
66
|
-
return versions
|
|
53
|
+
try:
|
|
54
|
+
with open(filename, 'rb') as f:
|
|
55
|
+
# Try to load the pickle
|
|
56
|
+
# This will fail if numpy._core is missing, but we try anyway
|
|
57
|
+
sess = pickle.load(f)
|
|
58
|
+
if isinstance(sess, dict):
|
|
59
|
+
return sess.get('package_versions', {})
|
|
60
|
+
except Exception:
|
|
61
|
+
# If loading fails completely (e.g., ModuleNotFoundError for numpy._core),
|
|
62
|
+
# we can't extract version info. This is expected in version mismatch cases.
|
|
63
|
+
pass
|
|
64
|
+
return {}
|
|
67
65
|
|
|
68
66
|
|
|
69
|
-
def
|
|
70
|
-
"""
|
|
67
|
+
def _get_current_numpy_version() -> str:
|
|
68
|
+
"""Get current numpy version, even if import fails.
|
|
69
|
+
|
|
70
|
+
Tries multiple methods:
|
|
71
|
+
1. Direct import (fastest)
|
|
72
|
+
2. pip show (works even if import fails)
|
|
73
|
+
3. Returns 'unknown' if all fail
|
|
71
74
|
|
|
72
|
-
Args:
|
|
73
|
-
saved_versions: dict of package -> version from saved session
|
|
74
|
-
current_versions: dict of package -> version currently installed
|
|
75
|
-
filename: session filename for error messages
|
|
76
|
-
|
|
77
75
|
Returns:
|
|
78
|
-
|
|
76
|
+
Version string or 'unknown'
|
|
79
77
|
"""
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
mismatches = []
|
|
87
|
-
critical_mismatches = []
|
|
88
|
-
|
|
89
|
-
for pkg in ['numpy', 'matplotlib', 'python']:
|
|
90
|
-
saved_ver = saved_versions.get(pkg, 'unknown')
|
|
91
|
-
current_ver = current_versions.get(pkg, 'unknown')
|
|
92
|
-
|
|
93
|
-
if saved_ver == 'unknown' or current_ver == 'unknown':
|
|
94
|
-
continue
|
|
95
|
-
|
|
96
|
-
if saved_ver != current_ver:
|
|
97
|
-
# Check for critical incompatibilities
|
|
98
|
-
if pkg == 'numpy':
|
|
99
|
-
# numpy 2.0+ uses _core, <2.0 doesn't - this is a breaking change
|
|
100
|
-
try:
|
|
101
|
-
saved_major = int(saved_ver.split('.')[0])
|
|
102
|
-
current_major = int(current_ver.split('.')[0])
|
|
103
|
-
if saved_major != current_major:
|
|
104
|
-
critical_mismatches.append((pkg, saved_ver, current_ver))
|
|
105
|
-
else:
|
|
106
|
-
mismatches.append((pkg, saved_ver, current_ver))
|
|
107
|
-
except (ValueError, IndexError):
|
|
108
|
-
mismatches.append((pkg, saved_ver, current_ver))
|
|
109
|
-
elif pkg == 'python':
|
|
110
|
-
# Python major version changes are critical
|
|
111
|
-
try:
|
|
112
|
-
saved_major = int(saved_ver.split('.')[0])
|
|
113
|
-
current_major = int(current_ver.split('.')[0])
|
|
114
|
-
if saved_major != current_major:
|
|
115
|
-
critical_mismatches.append((pkg, saved_ver, current_ver))
|
|
116
|
-
else:
|
|
117
|
-
mismatches.append((pkg, saved_ver, current_ver))
|
|
118
|
-
except (ValueError, IndexError):
|
|
119
|
-
mismatches.append((pkg, saved_ver, current_ver))
|
|
120
|
-
else:
|
|
121
|
-
mismatches.append((pkg, saved_ver, current_ver))
|
|
122
|
-
|
|
123
|
-
if critical_mismatches:
|
|
124
|
-
print(f"\nERROR: Critical package version mismatch detected for session: {filename}")
|
|
125
|
-
print("The following packages have incompatible major version changes:")
|
|
126
|
-
for pkg, saved, current in critical_mismatches:
|
|
127
|
-
print(f" {pkg}: saved with {saved}, current is {current}")
|
|
128
|
-
print("\nThis will likely cause pickle loading to fail.")
|
|
129
|
-
print("Solutions:")
|
|
130
|
-
print(" 1. Install matching package versions:")
|
|
131
|
-
for pkg, saved, current in critical_mismatches:
|
|
132
|
-
print(f" pip install '{pkg}=={saved}' # or use conda")
|
|
133
|
-
print(" 2. Recreate the session from original data files")
|
|
134
|
-
return False
|
|
78
|
+
# Method 1: Try direct import
|
|
79
|
+
try:
|
|
80
|
+
import numpy
|
|
81
|
+
return numpy.__version__
|
|
82
|
+
except Exception:
|
|
83
|
+
pass
|
|
135
84
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
85
|
+
# Method 2: Try pip show
|
|
86
|
+
try:
|
|
87
|
+
import subprocess
|
|
88
|
+
import sys
|
|
89
|
+
result = subprocess.run(
|
|
90
|
+
[sys.executable, '-m', 'pip', 'show', 'numpy'],
|
|
91
|
+
capture_output=True,
|
|
92
|
+
text=True,
|
|
93
|
+
timeout=5,
|
|
94
|
+
check=False
|
|
95
|
+
)
|
|
96
|
+
if result.returncode == 0:
|
|
97
|
+
for line in result.stdout.split('\n'):
|
|
98
|
+
if line.startswith('Version:'):
|
|
99
|
+
return line.split(':', 1)[1].strip()
|
|
100
|
+
except Exception:
|
|
101
|
+
pass
|
|
145
102
|
|
|
146
|
-
return
|
|
103
|
+
return 'unknown'
|
|
147
104
|
|
|
148
105
|
|
|
149
106
|
def _current_tick_width(axis_obj, which: str):
|
|
@@ -536,12 +493,8 @@ def dump_session(
|
|
|
536
493
|
wasd_state = _capture_wasd_state(ax)
|
|
537
494
|
|
|
538
495
|
try:
|
|
539
|
-
# Get current package versions for compatibility checking
|
|
540
|
-
package_versions = _get_package_versions()
|
|
541
|
-
|
|
542
496
|
sess = {
|
|
543
497
|
'version': 3,
|
|
544
|
-
'package_versions': package_versions, # Track versions for compatibility checking
|
|
545
498
|
'x_data': [np.array(a) for a in x_data_list],
|
|
546
499
|
'y_data': [np.array(a) for a in y_data_list],
|
|
547
500
|
'orig_y': [np.array(a) for a in orig_y],
|
|
@@ -863,13 +816,9 @@ def dump_operando_session(
|
|
|
863
816
|
cb_h_offset = getattr(cbar.ax, '_cb_h_offset_in', 0.0)
|
|
864
817
|
ec_h_offset = getattr(ec_ax, '_ec_h_offset_in', 0.0) if ec_ax is not None else None
|
|
865
818
|
|
|
866
|
-
# Get current package versions for compatibility checking
|
|
867
|
-
package_versions = _get_package_versions()
|
|
868
|
-
|
|
869
819
|
sess = {
|
|
870
820
|
'kind': 'operando_ec',
|
|
871
821
|
'version': 2,
|
|
872
|
-
'package_versions': package_versions, # Track versions for compatibility checking
|
|
873
822
|
'figure': {'size': (fig_w, fig_h), 'dpi': dpi},
|
|
874
823
|
'layout_inches': {
|
|
875
824
|
'cb_w_in': cb_w_in,
|
|
@@ -937,22 +886,33 @@ def load_operando_session(filename: str):
|
|
|
937
886
|
except ModuleNotFoundError as e:
|
|
938
887
|
# Handle numpy._core and other module import errors
|
|
939
888
|
if '_core' in str(e) or 'numpy' in str(e).lower():
|
|
889
|
+
# Try to extract version info before the error
|
|
890
|
+
saved_versions = _try_extract_version_from_pickle(filename)
|
|
891
|
+
current_numpy = _get_current_numpy_version()
|
|
892
|
+
|
|
893
|
+
saved_numpy = saved_versions.get('numpy', 'unknown')
|
|
894
|
+
|
|
940
895
|
print(f"\nERROR: NumPy version mismatch detected when loading: {filename}")
|
|
941
896
|
print("This session was saved with a different NumPy version.")
|
|
897
|
+
print()
|
|
898
|
+
print(f"Session was saved with: NumPy {saved_numpy}")
|
|
899
|
+
print(f"Currently installed: NumPy {current_numpy}")
|
|
900
|
+
print()
|
|
942
901
|
print("The error 'No module named numpy._core' indicates:")
|
|
943
902
|
print(" - Session saved with NumPy 2.0+ but loading with NumPy <2.0, OR")
|
|
944
903
|
print(" - Session saved with NumPy <2.0 but loading with NumPy 2.0+")
|
|
945
|
-
print(
|
|
946
|
-
print("
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
904
|
+
print()
|
|
905
|
+
print("Solutions:")
|
|
906
|
+
if saved_numpy != 'unknown':
|
|
907
|
+
print(f" 1. Install matching version: pip install 'numpy=={saved_numpy}'")
|
|
908
|
+
else:
|
|
909
|
+
print(" 1. Try installing NumPy <2.0: pip install 'numpy<2.0'")
|
|
910
|
+
print(" OR try installing NumPy 2.0+: pip install 'numpy>=2.0'")
|
|
911
|
+
print(" 2. Recreate the session from original data files")
|
|
951
912
|
else:
|
|
952
913
|
print(f"\nERROR: Module import error when loading: {filename}")
|
|
953
914
|
print(f"Error: {e}")
|
|
954
915
|
print("This usually indicates a package version mismatch.")
|
|
955
|
-
print("Try installing matching package versions or recreate the session.")
|
|
956
916
|
return None
|
|
957
917
|
except Exception as e:
|
|
958
918
|
print(f"Failed to load session: {e}")
|
|
@@ -961,12 +921,6 @@ def load_operando_session(filename: str):
|
|
|
961
921
|
if not isinstance(sess, dict) or sess.get('kind') != 'operando_ec':
|
|
962
922
|
print("Not an operando+EC session file.")
|
|
963
923
|
return None
|
|
964
|
-
|
|
965
|
-
# Check package version compatibility
|
|
966
|
-
saved_versions = sess.get('package_versions', {})
|
|
967
|
-
current_versions = _get_package_versions()
|
|
968
|
-
if not _check_package_compatibility(saved_versions, current_versions, filename):
|
|
969
|
-
return None
|
|
970
924
|
|
|
971
925
|
# Use standard DPI of 100 instead of saved DPI to avoid display-dependent issues
|
|
972
926
|
# (Retina displays, Windows scaling, etc. can cause saved DPI to differ)
|
|
@@ -1746,13 +1700,9 @@ def dump_ec_session(
|
|
|
1746
1700
|
legend_xy_in = (float(xy[0]), float(xy[1]))
|
|
1747
1701
|
except Exception:
|
|
1748
1702
|
legend_xy_in = None
|
|
1749
|
-
# Get current package versions for compatibility checking
|
|
1750
|
-
package_versions = _get_package_versions()
|
|
1751
|
-
|
|
1752
1703
|
sess = {
|
|
1753
1704
|
'kind': 'ec_gc',
|
|
1754
1705
|
'version': 2,
|
|
1755
|
-
'package_versions': package_versions, # Track versions for compatibility checking
|
|
1756
1706
|
'figure': {'size': (fig_w, fig_h), 'dpi': dpi},
|
|
1757
1707
|
'axis': axis,
|
|
1758
1708
|
'subplot_margins': subplot_margins,
|
|
@@ -1805,22 +1755,33 @@ def load_ec_session(filename: str):
|
|
|
1805
1755
|
except ModuleNotFoundError as e:
|
|
1806
1756
|
# Handle numpy._core and other module import errors
|
|
1807
1757
|
if '_core' in str(e) or 'numpy' in str(e).lower():
|
|
1758
|
+
# Try to extract version info before the error
|
|
1759
|
+
saved_versions = _try_extract_version_from_pickle(filename)
|
|
1760
|
+
current_numpy = _get_current_numpy_version()
|
|
1761
|
+
|
|
1762
|
+
saved_numpy = saved_versions.get('numpy', 'unknown')
|
|
1763
|
+
|
|
1808
1764
|
print(f"\nERROR: NumPy version mismatch detected when loading: {filename}")
|
|
1809
1765
|
print("This session was saved with a different NumPy version.")
|
|
1766
|
+
print()
|
|
1767
|
+
print(f"Session was saved with: NumPy {saved_numpy}")
|
|
1768
|
+
print(f"Currently installed: NumPy {current_numpy}")
|
|
1769
|
+
print()
|
|
1810
1770
|
print("The error 'No module named numpy._core' indicates:")
|
|
1811
1771
|
print(" - Session saved with NumPy 2.0+ but loading with NumPy <2.0, OR")
|
|
1812
1772
|
print(" - Session saved with NumPy <2.0 but loading with NumPy 2.0+")
|
|
1813
|
-
print(
|
|
1814
|
-
print("
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1773
|
+
print()
|
|
1774
|
+
print("Solutions:")
|
|
1775
|
+
if saved_numpy != 'unknown':
|
|
1776
|
+
print(f" 1. Install matching version: pip install 'numpy=={saved_numpy}'")
|
|
1777
|
+
else:
|
|
1778
|
+
print(" 1. Try installing NumPy <2.0: pip install 'numpy<2.0'")
|
|
1779
|
+
print(" OR try installing NumPy 2.0+: pip install 'numpy>=2.0'")
|
|
1780
|
+
print(" 2. Recreate the session from original data files")
|
|
1819
1781
|
else:
|
|
1820
1782
|
print(f"\nERROR: Module import error when loading: {filename}")
|
|
1821
1783
|
print(f"Error: {e}")
|
|
1822
1784
|
print("This usually indicates a package version mismatch.")
|
|
1823
|
-
print("Try installing matching package versions or recreate the session.")
|
|
1824
1785
|
return None
|
|
1825
1786
|
except Exception as e:
|
|
1826
1787
|
print(f"Failed to load EC session: {e}")
|
|
@@ -1829,12 +1790,6 @@ def load_ec_session(filename: str):
|
|
|
1829
1790
|
if not isinstance(sess, dict) or sess.get('kind') != 'ec_gc':
|
|
1830
1791
|
print("Not an EC GC session file.")
|
|
1831
1792
|
return None
|
|
1832
|
-
|
|
1833
|
-
# Check package version compatibility
|
|
1834
|
-
saved_versions = sess.get('package_versions', {})
|
|
1835
|
-
current_versions = _get_package_versions()
|
|
1836
|
-
if not _check_package_compatibility(saved_versions, current_versions, filename):
|
|
1837
|
-
return None
|
|
1838
1793
|
|
|
1839
1794
|
# Use standard DPI of 100 instead of saved DPI to avoid display-dependent issues
|
|
1840
1795
|
# (Retina displays, Windows scaling, etc. can cause saved DPI to differ)
|
|
@@ -2539,13 +2494,9 @@ def dump_cpc_session(
|
|
|
2539
2494
|
'right_y': float(getattr(ax2, '_right_ylabel_manual_offset_y_pts', 0.0) or 0.0),
|
|
2540
2495
|
}
|
|
2541
2496
|
|
|
2542
|
-
# Get current package versions for compatibility checking
|
|
2543
|
-
package_versions = _get_package_versions()
|
|
2544
|
-
|
|
2545
2497
|
meta = {
|
|
2546
2498
|
'kind': 'cpc',
|
|
2547
2499
|
'version': 2, # Incremented version for new format
|
|
2548
|
-
'package_versions': package_versions, # Track versions for compatibility checking
|
|
2549
2500
|
'figure': {
|
|
2550
2501
|
'size': (fig_w, fig_h),
|
|
2551
2502
|
'dpi': dpi,
|
|
@@ -2704,22 +2655,33 @@ def load_cpc_session(filename: str):
|
|
|
2704
2655
|
except ModuleNotFoundError as e:
|
|
2705
2656
|
# Handle numpy._core and other module import errors
|
|
2706
2657
|
if '_core' in str(e) or 'numpy' in str(e).lower():
|
|
2658
|
+
# Try to extract version info before the error
|
|
2659
|
+
saved_versions = _try_extract_version_from_pickle(filename)
|
|
2660
|
+
current_numpy = _get_current_numpy_version()
|
|
2661
|
+
|
|
2662
|
+
saved_numpy = saved_versions.get('numpy', 'unknown')
|
|
2663
|
+
|
|
2707
2664
|
print(f"\nERROR: NumPy version mismatch detected when loading: {filename}")
|
|
2708
2665
|
print("This session was saved with a different NumPy version.")
|
|
2666
|
+
print()
|
|
2667
|
+
print(f"Session was saved with: NumPy {saved_numpy}")
|
|
2668
|
+
print(f"Currently installed: NumPy {current_numpy}")
|
|
2669
|
+
print()
|
|
2709
2670
|
print("The error 'No module named numpy._core' indicates:")
|
|
2710
2671
|
print(" - Session saved with NumPy 2.0+ but loading with NumPy <2.0, OR")
|
|
2711
2672
|
print(" - Session saved with NumPy <2.0 but loading with NumPy 2.0+")
|
|
2712
|
-
print(
|
|
2713
|
-
print("
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2673
|
+
print()
|
|
2674
|
+
print("Solutions:")
|
|
2675
|
+
if saved_numpy != 'unknown':
|
|
2676
|
+
print(f" 1. Install matching version: pip install 'numpy=={saved_numpy}'")
|
|
2677
|
+
else:
|
|
2678
|
+
print(" 1. Try installing NumPy <2.0: pip install 'numpy<2.0'")
|
|
2679
|
+
print(" OR try installing NumPy 2.0+: pip install 'numpy>=2.0'")
|
|
2680
|
+
print(" 2. Recreate the session from original data files")
|
|
2718
2681
|
else:
|
|
2719
2682
|
print(f"\nERROR: Module import error when loading: {filename}")
|
|
2720
2683
|
print(f"Error: {e}")
|
|
2721
2684
|
print("This usually indicates a package version mismatch.")
|
|
2722
|
-
print("Try installing matching package versions or recreate the session.")
|
|
2723
2685
|
return None
|
|
2724
2686
|
except Exception as e:
|
|
2725
2687
|
print(f"Failed to load session: {e}")
|
|
@@ -2727,12 +2689,6 @@ def load_cpc_session(filename: str):
|
|
|
2727
2689
|
if not isinstance(sess, dict) or sess.get('kind') != 'cpc':
|
|
2728
2690
|
print("Not a CPC session file.")
|
|
2729
2691
|
return None
|
|
2730
|
-
|
|
2731
|
-
# Check package version compatibility
|
|
2732
|
-
saved_versions = sess.get('package_versions', {})
|
|
2733
|
-
current_versions = _get_package_versions()
|
|
2734
|
-
if not _check_package_compatibility(saved_versions, current_versions, filename):
|
|
2735
|
-
return None
|
|
2736
2692
|
try:
|
|
2737
2693
|
# Use standard DPI of 100 instead of saved DPI to avoid display-dependent issues
|
|
2738
2694
|
# (Retina displays, Windows scaling, etc. can cause saved DPI to differ)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: batplot
|
|
3
|
-
Version: 1.8.
|
|
3
|
+
Version: 1.8.4
|
|
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
|
|
@@ -31,20 +31,15 @@ Project-URL: Issues, https://github.com/TianDai1729/batplot/issues
|
|
|
31
31
|
Classifier: Programming Language :: Python
|
|
32
32
|
Classifier: Programming Language :: Python :: 3
|
|
33
33
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
34
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
35
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
36
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
37
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
38
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
39
34
|
Classifier: Programming Language :: Python :: 3.13
|
|
40
35
|
Classifier: Operating System :: OS Independent
|
|
41
36
|
Classifier: Intended Audience :: Science/Research
|
|
42
37
|
Classifier: Topic :: Scientific/Engineering :: Visualization
|
|
43
|
-
Requires-Python:
|
|
38
|
+
Requires-Python: <3.14,>=3.13
|
|
44
39
|
Description-Content-Type: text/markdown
|
|
45
40
|
License-File: LICENSE
|
|
46
|
-
Requires-Dist: numpy
|
|
47
|
-
Requires-Dist: matplotlib
|
|
41
|
+
Requires-Dist: numpy==2.3.4
|
|
42
|
+
Requires-Dist: matplotlib==3.10.7
|
|
48
43
|
Requires-Dist: rich>=10.0.0
|
|
49
44
|
Requires-Dist: openpyxl>=3.0.0
|
|
50
45
|
Dynamic: license-file
|
|
@@ -4,16 +4,16 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "batplot"
|
|
7
|
-
version = "1.8.
|
|
7
|
+
version = "1.8.4"
|
|
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" }
|
|
11
11
|
]
|
|
12
12
|
readme = "README.md"
|
|
13
|
-
requires-python = ">=3.
|
|
13
|
+
requires-python = ">=3.13,<3.14"
|
|
14
14
|
dependencies = [
|
|
15
|
-
"numpy",
|
|
16
|
-
"matplotlib",
|
|
15
|
+
"numpy==2.3.4",
|
|
16
|
+
"matplotlib==3.10.7",
|
|
17
17
|
"rich>=10.0.0",
|
|
18
18
|
"openpyxl>=3.0.0"
|
|
19
19
|
]
|
|
@@ -22,11 +22,6 @@ classifiers = [
|
|
|
22
22
|
"Programming Language :: Python",
|
|
23
23
|
"Programming Language :: Python :: 3",
|
|
24
24
|
"Programming Language :: Python :: 3 :: Only",
|
|
25
|
-
"Programming Language :: Python :: 3.8",
|
|
26
|
-
"Programming Language :: Python :: 3.9",
|
|
27
|
-
"Programming Language :: Python :: 3.10",
|
|
28
|
-
"Programming Language :: Python :: 3.11",
|
|
29
|
-
"Programming Language :: Python :: 3.12",
|
|
30
25
|
"Programming Language :: Python :: 3.13",
|
|
31
26
|
"Operating System :: OS Independent",
|
|
32
27
|
"Intended Audience :: Science/Research",
|
|
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
|
|
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
|
|
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
|
|
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
|