The _solve_x_numpy method was correctly using np.where(error == 0, ...) to handle perfect roots. However, NumPy eagerly calculates 1.0 / error for the entire array before applying the where condition, which was causing a RuntimeWarning: divide by zero when a perfect root was found.
This warning was harmless but created unnecessary console noise during testing and use.
This commit wraps the ranks = ... assignments in a with np.errstate(divide='ignore'): block to silence this specific, expected warning. The CUDA kernel is unaffected as its ternary operator already prevents this calculation.
The `_solve_x_numpy` method was correctly using `np.where(error == 0, ...)` to handle perfect roots. However, NumPy eagerly calculates `1.0 / error` for the entire array before applying the `where` condition, which was causing a `RuntimeWarning: divide by zero` when a perfect root was found.
This warning was harmless but created unnecessary console noise during testing and use.
This commit wraps the `ranks = ...` assignments in a `with np.errstate(divide='ignore'):` block to silence this specific, expected warning. The CUDA kernel is unaffected as its ternary operator already prevents this calculation.
The `_solve_x_numpy` method was correctly using `np.where(error == 0, ...)` to handle perfect roots. However, NumPy eagerly calculates `1.0 / error` for the entire array before applying the `where` condition, which was causing a `RuntimeWarning: divide by zero` when a perfect root was found.
This warning was harmless but created unnecessary console noise during testing and use.
This commit wraps the `ranks = ...` assignments in a `with np.errstate(divide='ignore'):` block to silence this specific, expected warning. The CUDA kernel is unaffected as its ternary operator already prevents this calculation.
jono
merged commit 7c75000637 into main2025-10-27 16:26:58 +00:00
jono
deleted branch v0.4.1-dev2025-10-27 16:26:58 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
The
_solve_x_numpymethod was correctly usingnp.where(error == 0, ...)to handle perfect roots. However, NumPy eagerly calculates1.0 / errorfor the entire array before applying thewherecondition, which was causing aRuntimeWarning: divide by zerowhen a perfect root was found.This warning was harmless but created unnecessary console noise during testing and use.
This commit wraps the
ranks = ...assignments in awith np.errstate(divide='ignore'):block to silence this specific, expected warning. The CUDA kernel is unaffected as its ternary operator already prevents this calculation.