Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 51a4403d authored by hhakim's avatar hhakim
Browse files

Fix minor bugs in pyfaust.demo.quickstart.run().

bug: toarray() was called on ndarray.
parent f0594586
No related branches found
No related tags found
No related merge requests found
......@@ -90,23 +90,23 @@ class quickstart:
for i in range(0,A.get_num_factors()):
#print("Faust size of factor ",i,"=",A.get_factor(i).shape)
# test Faust gets back the same sparse factors given at init
assert((A.get_factor(i).toarray() == list_factor_sparse[i]).all())
assert((A.get_factor(i) == list_factor_sparse[i]).all())
#print(A.get_factor(i))
# test Faust saving
A.save("A.mat")
As = pyfaust.Faust(filepath="A.mat")
assert((A.get_factor(0).toarray() == As.get_factor(0).toarray()).all())
assert((A.get_factor(1).toarray() == As.get_factor(1).toarray()).all())
assert((A.get_factor(0) == As.get_factor(0)).all())
assert((A.get_factor(1) == As.get_factor(1)).all())
# test Faust transpose
#print(A.get_factor(0))
tA = A.transpose()
tf1 = tA.get_factor(1).toarray()
tf1 = tA.get_factor(1)
#print(tf1)
f1 = np.transpose(tf1)
assert(not (tf1 == A.get_factor(0).toarray()).all() or (tf1 == f1).all())
assert((f1 == A.get_factor(0).toarray()).all())
assert(not (tf1 == A.get_factor(0)).all() or (tf1 == f1).all())
assert((f1 == A.get_factor(0)).all())
print("end quickstart.py")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment