w2_unittest.test_reduced_row_echelon_form(reduced_row_echelon_form) returned an error. I’m not sure if it’s my code or your code.
An exception was thrown while running your function: ufunc 'isfinite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''.
Input matrix:
{'A': array([[0., 0., 0.],
[0., 0., 0.],
[0., 0., 0.],
[0., 0., 0.]]), 'B': array([[0.],
[0.],
[0.],
[0.]])}
It worked for me, so my suggestion is that you should start with the theory that your code is incorrect.
Notice that the error message talking about infinity there, so maybe you divided by zero when you shouldn’t have. That is a risk with that test case, right? Your logic needs to handle the case that there is no non-zero “pivot” value.