fix(ga): Suppress divide-by-zero warning in NumPy solver #17
Reference in New Issue
Block a user
Delete Branch "v0.4.1-dev"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.