This should use ``np.isinf`` instead (and it will catch the -inf case)