Skip to content

Commit 24dadb0

Browse files
committed
changed .A to .toarray for csr_matrices
Signed-off-by: Nick Papior <[email protected]>
1 parent 1a34f22 commit 24dadb0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/sisl/physics/tests/test_physics_sparse.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def run_Pk_hermitian_tests(M):
3131
for k in ([0, 0, 0], [0.1, 0.2, 0.3]):
3232
Mk = M.Pk(k=k, format="array")
3333
assert np.allclose(Mk, Mk.T.conj())
34-
Mk = M.Pk(k=k).A
34+
Mk = M.Pk(k=k).toarray()
3535
assert np.allclose(Mk, Mk.T.conj())
3636

3737

@@ -157,7 +157,7 @@ def test_sparse_orbital_bz_hermitian(sisl_allclose, n0, n1, n2):
157157
allclose = sisl_allclose[dtype]
158158

159159
Pk = s.Pk(k=k, format="csr", dtype=dtype)
160-
assert allclose(Pk.A, Pk.getH().A)
160+
assert allclose(Pk.toarray(), Pk.getH().toarray())
161161

162162
Pk = s.Pk(k=k, format="array", dtype=dtype)
163163
assert allclose(Pk, Pk.T.conj())
@@ -429,7 +429,7 @@ def test_sparse_orbital_spin_make_hermitian(spin, finalize, dtype, sisl_allclose
429429
MH = (M + M.transpose(conjugate=True, spin=True)) / 2
430430
assert allclose((MH - MH.transpose(conjugate=True, spin=True))._csr._D, 0)
431431

432-
for format, proc in (("array", lambda x: x), ("csr", lambda x: x.A)):
432+
for format, proc in (("array", lambda x: x), ("csr", lambda x: x.toarray())):
433433
for k in ([0, 0, 0], [0.1, 0.2, 0.3]):
434434
Mk = proc(MH.Pk(k=k, format=format))
435435
assert allclose(Mk, Mk.T.conj())

0 commit comments

Comments
 (0)