@@ -2335,53 +2335,53 @@ def test_precisions_consistent(self):
2335
2335
2336
2336
def test_branch_cuts (self ):
2337
2337
# check branch cuts and continuity on them
2338
- yield _check_branch_cut , np .log , - 0.5 , 1j , 1 , - 1 , True
2339
- yield _check_branch_cut , np .log2 , - 0.5 , 1j , 1 , - 1 , True
2340
- yield _check_branch_cut , np .log10 , - 0.5 , 1j , 1 , - 1 , True
2341
- yield _check_branch_cut , np .log1p , - 1.5 , 1j , 1 , - 1 , True
2342
- yield _check_branch_cut , np .sqrt , - 0.5 , 1j , 1 , - 1 , True
2338
+ _check_branch_cut ( np .log , - 0.5 , 1j , 1 , - 1 , True )
2339
+ _check_branch_cut ( np .log2 , - 0.5 , 1j , 1 , - 1 , True )
2340
+ _check_branch_cut ( np .log10 , - 0.5 , 1j , 1 , - 1 , True )
2341
+ _check_branch_cut ( np .log1p , - 1.5 , 1j , 1 , - 1 , True )
2342
+ _check_branch_cut ( np .sqrt , - 0.5 , 1j , 1 , - 1 , True )
2343
2343
2344
- yield _check_branch_cut , np .arcsin , [ - 2 , 2 ], [1j , 1j ], 1 , - 1 , True
2345
- yield _check_branch_cut , np .arccos , [ - 2 , 2 ], [1j , 1j ], 1 , - 1 , True
2346
- yield _check_branch_cut , np .arctan , [0 - 2j , 2j ], [1 , 1 ], - 1 , 1 , True
2344
+ _check_branch_cut ( np .arcsin , [ - 2 , 2 ], [1j , 1j ], 1 , - 1 , True )
2345
+ _check_branch_cut ( np .arccos , [ - 2 , 2 ], [1j , 1j ], 1 , - 1 , True )
2346
+ _check_branch_cut ( np .arctan , [0 - 2j , 2j ], [1 , 1 ], - 1 , 1 , True )
2347
2347
2348
- yield _check_branch_cut , np .arcsinh , [0 - 2j , 2j ], [1 , 1 ], - 1 , 1 , True
2349
- yield _check_branch_cut , np .arccosh , [ - 1 , 0.5 ], [1j , 1j ], 1 , - 1 , True
2350
- yield _check_branch_cut , np .arctanh , [ - 2 , 2 ], [1j , 1j ], 1 , - 1 , True
2348
+ _check_branch_cut ( np .arcsinh , [0 - 2j , 2j ], [1 , 1 ], - 1 , 1 , True )
2349
+ _check_branch_cut ( np .arccosh , [ - 1 , 0.5 ], [1j , 1j ], 1 , - 1 , True )
2350
+ _check_branch_cut ( np .arctanh , [ - 2 , 2 ], [1j , 1j ], 1 , - 1 , True )
2351
2351
2352
2352
# check against bogus branch cuts: assert continuity between quadrants
2353
- yield _check_branch_cut , np .arcsin , [0 - 2j , 2j ], [ 1 , 1 ], 1 , 1
2354
- yield _check_branch_cut , np .arccos , [0 - 2j , 2j ], [ 1 , 1 ], 1 , 1
2355
- yield _check_branch_cut , np .arctan , [ - 2 , 2 ], [1j , 1j ], 1 , 1
2353
+ _check_branch_cut ( np .arcsin , [0 - 2j , 2j ], [ 1 , 1 ], 1 , 1 )
2354
+ _check_branch_cut ( np .arccos , [0 - 2j , 2j ], [ 1 , 1 ], 1 , 1 )
2355
+ _check_branch_cut ( np .arctan , [ - 2 , 2 ], [1j , 1j ], 1 , 1 )
2356
2356
2357
- yield _check_branch_cut , np .arcsinh , [ - 2 , 2 , 0 ], [1j , 1j , 1 ], 1 , 1
2358
- yield _check_branch_cut , np .arccosh , [0 - 2j , 2j , 2 ], [1 , 1 , 1j ], 1 , 1
2359
- yield _check_branch_cut , np .arctanh , [0 - 2j , 2j , 0 ], [1 , 1 , 1j ], 1 , 1
2357
+ _check_branch_cut ( np .arcsinh , [ - 2 , 2 , 0 ], [1j , 1j , 1 ], 1 , 1 )
2358
+ _check_branch_cut ( np .arccosh , [0 - 2j , 2j , 2 ], [1 , 1 , 1j ], 1 , 1 )
2359
+ _check_branch_cut ( np .arctanh , [0 - 2j , 2j , 0 ], [1 , 1 , 1j ], 1 , 1 )
2360
2360
2361
2361
def test_branch_cuts_complex64 (self ):
2362
2362
# check branch cuts and continuity on them
2363
- yield _check_branch_cut , np .log , - 0.5 , 1j , 1 , - 1 , True , np .complex64
2364
- yield _check_branch_cut , np .log2 , - 0.5 , 1j , 1 , - 1 , True , np .complex64
2365
- yield _check_branch_cut , np .log10 , - 0.5 , 1j , 1 , - 1 , True , np .complex64
2366
- yield _check_branch_cut , np .log1p , - 1.5 , 1j , 1 , - 1 , True , np .complex64
2367
- yield _check_branch_cut , np .sqrt , - 0.5 , 1j , 1 , - 1 , True , np .complex64
2363
+ _check_branch_cut ( np .log , - 0.5 , 1j , 1 , - 1 , True , np .complex64 <
F987
span class="x x-first x-last">)
2364
+ _check_branch_cut ( np .log2 , - 0.5 , 1j , 1 , - 1 , True , np .complex64 )
2365
+ _check_branch_cut ( np .log10 , - 0.5 , 1j , 1 , - 1 , True , np .complex64 )
2366
+ _check_branch_cut ( np .log1p , - 1.5 , 1j , 1 , - 1 , True , np .complex64 )
2367
+ _check_branch_cut ( np .sqrt , - 0.5 , 1j , 1 , - 1 , True , np .complex64 )
2368
2368
2369
- yield _check_branch_cut , np .arcsin , [ - 2 , 2 ], [1j , 1j ], 1 , - 1 , True , np .complex64
2370
- yield _check_branch_cut , np .arccos , [ - 2 , 2 ], [1j , 1j ], 1 , - 1 , True , np .complex64
2371
- yield _check_branch_cut , np .arctan , [0 - 2j , 2j ], [1 , 1 ], - 1 , 1 , True , np .complex64
2369
+ _check_branch_cut ( np .arcsin , [ - 2 , 2 ], [1j , 1j ], 1 , - 1 , True , np .complex64 )
2370
+ _check_branch_cut ( np .arccos , [ - 2 , 2 ], [1j , 1j ], 1 , - 1 , True , np .complex64 )
2371
+ _check_branch_cut ( np .arctan , [0 - 2j , 2j ], [1 , 1 ], - 1 , 1 , True , np .complex64 )
2372
2372
2373
- yield _check_branch_cut , np .arcsinh , [0 - 2j , 2j ], [1 , 1 ], - 1 , 1 , True , np .complex64
2374
- yield _check_branch_cut , np .arccosh , [ - 1 , 0.5 ], [1j , 1j ], 1 , - 1 , True , np .complex64
2375
- yield _check_branch_cut , np .arctanh , [ - 2 , 2 ], [1j , 1j ], 1 , - 1 , True , np .complex64
2373
+ _check_branch_cut ( np .arcsinh , [0 - 2j , 2j ], [1 , 1 ], - 1 , 1 , True , np .complex64 )
2374
+ _check_branch_cut ( np .arccosh , [ - 1 , 0.5 ], [1j , 1j ], 1 , - 1 , True , np .complex64 )
2375
+ _check_branch_cut ( np .arctanh , [ - 2 , 2 ], [1j , 1j ], 1 , - 1 , True , np .complex64 )
2376
2376
2377
2377
# check against bogus branch cuts: assert continuity between quadrants
2378
- yield _check_branch_cut , np .arcsin , [0 - 2j , 2j ], [ 1 , 1 ], 1 , 1 , False , np .complex64
2379
- yield _check_branch_cut , np .arccos , [0 - 2j , 2j ], [ 1 , 1 ], 1 , 1 , False , np .complex64
2380
- yield _check_branch_cut , np .arctan , [ - 2 , 2 ], [1j , 1j ], 1 , 1 , False , np .complex64
2378
+ _check_branch_cut ( np .arcsin , [0 - 2j , 2j ], [ 1 , 1 ], 1 , 1 , False , np .complex64 )
2379
+ _check_branch_cut ( np .arccos , [0 - 2j , 2j ], [ 1 , 1 ], 1 , 1 , False , np .complex64 )
2380
+ _check_branch_cut ( np .arctan , [ - 2 , 2 ], [1j , 1j ], 1 , 1 , False , np .complex64 )
2381
2381
2382
- yield _check_branch_cut , np .arcsinh , [ - 2 , 2 , 0 ], [1j , 1j , 1 ], 1 , 1 , False , np .complex64
2383
- yield _check_branch_cut , np .arccosh , [0 - 2j , 2j , 2 ], [1 , 1 , 1j ], 1 , 1 , False , np .complex64
2384
- yield _check_branch_cut , np .arctanh , [0 - 2j , 2j , 0 ], [1 , 1 , 1j ], 1 , 1 , False , np .complex64
2382
+ _check_branch_cut ( np .arcsinh , [ - 2 , 2 , 0 ], [1j , 1j , 1 ], 1 , 1 , False , np .complex64 )
2383
+ _check_branch_cut ( np .arccosh , [0 - 2j , 2j , 2 ], [1 , 1 , 1j ], 1 , 1 , False , np .complex64 )
2384
+ _check_branch_cut ( np .arctanh , [0 - 2j , 2j , 0 ], [1 , 1 , 1j ], 1 , 1 , False , np .complex64 )
2385
2385
2386
2386
def test_against_cmath (self ):
2387
2387
import cmath
@@ -2489,7 +2489,7 @@ def check(func, z0, d=1):
2489
2489
2490
2490
def test_loss_of_precision (self ):
2491
2491
for dtype in [np .complex64 , np .complex_ ]:
2492
- yield self .check_loss_of_precision , dtype
2492
+ self .check_loss_of_precision ( dtype )
2493
2493
2494
2494
@dec .knownfailureif (is_longdouble_finfo_bogus (), "Bogus long double finfo" )
2495
2495
def test_loss_of_precision_longcomplex (self ):
0 commit comments