Skip to content
Snippets Groups Projects
Commit 2644f876 authored by Anton Akhmerov's avatar Anton Akhmerov Committed by Christoph Groth
Browse files

change assert to raise

parent 55dacf72
Branches
Tags
No related merge requests found
......@@ -50,7 +50,8 @@ def setup_linsys(h_onslice, h_hop, tol=1e6):
# treat this extremely singular case.
# Note: np.any(h_hop) returns (at least from NumPy 1.6.1 - 1.8-devel)
# False if h_hop is purely imaginary
assert np.any(h_hop.real) or np.any(h_hop.imag)
if not (np.any(h_hop.real) or np.any(h_hop.imag)):
raise ValueError("Inter-slice hopping is exactly zero.")
eps = np.finfo(np.common_type(h_onslice, h_hop)).eps
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment