[Snippets/interpolatable] scipy returns numpy arrays; convert them back to list

This commit is contained in:
Cosimo Lupo 2017-01-19 15:39:48 +00:00
parent 179b8b5794
commit 5d6995d317
No known key found for this signature in database
GPG Key ID: B61AAAD0B53A6419

View File

@ -80,9 +80,8 @@ def min_cost_perfect_bipartite_matching(G):
try:
from scipy.optimize import linear_sum_assignment
rows, cols = linear_sum_assignment(G)
# This branch untested
assert rows == list(range(n))
return cols, _matching_cost(G, cols)
assert (rows == list(range(n))).all()
return list(cols), _matching_cost(G, cols)
except ImportError:
pass