Skip to content

np.allclose causing issues in check_values_equal #142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
chrispyles opened this issue Dec 14, 2021 · 0 comments · Fixed by #168
Closed

np.allclose causing issues in check_values_equal #142

chrispyles opened this issue Dec 14, 2021 · 0 comments · Fixed by #168

Comments

@chrispyles
Copy link
Contributor

I think np.allclose is causing issues related to overflow when comparing very large integers. In a recent project, I was trying to compare Fibonacci numbers and started experiencing issues around fib(94), which throws a TypeError when compared with numpy and thus results in check_values_equal returning False.

>>> np.isclose(19740274219868223167, 19740274219868223167)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<__array_function__ internals>", line 5, in isclose
  File "C:\Users\v-chpyles\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\numpy\core\numeric.py", line 2355, in isclose
    xfin = isfinite(x)
TypeError: 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''

image

chrispyles added a commit to chrispyles/pybryt that referenced this issue Mar 23, 2022
@chrispyles chrispyles mentioned this issue Mar 23, 2022
leestott added a commit that referenced this issue Mar 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant