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

catch scipy 0.9 bug in tutorial example

parent fc95c71c
No related branches found
No related tags found
No related merge requests found
......@@ -99,14 +99,22 @@ def main():
# Finalize the system.
sys = sys.finalized()
# We should observe energy levels that flow towards Landau
# level energies with increasing magnetic field
plot_spectrum(sys, [iB * 0.002 for iB in xrange(100)])
# Plot an eigenmode of a circular dot. Here we create a larger system for
# better spatial resolution.
sys = make_system(r=30).finalized()
plot_wave_function(sys)
# The following try-clause can be removed once SciPy 0.9 becomes uncommon.
try:
# We should observe energy levels that flow towards Landau
# level energies with increasing magnetic field.
plot_spectrum(sys, [iB * 0.002 for iB in xrange(100)])
# Plot an eigenmode of a circular dot. Here we create a larger system for
# better spatial resolution.
sys = make_system(r=30).finalized()
plot_wave_function(sys)
except ValueError as e:
if e.message == "Input matrix is not real-valued.":
print "The calculation of eigenvalues failed because of a bug in SciPy 0.9."
print "Please upgrade to a newer version of SciPy."
else:
raise
# Call the main function if the script gets executed (as opposed to imported).
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment