Helper for converting from any SciPy sparse array or matrix.
(cls, sparr: sp.sparray | sp.spmatrix)
| 126 | |
| 127 | @classmethod |
| 128 | def fromSP(cls, sparr: sp.sparray | sp.spmatrix): |
| 129 | """ |
| 130 | Helper for converting from any SciPy sparse array or matrix. |
| 131 | """ |
| 132 | |
| 133 | tmp = sparr.tocoo() |
| 134 | |
| 135 | return cls(tmp.row, tmp.col, tmp.data, tmp.shape) |
| 136 | |
| 137 | |
| 138 | class Curve(NamedTuple): |
no outgoing calls