Two NumPy APIs used in this repo have been removed in recent NumPy versions and will cause AttributeError at runtime.
1. np.trapz — removed in NumPy 2.4.0
Affected files:
ana/ckn.py:94, :111, :201
ana/trapz.py:21
Current:
# ana/ckn.py:94
cai2[i] = np.trapz(ir2[:i+1], en[:i+1])
# ana/ckn.py:111
s2i[i] = np.trapz(s2[:i+1], en[:i+1])
# ana/ckn.py:201
s2integral += np.trapz(fs2[:,1], fs2[:,0])
# ana/trapz.py:21
area_approx = np.trapz(y, x)
Fix: np.trapz → np.trapezoid (same signature)
trapz was deprecated in NumPy 2.0 (2023-08) and removed in NumPy 2.4.0 (2025-12). Refs: gpytorch#2695, NeuroKit#1155.
For NumPy < 2.0 backward compatibility:
try:
from numpy import trapezoid as _trapz_impl
except ImportError:
from numpy import trapz as _trapz_impl
2. np.bool — removed in NumPy 1.24
Affected files:
ana/seq.py:864
ana/cfh.py:297
Current:
# ana/seq.py:864
wk = np.zeros((len(aseq), 16), dtype=np.bool)
# ana/cfh.py:297
a = np.zeros(len(paths), dtype=np.bool)
Fix: np.bool → bool (recommended) or np.bool_
np.bool was deprecated in NumPy 1.20 and removed in NumPy 1.24 (2022-12). Refs: ultralytics#22930.
Summary
| API |
NumPy removed |
Affected files |
Fix |
np.trapz |
2.4.0 |
ana/ckn.py ×3, ana/trapz.py ×1 |
np.trapezoid |
np.bool |
1.24 |
ana/seq.py:864, ana/cfh.py:297 |
bool |
Two NumPy APIs used in this repo have been removed in recent NumPy versions and will cause
AttributeErrorat runtime.1. np.trapz — removed in NumPy 2.4.0
Affected files:
ana/ckn.py:94,:111,:201ana/trapz.py:21Current:
Fix:
np.trapz→np.trapezoid(same signature)trapzwas deprecated in NumPy 2.0 (2023-08) and removed in NumPy 2.4.0 (2025-12). Refs: gpytorch#2695, NeuroKit#1155.For NumPy < 2.0 backward compatibility:
2. np.bool — removed in NumPy 1.24
Affected files:
ana/seq.py:864ana/cfh.py:297Current:
Fix:
np.bool→bool(recommended) ornp.bool_np.boolwas deprecated in NumPy 1.20 and removed in NumPy 1.24 (2022-12). Refs: ultralytics#22930.Summary
np.trapzana/ckn.py×3,ana/trapz.py×1np.trapezoidnp.boolana/seq.py:864,ana/cfh.py:297bool