Skip to content

Commit 9d6e233

Browse files
committed
test: deprecation audit — bug tests 27-63 (dead code, wrong math, broken operators)
37 new test methods covering bugs discovered during the NumPy 1.x deprecation audit. Each test asserts correct NumPy 2.4.2 behavior and fails until the bug is fixed. Dead code — functions returning null/default (13 tests): - Bug 32: np.convolve returns null (Regen never generated) - Bug 34: np.isnan returns null (DefaultEngine.IsNan stub) - Bug 35: np.isfinite returns null (DefaultEngine.IsFinite stub) - Bug 36: np.isclose returns null (blocks np.allclose) - Bug 37: operator & returns null (NDArray.AND.cs) - Bug 38: operator | returns null (NDArray.OR.cs) - Bug 39: nd.delete() returns null - Bug 40: nd.inv() returns null (LAPACK commented out) - Bug 41: nd.qr() returns default (null, null) - Bug 42: nd.svd() returns default (null, null, null) - Bug 43: nd.lstqr() returns null + misspelled (should be lstsq) - Bug 44: nd.multi_dot() returns null - Bug 45: nd.roll(shift) no-axis returns null (body commented out) Wrong math/semantics (8 tests): - Bug 47: np.positive implements abs() instead of +x identity - Bug 48: np.negative only negates positive values, leaves negatives - Bug 51: np.log1p computes log10(1+x) instead of ln(1+x) — critical - Bug 52: std/var ignore ddof parameter (sample stats always = population) - Bug 56: np.abs returns Double for integer input (should preserve dtype) - Bug 58: astype(int32) uses banker's rounding instead of truncation - Bug 60: argmax ignores NaN (should return first NaN index) - Bug 61: linspace returns float32 instead of float64 Crashes/throws (11 tests): - Bug 27: np.roll static returns int instead of NDArray - Bug 28: floor/ceil cast integer input to Double (NumPy 2.1+ preserves) - Bug 29: fmax/fmin propagate NaN (should ignore, unlike maximum/minimum) - Bug 33: np.any(axis) inverted logic (implements all, not any) - Bug 46: Boolean mask setter throws NotImplementedException - Bug 49: np.all(axis) throws InvalidCastException (NDArray<bool> cast) - Bug 50: nd.roll only supports 3/12 dtypes (Int32/Single/Double) - Bug 53: searchsorted returns wrong indices (broken binary search) - Bug 54: moveaxis fails with negative axis (normalizes against wrong N) - Bug 55: mean crashes on empty arrays (NDIterator can't handle empty) - Bug 57: sum/mean crash on boolean arrays (not in reduction switch) - Bug 59: >= and <= throw IncorrectShapeException - Bug 62: implicit conversion crashes across dtypes - Bug 63: ToString crashes on empty arrays False positives removed (documented in comments): - Bug 25: NEP 50 typed scalars match NumPy 2.4.2 (weak typing = Python int literals only, not applicable to NumSharp) - Bug 26: bool + bool stays bool in NumPy 2.4.2 (changed from 1.x)
1 parent 085ed3e commit 9d6e233

File tree

1 file changed

+1457
-0
lines changed

1 file changed

+1457
-0
lines changed

0 commit comments

Comments
 (0)