question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The test suite fails on Python 3.10: issue with factorial() on NaN

See original GitHub issue

On Python 3.10, test_mixed_nan_inputs() of scipy.special.tests.test_basic.TestFactorialFunctions fails with:

                if un.size:
>                   val = math.factorial(un[0])
E                   TypeError: 'float' object cannot be interpreted as an integer

See the downstream Fedora issue: https://bugzilla.redhat.com/show_bug.cgi?id=1898157

I wrote PR #13121 to fix this issue.

The issue was worked around by the commit f7b6202ae69282b0942a2f5671737a85a558e1b9 for Python 3.9:

commit f7b6202ae69282b0942a2f5671737a85a558e1b9
Author: Ralf Gommers <ralf.gommers@gmail.com>
Date:   Sat May 9 15:31:07 2020 +0200

    TST: filter out deprecation warning for using factorial() with floats
    
    This was failing in py3.9-dev CI

cc @rgommers

Scipy/Numpy/Python version information:

  • scipy 1.5.4-1.fc33
  • Python 3.10.0a2
  • python3-numpy 1:1.19.4-2.fc34

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
NeilGirdharcommented, Jul 16, 2021

@rgommers Okay, I trust you 😄. I hope you don’t mind that I’ll link your comment to the issue that I’ll file with Poetry.

0reactions
rgommerscommented, Jul 16, 2021

That’s unrelated to this issue. Python 3.10 is simply not yet released and 1.7.0 therefore does not support it. Why is Poetry trying to use Python 3.10 already?

Because of that limit, poetry refuses to upgrade SciPy on any project that leaves the Python version unbounded.

This seems like bad design anyway on Poetry’s side. After Python 3.10.0 is released, it takes a while for projects to put up wheels that support that new Python version. So at that point Poetry will refuse to work for pretty much anyone that does not have an upper bound on Python version.

I noticed that NumPy doesn’t seem to do have this behaviour.

It will after I fix it. Currently setup.py says python_requires='>=3.7',, which is wrong on the 1.21.x maintenance branch.

Read more comments on GitHub >

github_iconTop Results From Across the Web

1898157 – scipy fails to build with Python 3.10: TypeError
scipy fails to build with Python 3.10.0a2. [gw2] linux -- Python 3.10.0 /usr/bin/python3 self = <scipy.special.tests.test_basic.
Read more >
Skip factorial() float tests on Python 3.10 - resolves: #1898157
Skip factorial() float tests on Python 3.10 - resolves: #1898157. Build failed. failure. Built as scipy-1.5.4-2.fc34. 2 years ago. Build failed. failure.
Read more >
math — Mathematical functions — Python 3.11.1 documentation
This module provides access to the mathematical functions defined by the C standard. These functions cannot be used with complex numbers; use the...
Read more >
Changelog — Python 3.11.1 documentation
SetValueEx() now leaves the target value untouched in the case of ... and at least Microsoft Python 3.10.2288.0 installed without the Lib/test package....
Read more >
What's New In Python 3.11 — Python 3.11.1 documentation
Python 3.11 is between 10-60% faster than Python 3.10. On average, we measured a 1.25x speedup on the standard benchmark suite. See Faster...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found