Skip to content
Snippets Groups Projects
Commit 5e882752 authored by Christoph Groth's avatar Christoph Groth
Browse files

simplify if clause

parent 40b9b37b
Branches
Tags
No related merge requests found
......@@ -84,14 +84,14 @@ class Solver(common.SparseSolver):
self.nrhs = nrhs
if ordering is not None:
if ordering not in list(mumps.orderings.keys()) + ['kwant_decides']:
raise ValueError("Invalid ordering: " + ordering)
if ordering == 'kwant_decides':
# Choose what is considered to be the best ordering.
sorted_orderings = [order
for order in ['metis', 'scotch', 'auto']
if order in mumps.possible_orderings()]
ordering = sorted_orderings[0]
elif ordering not in mumps.orderings:
raise ValueError("Invalid ordering: " + ordering)
self.ordering = ordering
if sparse_rhs is not None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment