@@ -52,9 +52,9 @@ _CanArray1D2D: TypeAlias = onp.CanArrayND[_SCT, tuple[int] | tuple[int, int]]
52
52
_ToSpMatrix : TypeAlias = spmatrix [_SCT ] | _ToArray2D [_SCT ]
53
53
_ToSparse2D : TypeAlias = _spbase [_SCT , tuple [int , int ]] | _ToArray2D [_SCT ]
54
54
55
- _SpBase : TypeAlias = _spbase [_SCT , _ShapeT ] | Any
56
- _SpMatrix : TypeAlias = spmatrix [_SCT ] | Any
57
- _SpArray : TypeAlias = sparray [_SCT , _ShapeT ] | Any
55
+ _SpBase : TypeAlias = _spbase [_SCT , _ShapeT ]
56
+ _SpMatrix : TypeAlias = spmatrix [_SCT ]
57
+ _SpArray : TypeAlias = sparray [_SCT , _ShapeT ]
58
58
59
59
_SpBase2D : TypeAlias = _SpBase [_SCT , tuple [int , int ]]
60
60
_SpArray2D : TypeAlias = _SpArray [_SCT , tuple [int , int ]]
@@ -1384,38 +1384,262 @@ def kronsum(A: onp.ToComplex2D, B: onp.ToComplex2D, format: _Format | None = Non
1384
1384
# NOTE: keep in sync with `vstack`
1385
1385
@overload # sparray, format: <default>, dtype: <default>
1386
1386
def hstack (blocks : Seq [_CanStack [_T ]], format : None = None , dtype : None = None ) -> _T : ...
1387
- @overload # sparray, format: <default>, dtype: <known>
1388
- def hstack (blocks : Seq [_CanStackAs [_SCT0 , _T ]], format : None = None , * , dtype : onp .ToDType [_SCT0 ]) -> _T : ...
1387
+ @overload # sparray, format: "bsr", dtype: <default>
1388
+ def hstack (blocks : Seq [_SpArray [_SCT0 ]], format : _FmtBSR , dtype : None = None ) -> _BSRArray [_SCT0 ]: ...
1389
+ @overload # sparray, format: "coo", dtype: <default>
1390
+ def hstack (blocks : Seq [_SpArray [_SCT0 ]], format : _FmtCOO , dtype : None = None ) -> _COOArray2D [_SCT0 ]: ...
1391
+ @overload # sparray, format: "csc", dtype: <default>
1392
+ def hstack (blocks : Seq [_SpArray [_SCT0 ]], format : _FmtCSC , dtype : None = None ) -> _CSCArray [_SCT0 ]: ...
1393
+ @overload # sparray, format: "csr", dtype: <default>
1394
+ def hstack (blocks : Seq [_SpArray [_SCT0 ]], format : _FmtCSR , dtype : None = None ) -> _CSRArray2D [_SCT0 ]: ...
1395
+ @overload # sparray, format: "dia", dtype: <default>
1396
+ def hstack (blocks : Seq [_SpArray [_SCT0 ]], format : _FmtDIA , dtype : None = None ) -> _DIAArray [_SCT0 ]: ...
1397
+ @overload # sparray, format: "dok", dtype: <default>
1398
+ def hstack (blocks : Seq [_SpArray [_SCT0 ]], format : _FmtDOK , dtype : None = None ) -> _DOKArray2D [_SCT0 ]: ...
1399
+ @overload # sparray, format: "lil", dtype: <default>
1400
+ def hstack (blocks : Seq [_SpArray [_SCT0 ]], format : _FmtLIL , dtype : None = None ) -> _LILArray [_SCT0 ]: ...
1401
+
1402
+ #
1389
1403
@overload # sparray, format: <default>, dtype: bool-like
1390
1404
def hstack (blocks : Seq [_CanStackAs [np .bool_ , _T ]], format : None = None , * , dtype : onp .AnyBoolDType ) -> _T : ...
1405
+ @overload # sparray, format: "bsr", dtype: bool-like
1406
+ def hstack (blocks : Seq [_SpArray ], format : _FmtBSR , dtype : onp .AnyBoolDType ) -> _BSRArray [np .bool_ ]: ...
1407
+ @overload # sparray, format: "coo", dtype: bool-like
1408
+ def hstack (blocks : Seq [_SpArray ], format : _FmtCOO , dtype : onp .AnyBoolDType ) -> _COOArray2D [np .bool_ ]: ...
1409
+ @overload # sparray, format: "csc", dtype: bool-like
1410
+ def hstack (blocks : Seq [_SpArray ], format : _FmtCSC , dtype : onp .AnyBoolDType ) -> _CSCArray [np .bool_ ]: ...
1411
+ @overload # sparray, format: "csr", dtype: bool-like
1412
+ def hstack (blocks : Seq [_SpArray ], format : _FmtCSR , dtype : onp .AnyBoolDType ) -> _CSRArray2D [np .bool_ ]: ...
1413
+ @overload # sparray, format: "dia", dtype: bool-like
1414
+ def hstack (blocks : Seq [_SpArray ], format : _FmtDIA , dtype : onp .AnyBoolDType ) -> _DIAArray [np .bool_ ]: ...
1415
+ @overload # sparray, format: "dok", dtype: bool-like
1416
+ def hstack (blocks : Seq [_SpArray ], format : _FmtDOK , dtype : onp .AnyBoolDType ) -> _DOKArray2D [np .bool_ ]: ...
1417
+ @overload # sparray, format: "lil", dtype: bool-like
1418
+ def hstack (blocks : Seq [_SpArray ], format : _FmtLIL , dtype : onp .AnyBoolDType ) -> _LILArray [np .bool_ ]: ...
1419
+
1420
+ #
1391
1421
@overload # sparray, format: <default>, dtype: int-like
1392
1422
def hstack (blocks : Seq [_CanStackAs [np .int_ , _T ]], format : None = None , * , dtype : onp .AnyIntDType ) -> _T : ...
1423
+ @overload # sparray, format: "bsr", dtype: int-like
1424
+ def hstack (blocks : Seq [_SpArray ], format : _FmtBSR , dtype : onp .AnyIntDType ) -> _BSRArray [np .int_ ]: ...
1425
+ @overload # sparray, format: "coo", dtype: int-like
1426
+ def hstack (blocks : Seq [_SpArray ], format : _FmtCOO , dtype : onp .AnyIntDType ) -> _COOArray2D [np .int_ ]: ...
1427
+ @overload # sparray, format: "csc", dtype: int-like
1428
+ def hstack (blocks : Seq [_SpArray ], format : _FmtCSC , dtype : onp .AnyIntDType ) -> _CSCArray [np .int_ ]: ...
1429
+ @overload # sparray, format: "csr", dtype: int-like
1430
+ def hstack (blocks : Seq [_SpArray ], format : _FmtCSR , dtype : onp .AnyIntDType ) -> _CSRArray2D [np .int_ ]: ...
1431
+ @overload # sparray, format: "dia", dtype: int-like
1432
+ def hstack (blocks : Seq [_SpArray ], format : _FmtDIA , dtype : onp .AnyIntDType ) -> _DIAArray [np .int_ ]: ...
1433
+ @overload # sparray, format: "dok", dtype: int-like
1434
+ def hstack (blocks : Seq [_SpArray ], format : _FmtDOK , dtype : onp .AnyIntDType ) -> _DOKArray2D [np .int_ ]: ...
1435
+ @overload # sparray, format: "lil", dtype: int-like
1436
+ def hstack (blocks : Seq [_SpArray ], format : _FmtLIL , dtype : onp .AnyIntDType ) -> _LILArray [np .int_ ]: ...
1437
+
1438
+ #
1393
1439
@overload # sparray, format: <default>, dtype: float64-like
1394
1440
def hstack (blocks : Seq [_CanStackAs [np .float64 , _T ]], format : None = None , * , dtype : onp .AnyFloat64DType ) -> _T : ...
1441
+ @overload # sparray, format: "bsr", dtype: float64-like
1442
+ def hstack (blocks : Seq [_SpArray ], format : _FmtBSR , dtype : onp .AnyFloat64DType ) -> _BSRArray [np .float64 ]: ...
1443
+ @overload # sparray, format: "coo", dtype: float64-like
1444
+ def hstack (blocks : Seq [_SpArray ], format : _FmtCOO , dtype : onp .AnyFloat64DType ) -> _COOArray2D [np .float64 ]: ...
1445
+ @overload # sparray, format: "csc", dtype: float64-like
1446
+ def hstack (blocks : Seq [_SpArray ], format : _FmtCSC , dtype : onp .AnyFloat64DType ) -> _CSCArray [np .float64 ]: ...
1447
+ @overload # sparray, format: "csr", dtype: float64-like
1448
+ def hstack (blocks : Seq [_SpArray ], format : _FmtCSR , dtype : onp .AnyFloat64DType ) -> _CSRArray2D [np .float64 ]: ...
1449
+ @overload # sparray, format: "dia", dtype: float64-like
1450
+ def hstack (blocks : Seq [_SpArray ], format : _FmtDIA , dtype : onp .AnyFloat64DType ) -> _DIAArray [np .float64 ]: ...
1451
+ @overload # sparray, format: "dok", dtype: float64-like
1452
+ def hstack (blocks : Seq [_SpArray ], format : _FmtDOK , dtype : onp .AnyFloat64DType ) -> _DOKArray2D [np .float64 ]: ...
1453
+ @overload # sparray, format: "lil", dtype: float64-like
1454
+ def hstack (blocks : Seq [_SpArray ], format : _FmtLIL , dtype : onp .AnyFloat64DType ) -> _LILArray [np .float64 ]: ...
1455
+
1456
+ #
1395
1457
@overload # sparray, format: <default>, dtype: complex128-like
1396
1458
def hstack (blocks : Seq [_CanStackAs [np .complex128 , _T ]], format : None = None , * , dtype : onp .AnyComplex128DType ) -> _T : ...
1459
+ @overload # sparray, format: "bsr", dtype: complex128-like
1460
+ def hstack (blocks : Seq [_SpArray ], format : _FmtBSR , dtype : onp .AnyComplex128DType ) -> _BSRArray [np .complex128 ]: ...
1461
+ @overload # sparray, format: "coo", dtype: complex128-like
1462
+ def hstack (blocks : Seq [_SpArray ], format : _FmtCOO , dtype : onp .AnyComplex128DType ) -> _COOArray2D [np .complex128 ]: ...
1463
+ @overload # sparray, format: "csc", dtype: complex128-like
1464
+ def hstack (blocks : Seq [_SpArray ], format : _FmtCSC , dtype : onp .AnyComplex128DType ) -> _CSCArray [np .complex128 ]: ...
1465
+ @overload # sparray, format: "csr", dtype: complex128-like
1466
+ def hstack (blocks : Seq [_SpArray ], format : _FmtCSR , dtype : onp .AnyComplex128DType ) -> _CSRArray2D [np .complex128 ]: ...
1467
+ @overload # sparray, format: "dia", dtype: complex128-like
1468
+ def hstack (blocks : Seq [_SpArray ], format : _FmtDIA , dtype : onp .AnyComplex128DType ) -> _DIAArray [np .complex128 ]: ...
1469
+ @overload # sparray, format: "dok", dtype: complex128-like
1470
+ def hstack (blocks : Seq [_SpArray ], format : _FmtDOK , dtype : onp .AnyComplex128DType ) -> _DOKArray2D [np .complex128 ]: ...
1471
+ @overload # sparray, format: "lil", dtype: complex128-like
1472
+ def hstack (blocks : Seq [_SpArray ], format : _FmtLIL , dtype : onp .AnyComplex128DType ) -> _LILArray [np .complex128 ]: ...
1473
+
1474
+ #
1475
+ @overload # sparray, format: <default>, dtype: <known>
1476
+ def hstack (blocks : Seq [_CanStackAs [_SCT0 , _T ]], format : None = None , * , dtype : onp .ToDType [_SCT0 ]) -> _T : ...
1477
+ @overload # sparray, format: "bsr", dtype: <known>
1478
+ def hstack (blocks : Seq [_SpArray ], format : _FmtBSR , dtype : onp .ToDType [_SCT0 ]) -> _BSRArray [_SCT0 ]: ...
1479
+ @overload # sparray, format: "coo", dtype: <known>
1480
+ def hstack (blocks : Seq [_SpArray ], format : _FmtCOO , dtype : onp .ToDType [_SCT0 ]) -> _COOArray2D [_SCT0 ]: ...
1481
+ @overload # sparray, format: "csc", dtype: <known>
1482
+ def hstack (blocks : Seq [_SpArray ], format : _FmtCSC , dtype : onp .ToDType [_SCT0 ]) -> _CSCArray [_SCT0 ]: ...
1483
+ @overload # sparray, format: "csr", dtype: <known>
1484
+ def hstack (blocks : Seq [_SpArray ], format : _FmtCSR , dtype : onp .ToDType [_SCT0 ]) -> _CSRArray2D [_SCT0 ]: ...
1485
+ @overload # sparray, format: "dia", dtype: <known>
1486
+ def hstack (blocks : Seq [_SpArray ], format : _FmtDIA , dtype : onp .ToDType [_SCT0 ]) -> _DIAArray [_SCT0 ]: ...
1487
+ @overload # sparray, format: "dok", dtype: <known>
1488
+ def hstack (blocks : Seq [_SpArray ], format : _FmtDOK , dtype : onp .ToDType [_SCT0 ]) -> _DOKArray2D [_SCT0 ]: ...
1489
+ @overload # sparray, format: "lil", dtype: <known>
1490
+ def hstack (blocks : Seq [_SpArray ], format : _FmtLIL , dtype : onp .ToDType [_SCT0 ]) -> _LILArray [_SCT0 ]: ...
1491
+
1492
+ #
1397
1493
@overload # sparray, format: <default>, dtype: <unknown>
1398
1494
def hstack (blocks : Seq [_CanStackAs [Any , _T ]], format : None = None , * , dtype : npt .DTypeLike ) -> _T : ...
1399
- @overload # TODO(jorenham): Support for `format=...`
1495
+ @overload # sparray, format: "bsr", dtype: <unknown>
1496
+ def hstack (blocks : Seq [_SpArray ], format : _FmtBSR , dtype : npt .DTypeLike ) -> _BSRArray : ...
1497
+ @overload # sparray, format: "coo", dtype: <unknown>
1498
+ def hstack (blocks : Seq [_SpArray ], format : _FmtCOO , dtype : npt .DTypeLike ) -> _COOArray2D : ...
1499
+ @overload # sparray, format: "csc", dtype: <unknown>
1500
+ def hstack (blocks : Seq [_SpArray ], format : _FmtCSC , dtype : npt .DTypeLike ) -> _CSCArray : ...
1501
+ @overload # sparray, format: "csr", dtype: <unknown>
1502
+ def hstack (blocks : Seq [_SpArray ], format : _FmtCSR , dtype : npt .DTypeLike ) -> _CSRArray2D : ...
1503
+ @overload # sparray, format: "dia", dtype: <unknown>
1504
+ def hstack (blocks : Seq [_SpArray ], format : _FmtDIA , dtype : npt .DTypeLike ) -> _DIAArray : ...
1505
+ @overload # sparray, format: "dok", dtype: <unknown>
1506
+ def hstack (blocks : Seq [_SpArray ], format : _FmtDOK , dtype : npt .DTypeLike ) -> _DOKArray2D : ...
1507
+ @overload # sparray, format: "lil", dtype: <unknown>
1508
+ def hstack (blocks : Seq [_SpArray ], format : _FmtLIL , dtype : npt .DTypeLike ) -> _LILArray : ...
1509
+
1510
+ #
1511
+ @overload
1400
1512
def hstack (blocks : Seq [_spbase ], format : _Format , dtype : npt .DTypeLike | None = None ) -> Incomplete : ...
1401
1513
1402
1514
###
1403
- # NOTE: keep in sync with `vstack `
1515
+ # NOTE: keep in sync with `hstack `
1404
1516
@overload # sparray, format: <default>, dtype: <default>
1405
1517
def vstack (blocks : Seq [_CanStack [_T ]], format : None = None , dtype : None = None ) -> _T : ...
1406
- @overload # sparray, format: <default>, dtype: <known>
1407
- def vstack (blocks : Seq [_CanStackAs [_SCT0 , _T ]], format : None = None , * , dtype : onp .ToDType [_SCT0 ]) -> _T : ...
1518
+ @overload # sparray, format: "bsr", dtype: <default>
1519
+ def vstack (blocks : Seq [_SpArray [_SCT0 ]], format : _FmtBSR , dtype : None = None ) -> _BSRArray [_SCT0 ]: ...
1520
+ @overload # sparray, format: "coo", dtype: <default>
1521
+ def vstack (blocks : Seq [_SpArray [_SCT0 ]], format : _FmtCOO , dtype : None = None ) -> _COOArray2D [_SCT0 ]: ...
1522
+ @overload # sparray, format: "csc", dtype: <default>
1523
+ def vstack (blocks : Seq [_SpArray [_SCT0 ]], format : _FmtCSC , dtype : None = None ) -> _CSCArray [_SCT0 ]: ...
1524
+ @overload # sparray, format: "csr", dtype: <default>
1525
+ def vstack (blocks : Seq [_SpArray [_SCT0 ]], format : _FmtCSR , dtype : None = None ) -> _CSRArray2D [_SCT0 ]: ...
1526
+ @overload # sparray, format: "dia", dtype: <default>
1527
+ def vstack (blocks : Seq [_SpArray [_SCT0 ]], format : _FmtDIA , dtype : None = None ) -> _DIAArray [_SCT0 ]: ...
1528
+ @overload # sparray, format: "dok", dtype: <default>
1529
+ def vstack (blocks : Seq [_SpArray [_SCT0 ]], format : _FmtDOK , dtype : None = None ) -> _DOKArray2D [_SCT0 ]: ...
1530
+ @overload # sparray, format: "lil", dtype: <default>
1531
+ def vstack (blocks : Seq [_SpArray [_SCT0 ]], format : _FmtLIL , dtype : None = None ) -> _LILArray [_SCT0 ]: ...
1532
+
1533
+ #
1408
1534
@overload # sparray, format: <default>, dtype: bool-like
1409
1535
def vstack (blocks : Seq [_CanStackAs [np .bool_ , _T ]], format : None = None , * , dtype : onp .AnyBoolDType ) -> _T : ...
1536
+ @overload # sparray, format: "bsr", dtype: bool-like
1537
+ def vstack (blocks : Seq [_SpArray ], format : _FmtBSR , dtype : onp .AnyBoolDType ) -> _BSRArray [np .bool_ ]: ...
1538
+ @overload # sparray, format: "coo", dtype: bool-like
1539
+ def vstack (blocks : Seq [_SpArray ], format : _FmtCOO , dtype : onp .AnyBoolDType ) -> _COOArray2D [np .bool_ ]: ...
1540
+ @overload # sparray, format: "csc", dtype: bool-like
1541
+ def vstack (blocks : Seq [_SpArray ], format : _FmtCSC , dtype : onp .AnyBoolDType ) -> _CSCArray [np .bool_ ]: ...
1542
+ @overload # sparray, format: "csr", dtype: bool-like
1543
+ def vstack (blocks : Seq [_SpArray ], format : _FmtCSR , dtype : onp .AnyBoolDType ) -> _CSRArray2D [np .bool_ ]: ...
1544
+ @overload # sparray, format: "dia", dtype: bool-like
1545
+ def vstack (blocks : Seq [_SpArray ], format : _FmtDIA , dtype : onp .AnyBoolDType ) -> _DIAArray [np .bool_ ]: ...
1546
+ @overload # sparray, format: "dok", dtype: bool-like
1547
+ def vstack (blocks : Seq [_SpArray ], format : _FmtDOK , dtype : onp .AnyBoolDType ) -> _DOKArray2D [np .bool_ ]: ...
1548
+ @overload # sparray, format: "lil", dtype: bool-like
1549
+ def vstack (blocks : Seq [_SpArray ], format : _FmtLIL , dtype : onp .AnyBoolDType ) -> _LILArray [np .bool_ ]: ...
1550
+
1551
+ #
1410
1552
@overload # sparray, format: <default>, dtype: int-like
1411
1553
def vstack (blocks : Seq [_CanStackAs [np .int_ , _T ]], format : None = None , * , dtype : onp .AnyIntDType ) -> _T : ...
1554
+ @overload # sparray, format: "bsr", dtype: int-like
1555
+ def vstack (blocks : Seq [_SpArray ], format : _FmtBSR , dtype : onp .AnyIntDType ) -> _BSRArray [np .int_ ]: ...
1556
+ @overload # sparray, format: "coo", dtype: int-like
1557
+ def vstack (blocks : Seq [_SpArray ], format : _FmtCOO , dtype : onp .AnyIntDType ) -> _COOArray2D [np .int_ ]: ...
1558
+ @overload # sparray, format: "csc", dtype: int-like
1559
+ def vstack (blocks : Seq [_SpArray ], format : _FmtCSC , dtype : onp .AnyIntDType ) -> _CSCArray [np .int_ ]: ...
1560
+ @overload # sparray, format: "csr", dtype: int-like
1561
+ def vstack (blocks : Seq [_SpArray ], format : _FmtCSR , dtype : onp .AnyIntDType ) -> _CSRArray2D [np .int_ ]: ...
1562
+ @overload # sparray, format: "dia", dtype: int-like
1563
+ def vstack (blocks : Seq [_SpArray ], format : _FmtDIA , dtype : onp .AnyIntDType ) -> _DIAArray [np .int_ ]: ...
1564
+ @overload # sparray, format: "dok", dtype: int-like
1565
+ def vstack (blocks : Seq [_SpArray ], format : _FmtDOK , dtype : onp .AnyIntDType ) -> _DOKArray2D [np .int_ ]: ...
1566
+ @overload # sparray, format: "lil", dtype: int-like
1567
+ def vstack (blocks : Seq [_SpArray ], format : _FmtLIL , dtype : onp .AnyIntDType ) -> _LILArray [np .int_ ]: ...
1568
+
1569
+ #
1412
1570
@overload # sparray, format: <default>, dtype: float64-like
1413
1571
def vstack (blocks : Seq [_CanStackAs [np .float64 , _T ]], format : None = None , * , dtype : onp .AnyFloat64DType ) -> _T : ...
1572
+ @overload # sparray, format: "bsr", dtype: float64-like
1573
+ def vstack (blocks : Seq [_SpArray ], format : _FmtBSR , dtype : onp .AnyFloat64DType ) -> _BSRArray [np .float64 ]: ...
1574
+ @overload # sparray, format: "coo", dtype: float64-like
1575
+ def vstack (blocks : Seq [_SpArray ], format : _FmtCOO , dtype : onp .AnyFloat64DType ) -> _COOArray2D [np .float64 ]: ...
1576
+ @overload # sparray, format: "csc", dtype: float64-like
1577
+ def vstack (blocks : Seq [_SpArray ], format : _FmtCSC , dtype : onp .AnyFloat64DType ) -> _CSCArray [np .float64 ]: ...
1578
+ @overload # sparray, format: "csr", dtype: float64-like
1579
+ def vstack (blocks : Seq [_SpArray ], format : _FmtCSR , dtype : onp .AnyFloat64DType ) -> _CSRArray2D [np .float64 ]: ...
1580
+ @overload # sparray, format: "dia", dtype: float64-like
1581
+ def vstack (blocks : Seq [_SpArray ], format : _FmtDIA , dtype : onp .AnyFloat64DType ) -> _DIAArray [np .float64 ]: ...
1582
+ @overload # sparray, format: "dok", dtype: float64-like
1583
+ def vstack (blocks : Seq [_SpArray ], format : _FmtDOK , dtype : onp .AnyFloat64DType ) -> _DOKArray2D [np .float64 ]: ...
1584
+ @overload # sparray, format: "lil", dtype: float64-like
1585
+ def vstack (blocks : Seq [_SpArray ], format : _FmtLIL , dtype : onp .AnyFloat64DType ) -> _LILArray [np .float64 ]: ...
1586
+
1587
+ #
1414
1588
@overload # sparray, format: <default>, dtype: complex128-like
1415
1589
def vstack (blocks : Seq [_CanStackAs [np .complex128 , _T ]], format : None = None , * , dtype : onp .AnyComplex128DType ) -> _T : ...
1590
+ @overload # sparray, format: "bsr", dtype: complex128-like
1591
+ def vstack (blocks : Seq [_SpArray ], format : _FmtBSR , dtype : onp .AnyComplex128DType ) -> _BSRArray [np .complex128 ]: ...
1592
+ @overload # sparray, format: "coo", dtype: complex128-like
1593
+ def vstack (blocks : Seq [_SpArray ], format : _FmtCOO , dtype : onp .AnyComplex128DType ) -> _COOArray2D [np .complex128 ]: ...
1594
+ @overload # sparray, format: "csc", dtype: complex128-like
1595
+ def vstack (blocks : Seq [_SpArray ], format : _FmtCSC , dtype : onp .AnyComplex128DType ) -> _CSCArray [np .complex128 ]: ...
1596
+ @overload # sparray, format: "csr", dtype: complex128-like
1597
+ def vstack (blocks : Seq [_SpArray ], format : _FmtCSR , dtype : onp .AnyComplex128DType ) -> _CSRArray2D [np .complex128 ]: ...
1598
+ @overload # sparray, format: "dia", dtype: complex128-like
1599
+ def vstack (blocks : Seq [_SpArray ], format : _FmtDIA , dtype : onp .AnyComplex128DType ) -> _DIAArray [np .complex128 ]: ...
1600
+ @overload # sparray, format: "dok", dtype: complex128-like
1601
+ def vstack (blocks : Seq [_SpArray ], format : _FmtDOK , dtype : onp .AnyComplex128DType ) -> _DOKArray2D [np .complex128 ]: ...
1602
+ @overload # sparray, format: "lil", dtype: complex128-like
1603
+ def vstack (blocks : Seq [_SpArray ], format : _FmtLIL , dtype : onp .AnyComplex128DType ) -> _LILArray [np .complex128 ]: ...
1604
+
1605
+ #
1606
+ @overload # sparray, format: <default>, dtype: <known>
1607
+ def vstack (blocks : Seq [_CanStackAs [_SCT0 , _T ]], format : None = None , * , dtype : onp .ToDType [_SCT0 ]) -> _T : ...
1608
+ @overload # sparray, format: "bsr", dtype: <known>
1609
+ def vstack (blocks : Seq [_SpArray ], format : _FmtBSR , dtype : onp .ToDType [_SCT0 ]) -> _BSRArray [_SCT0 ]: ...
1610
+ @overload # sparray, format: "coo", dtype: <known>
1611
+ def vstack (blocks : Seq [_SpArray ], format : _FmtCOO , dtype : onp .ToDType [_SCT0 ]) -> _COOArray2D [_SCT0 ]: ...
1612
+ @overload # sparray, format: "csc", dtype: <known>
1613
+ def vstack (blocks : Seq [_SpArray ], format : _FmtCSC , dtype : onp .ToDType [_SCT0 ]) -> _CSCArray [_SCT0 ]: ...
1614
+ @overload # sparray, format: "csr", dtype: <known>
1615
+ def vstack (blocks : Seq [_SpArray ], format : _FmtCSR , dtype : onp .ToDType [_SCT0 ]) -> _CSRArray2D [_SCT0 ]: ...
1616
+ @overload # sparray, format: "dia", dtype: <known>
1617
+ def vstack (blocks : Seq [_SpArray ], format : _FmtDIA , dtype : onp .ToDType [_SCT0 ]) -> _DIAArray [_SCT0 ]: ...
1618
+ @overload # sparray, format: "dok", dtype: <known>
1619
+ def vstack (blocks : Seq [_SpArray ], format : _FmtDOK , dtype : onp .ToDType [_SCT0 ]) -> _DOKArray2D [_SCT0 ]: ...
1620
+ @overload # sparray, format: "lil", dtype: <known>
1621
+ def vstack (blocks : Seq [_SpArray ], format : _FmtLIL , dtype : onp .ToDType [_SCT0 ]) -> _LILArray [_SCT0 ]: ...
1622
+
1623
+ #
1416
1624
@overload # sparray, format: <default>, dtype: <unknown>
1417
1625
def vstack (blocks : Seq [_CanStackAs [Any , _T ]], format : None = None , * , dtype : npt .DTypeLike ) -> _T : ...
1418
- @overload # TODO(jorenham): Support for `format=...`
1626
+ @overload # sparray, format: "bsr", dtype: <unknown>
1627
+ def vstack (blocks : Seq [_SpArray ], format : _FmtBSR , dtype : npt .DTypeLike ) -> _BSRArray : ...
1628
+ @overload # sparray, format: "coo", dtype: <unknown>
1629
+ def vstack (blocks : Seq [_SpArray ], format : _FmtCOO , dtype : npt .DTypeLike ) -> _COOArray2D : ...
1630
+ @overload # sparray, format: "csc", dtype: <unknown>
1631
+ def vstack (blocks : Seq [_SpArray ], format : _FmtCSC , dtype : npt .DTypeLike ) -> _CSCArray : ...
1632
+ @overload # sparray, format: "csr", dtype: <unknown>
1633
+ def vstack (blocks : Seq [_SpArray ], format : _FmtCSR , dtype : npt .DTypeLike ) -> _CSRArray2D : ...
1634
+ @overload # sparray, format: "dia", dtype: <unknown>
1635
+ def vstack (blocks : Seq [_SpArray ], format : _FmtDIA , dtype : npt .DTypeLike ) -> _DIAArray : ...
1636
+ @overload # sparray, format: "dok", dtype: <unknown>
1637
+ def vstack (blocks : Seq [_SpArray ], format : _FmtDOK , dtype : npt .DTypeLike ) -> _DOKArray2D : ...
1638
+ @overload # sparray, format: "lil", dtype: <unknown>
1639
+ def vstack (blocks : Seq [_SpArray ], format : _FmtLIL , dtype : npt .DTypeLike ) -> _LILArray : ...
1640
+
1641
+ #
1642
+ @overload
1419
1643
def vstack (blocks : Seq [_spbase ], format : _Format , dtype : npt .DTypeLike | None = None ) -> Incomplete : ...
1420
1644
1421
1645
###
0 commit comments