Bug 2341927

Summary: scipy fails to build with Python 3.14: TestSystematic::test_bessely, TestSystematic::test_bessely_int and TestSystematic::test_wrightomega fail
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: scipyAssignee: Nikola Forró <nforro>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 42CC: cstratak, david08741, ksurma, mhroncok, mmuzila, nforro, psimovec, python-packagers-sig
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2322407    

Description Karolina Surma 2025-01-24 12:47:53 UTC
scipy fails to build with Python 3.14.0a4.

FAILED scipy/special/tests/test_mpmath.py::TestSystematic::test_bessely - Ass...
FAILED scipy/special/tests/test_mpmath.py::TestSystematic::test_bessely_int
FAILED scipy/special/tests/test_mpmath.py::TestSystematic::test_wrightomega.

_________________________ TestSystematic.test_bessely __________________________
[gw2] linux -- Python 3.14.0 /usr/bin/python3

self = <scipy.special.tests.test_mpmath.TestSystematic object at 0x7fc8361cb430>

    def test_bessely(self):
        def mpbessely(v, x):
            r = float(mpmath.bessely(v, x, **HYPERKW))
            if abs(r) > 1e305:
                # overflowing to inf a bit earlier is OK
                r = np.inf * np.sign(r)
            if abs(r) == 0 and x == 0:
                # invalid result from mpmath, point x=0 is a divergence
                return np.nan
            return r
>       assert_mpmath_equal(
            sc.yv,
            exception_to_nan(mpbessely),
            [Arg(-1e100, 1e100), Arg(-1e8, 1e8)],
            n=5000,
        )

scipy/special/tests/test_mpmath.py:831: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
scipy/special/_mptestutils.py:295: in assert_mpmath_equal
    d.check()
scipy/special/_mptestutils.py:282: in check
    raise value
scipy/special/_mptestutils.py:263: in check
    assert_func_equal(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

func = <ufunc 'yv'>
results = <function MpmathData.check.<locals>.<lambda> at 0x7fc82ec6e140>
points = array([[-1.00000000e+100, -1.00000000e+008],
       [-1.00000000e+100, -1.33352143e+007],
       [-1.00000000e+100, -1...7941e+006],
       [ 1.00000000e+100,  1.33352143e+007],
       [ 1.00000000e+100,  1.00000000e+008]], shape=(5041, 2))
rtol = 1e-07, atol = 1e-300, param_filter = None, knownfailure = None
vectorized = False, dtype = None, nan_ok = True, ignore_inf_sign = False
distinguish_nan_and_inf = True

    def assert_func_equal(func, results, points, rtol=None, atol=None,
                          param_filter=None, knownfailure=None,
                          vectorized=True, dtype=None, nan_ok=False,
                          ignore_inf_sign=False, distinguish_nan_and_inf=True):
        if hasattr(points, 'next'):
            # it's a generator
            points = list(points)
    
        points = np.asarray(points)
        if points.ndim == 1:
            points = points[:,None]
        nparams = points.shape[1]
    
        if hasattr(results, '__name__'):
            # function
            data = points
            result_columns = None
            result_func = results
        else:
            # dataset
            data = np.c_[points, results]
            result_columns = list(range(nparams, data.shape[1]))
            result_func = None
    
        fdata = FuncData(func, data, list(range(nparams)),
                         result_columns=result_columns, result_func=result_func,
                         rtol=rtol, atol=atol, param_filter=param_filter,
                         knownfailure=knownfailure, nan_ok=nan_ok, vectorized=vectorized,
                         ignore_inf_sign=ignore_inf_sign,
                         distinguish_nan_and_inf=distinguish_nan_and_inf)
>       fdata.check()
E       AssertionError: 
E       Max |adiff|: 0
E       Max |rdiff|: 0
E       Bad results (9 out of 1708) for the following points (in output 0):
E               -2.371373705661655e+13                              0. =>                            inf !=                           -inf  (rdiff                             0.)
E                   -8.947368421052632                              0. =>                            inf !=                           -inf  (rdiff                             0.)
E                   -7.894736842105263                              0. =>                           -inf !=                            inf  (rdiff                             0.)
E                   -6.842105263157895                              0. =>                            inf !=                           -inf  (rdiff                             0.)
E                   -5.789473684210526                              0. =>                           -inf !=                            inf  (rdiff                             0.)
E                  -4.7368421052631575                              0. =>                            inf !=                           -inf  (rdiff                             0.)
E                  -3.6842105263157894                              0. =>                           -inf !=                            inf  (rdiff                             0.)
E                   -2.631578947368421                              0. =>                            inf !=                           -inf  (rdiff                             0.)
E                  -1.5789473684210527                              0. =>                           -inf !=                            inf  (rdiff                             0.)

scipy/special/_testutils.py:85: AssertionError
_______________________ TestSystematic.test_bessely_int ________________________
[gw2] linux -- Python 3.14.0 /usr/bin/python3

self = <scipy.special.tests.test_mpmath.TestSystematic object at 0x7fc83615fec0>

    def test_bessely_int(self):
        def mpbessely(v, x):
            r = float(mpmath.bessely(v, x))
            if abs(r) == 0 and x == 0:
                # invalid result from mpmath, point x=0 is a divergence
                return np.nan
            return r
>       assert_mpmath_equal(
            lambda v, z: sc.yn(int(v), z),
            exception_to_nan(mpbessely),
            [IntArg(-1000, 1000), Arg(-1e8, 1e8)],
        )

scipy/special/tests/test_mpmath.py:860: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
scipy/special/_mptestutils.py:295: in assert_mpmath_equal
    d.check()
scipy/special/_mptestutils.py:282: in check
    raise value
scipy/special/_mptestutils.py:263: in check
    assert_func_equal(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

func = <function TestSystematic.test_bessely_int.<locals>.<lambda> at 0x7fc82ec6f5e0>
results = <function MpmathData.check.<locals>.<lambda> at 0x7fc82ec6f7f0>
points = array([[-1.00000000e+03, -1.00000000e+08],
       [-1.00000000e+03, -3.16227766e+04],
       [-1.00000000e+03, -1.0000....00000000e+01,  1.00000000e+01],
       [ 1.00000000e+01,  3.16227766e+04],
       [ 1.00000000e+01,  1.00000000e+08]])
rtol = 1e-07, atol = 1e-300, param_filter = None, knownfailure = None
vectorized = False, dtype = None, nan_ok = True, ignore_inf_sign = False
distinguish_nan_and_inf = True

    def assert_func_equal(func, results, points, rtol=None, atol=None,
                          param_filter=None, knownfailure=None,
                          vectorized=True, dtype=None, nan_ok=False,
                          ignore_inf_sign=False, distinguish_nan_and_inf=True):
        if hasattr(points, 'next'):
            # it's a generator
            points = list(points)
    
        points = np.asarray(points)
        if points.ndim == 1:
            points = points[:,None]
        nparams = points.shape[1]
    
        if hasattr(results, '__name__'):
            # function
            data = points
            result_columns = None
            result_func = results
        else:
            # dataset
            data = np.c_[points, results]
            result_columns = list(range(nparams, data.shape[1]))
            result_func = None
    
        fdata = FuncData(func, data, list(range(nparams)),
                         result_columns=result_columns, result_func=result_func,
                         rtol=rtol, atol=atol, param_filter=param_filter,
                         knownfailure=knownfailure, nan_ok=nan_ok, vectorized=vectorized,
                         ignore_inf_sign=ignore_inf_sign,
                         distinguish_nan_and_inf=distinguish_nan_and_inf)
>       fdata.check()
E       AssertionError: 
E       Max |adiff|: 0
E       Max |rdiff|: 0
E       Bad results (2 out of 198) for the following points (in output 0):
E                                  -5.                              0. =>                            inf !=                           -inf  (rdiff                             0.)
E                                  -3.                              0. =>                            inf !=                           -inf  (rdiff                             0.)

scipy/special/_testutils.py:85: AssertionError
_______________________ TestSystematic.test_wrightomega ________________________
[gw2] linux -- Python 3.14.0 /usr/bin/python3

self = <scipy.special.tests.test_mpmath.TestSystematic object at 0x7fc835852440>

    def test_wrightomega(self):
>       assert_mpmath_equal(
            sc.wrightomega,
            lambda z: _mpmath_wrightomega(z, 25),
            [ComplexArg()],
            rtol=1e-14,
            nan_ok=False,
        )

scipy/special/tests/test_mpmath.py:2066: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
scipy/special/_mptestutils.py:295: in assert_mpmath_equal
    d.check()
scipy/special/_mptestutils.py:282: in check
    raise value
scipy/special/_mptestutils.py:263: in check
    assert_func_equal(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

func = <ufunc 'wrightomega'>
results = <function MpmathData.check.<locals>.<lambda> at 0x7fc82f419d20>
points = array([[-8.98846567e+307-8.98846567e+307j],
       [-8.98846567e+307-2.99807700e+154j],
       [-8.98846567e+307-1.000...846567e+307+1.00000000e+001j],
       [ 8.98846567e+307+2.99807700e+154j],
       [ 8.98846567e+307+8.98846567e+307j]])
rtol = 1e-14, atol = 1e-300, param_filter = None, knownfailure = None
vectorized = False, dtype = None, nan_ok = False, ignore_inf_sign = False
distinguish_nan_and_inf = True

    def assert_func_equal(func, results, points, rtol=None, atol=None,
                          param_filter=None, knownfailure=None,
                          vectorized=True, dtype=None, nan_ok=False,
                          ignore_inf_sign=False, distinguish_nan_and_inf=True):
        if hasattr(points, 'next'):
            # it's a generator
            points = list(points)
    
        points = np.asarray(points)
        if points.ndim == 1:
            points = points[:,None]
        nparams = points.shape[1]
    
        if hasattr(results, '__name__'):
            # function
            data = points
            result_columns = None
            result_func = results
        else:
            # dataset
            data = np.c_[points, results]
            result_columns = list(range(nparams, data.shape[1]))
            result_func = None
    
        fdata = FuncData(func, data, list(range(nparams)),
                         result_columns=result_columns, result_func=result_func,
                         rtol=rtol, atol=atol, param_filter=param_filter,
                         knownfailure=knownfailure, nan_ok=nan_ok, vectorized=vectorized,
                         ignore_inf_sign=ignore_inf_sign,
                         distinguish_nan_and_inf=distinguish_nan_and_inf)
>       fdata.check()
E       AssertionError: 
E       Max |adiff|: 7.17692
E       Max |rdiff|: 3.42033
E       Bad results (54 out of 506) for the following points (in output 0):
E              -10.-8.571428571428571j => -12.63394994786346-5.86441862392082j != -12.887104225696952-12.482471202020964j  (rdiff             0.3691426975636848)
E              -10.-7.142857142857143j => -12.588780691160748-4.332740374985424j != -12.82690329308715-10.99300959785819j  (rdiff            0.39451241621956645)
E                            -10.+10.j => -12.686465687181895+7.385609225423199j != -12.529313898162737+0.6250692587524965j  (rdiff             0.5390531889826776)
E       -8.333333333333334-8.571428571428571j => -10.848049847699246-5.930104817732772j != -11.154488837022456-12.557520132182585j  (rdiff            0.39499870863851555)
E       -8.333333333333334-7.142857142857143j => -10.78832976776452-4.387526406820558j != -11.084774296801776-11.069142353662336j  (rdiff             0.4269459559668915)
E              -8.333333333333334+10.j => -10.915031085315489+7.457810218719737j != -10.705879059754103+0.6344110123539025j  (rdiff             0.6365333897338118)
E       -6.666666666666667-8.571428571428571j => -9.05263288844341-6.0164085918224j != -9.424744923227854-12.643242971064776j  (rdiff              0.420892856593807)
E       -6.666666666666667-7.142857142857143j => -8.97125105965259-4.462881908561105j != -9.344542269905023-11.158071930486296j  (rdiff             0.4607340339612758)
E              -6.666666666666667+10.j => -9.139309978398686+7.548783477002024j != -8.849730160127592+0.6483539503246142j  (rdiff             0.7783335981029291)
E               -5.-8.571428571428571j => -7.2508717236828115-6.131807854590283j != -7.700456108866808-12.740151291390465j  (rdiff             0.4449407256258271)
E               -5.-7.142857142857143j => -7.137165962978866-4.5708857028625145j != -7.609401609110921-11.260994527431874j  (rdiff             0.4934733704736018)
E                             -5.+10.j => -7.363493198324825+7.663786030958419j != -6.9422903363153186+0.6716727200992746j  (rdiff             1.0043129086743958)
E       -3.3333333333333335-8.571428571428571j => -5.452134758503554-6.286167088640288j != -5.984699571636524-12.847892638117536j  (rdiff             0.4644832557658418)
E       -3.3333333333333335-7.142857142857143j => -5.293304001284589-4.730583570572279j != -5.8834945294980034-11.37801772502132j  (rdiff             0.5210004632817236)
E             -3.3333333333333335+10.j => -5.595672164986294+7.807344829155983j != -4.941503489303835+0.7198859176740809j  (rdiff              1.425322736359115)
E       -1.6666666666666667-8.571428571428571j => -3.675436554787932-6.485013739967222j != -4.280648931051868-12.96491510053344j  (rdiff            0.47666837512174637)
E       -1.6666666666666667-7.142857142857143j => -3.46731105262128-4.96217549983834j != -4.171393030221279-11.507484520210541j  (rdiff             0.5378232707788443)
E             -1.6666666666666667+10.j => -3.848129866424136+7.979873307974236j != -2.7176520143931153+0.8925504707315325j  (rdiff             2.5090004207064704)
E       -1.405721108836252e-10-8.571428571428571j => -1.9451574549966566-6.718828315834169j != -2.5909447509697903-13.088386670623484j  (rdiff              0.479840635581261)
E       -1.405721108836252e-10-7.142857142857143j => -1.7099520395363859-5.257617990015605j != -2.477058524456513-11.645667318267073j  (rdiff             0.5403863643215897)
E          -1.405721108836252e-10+10.j => -2.1339050354418716+8.173838080291207j != -0.6488910227160584+1.8000299421069414j  (rdiff             3.4203281872732694)
E       -1.1856311014966939e-20-8.571428571428571j => -1.9451574548531982-6.718828315854685j != -2.5909447508279317-13.088386670634067j  (rdiff             0.4798406355811497)
E       -1.1856311014966939e-20-7.142857142857143j => -1.709952039392268-5.257617990041863j != -2.477058524314434-11.645667318278953j  (rdiff             0.5403863643212252)
E         -1.1856311014966939e-20+10.j => -2.1339050352989584+8.173838080308078j != -0.6488910225901608+1.8000299421821735j  (rdiff             3.4203281871913545)
E       -9.999999999999999e-31-8.571428571428571j => -1.9451574548531982-6.718828315854685j != -2.5909447508279317-13.088386670634067j  (rdiff             0.4798406355811497)
E       -9.999999999999999e-31-7.142857142857143j => -1.709952039392268-5.257617990041863j != -2.477058524314434-11.645667318278953j  (rdiff             0.5403863643212252)
E          -9.999999999999999e-31+10.j => -2.1339050352989584+8.173838080308078j != -0.6488910225901608+1.8000299421821735j  (rdiff             3.4203281871913545)
E                0.-8.571428571428571j => -1.9451574548531982-6.718828315854685j != -2.5909447508279317-13.088386670634067j  (rdiff             0.4798406355811497)
E                0.-7.142857142857143j => -1.709952039392268-5.257617990041863j != -2.477058524314434-11.645667318278953j  (rdiff             0.5403863643212252)
E                              0.+10.j => -2.1339050352989584+8.173838080308078j != -0.6488910225901608+1.8000299421821735j  (rdiff             3.4203281871913545)
E       9.999999999999999e-31-8.571428571428571j => -1.9451574548531982-6.718828315854685j != -2.5909447508279317-13.088386670634067j  (rdiff             0.4798406355811497)
E       9.999999999999999e-31-7.142857142857143j => -1.709952039392268-5.257617990041863j != -2.477058524314434-11.645667318278953j  (rdiff             0.5403863643212252)
E           9.999999999999999e-31+10.j => -2.1339050352989584+8.173838080308078j != -0.6488910225901608+1.8000299421821735j  (rdiff             3.4203281871913545)
E       1.2909944487358053e-15-8.571428571428571j => -1.945157454853197-6.718828315854685j != -2.5909447508279304-13.088386670634067j  (rdiff             0.4798406355811497)
E       1.2909944487358053e-15-7.142857142857143j => -1.7099520393922665-5.257617990041863j != -2.4770585243144327-11.645667318278953j  (rdiff             0.5403863643212252)
E          1.2909944487358053e-15+10.j => -2.133905035298957+8.173838080308078j != -0.6488910225901596+1.8000299421821742j  (rdiff              3.420328187191354)
E       1.6666666666666667-8.571428571428571j => -0.2744654544078355-6.961224903612194j != -0.9170526290715416-13.21453134905898j  (rdiff            0.47456491852587757)
E       1.6666666666666667-7.142857142857143j => -0.049538603658034815-5.563156285649778j != -0.8026653766199635-11.787255047979839j  (rdiff             0.5306589443194261)
E              1.6666666666666667+10.j => -0.46001058073638723+8.374327777835772j != 0.7323492458182184+2.437849354033908j  (rdiff              2.378745878979051)
E       3.3333333333333335-8.571428571428571j => 1.344066684743253-7.185546807633524j != 0.7410766961813078-13.339316323647907j  (rdiff             0.4628214302875423)
E       3.3333333333333335-7.142857142857143j => 1.536760660329162-5.829801945949534j != 0.8520199037001486-11.926563806151691j  (rdiff              0.513098177198048)
E              3.3333333333333335+10.j => 1.1762305687474846+8.565669352480688j != 2.0857149889844546+2.788260375252278j  (rdiff              1.679635124563892)
E                5.-8.571428571428571j => 2.928303012550468-7.378439959771553j != 2.3848804554669596-13.459190695934964j  (rdiff            0.44663483100444384)
E                5.-7.142857142857143j => 3.085152714946432-6.0440304625195385j != 2.489337914027316-12.058819508882655j  (rdiff             0.4908785913716135)
E                              5.+10.j => 2.784012385424369+8.73765641163547j != 3.475316206987332+3.0040260096615476j  (rdiff             1.2571928668990136)
E       6.666666666666667-8.571428571428571j => 4.494588794540864-7.538279055468969j != 4.016705172536024-13.57156814224922j  (rdiff             0.4276107161501826)
E       6.666666666666667-7.142857142857143j => 4.620087592672436-6.211573713052354j != 4.1128191129485066-12.180872759181172j  (rdiff             0.4659764152216193)
E               6.666666666666667+10.j => 4.373672713023876+8.886565143149184j != 4.904207319937926+3.146388982246719j  (rdiff             0.9893408011166066)
E       8.333333333333334-8.571428571428571j => 6.053967293437565-7.668888081916271j != 5.639242255141361-13.674948512964784j  (rdiff             0.4069993519706444)
E       8.333333333333334-7.142857142857143j => 6.154326207772091-6.342409520380234j != 5.726235077575571-12.291226985918055j  (rdiff             0.4398492652499389)
E               8.333333333333334+10.j => 5.953619319079618+9.012967694058363j != 6.366752512330605+3.245403589051223j  (rdiff             0.8091490866131626)
E               10.-8.571428571428571j => 7.612905603565097-7.775466896748945j != 7.255086424464743-13.768771098081224j  (rdiff             0.3857786069139004)
E               10.-7.142857142857143j => 7.693737389287936-6.445511616556784j != 7.3329739084336705-12.389660586883695j  (rdiff             0.4136312781970903)
E                             10.+10.j => 7.5296802758532015+9.119406172153722j != 7.856617067125642+3.3172932633531174j  (rdiff             0.6814204517254607)



https://docs.python.org/3.14/whatsnew/3.14.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.14/fedora-rawhide-x86_64/08566786-scipy/

For all our attempts to build scipy with Python 3.14, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14/package/scipy/

Testing and mass rebuild of packages is happening in copr.
You can follow these instructions to test locally in mock if your package builds with Python 3.14:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14/

Let us know here if you have any questions.

Python 3.14 is planned to be included in Fedora 43.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.14.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires),
so if this package is required a lot, it's important for us to get it fixed soon.

We'd appreciate help from the people who know this package best,
but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Aoife Moloney 2025-02-26 13:48:45 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 42 development cycle.
Changing version to 42.