diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c73b67d8fe3764af23642d66ce0bcd6680c11ae8..543a0f4e3bcf5b5d009ea66de34472d1f98f9eb4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,6 +22,17 @@ Python 3.5: except: - tags +Python 3.6 Examples: + script: + - py_version=3.6 + - EXTRA_INSTALL="numpy scipy matplotlib" + - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-py-project-and-run-examples.sh + - ". ./build-py-project-and-run-examples.sh" + tags: + - python3.6 + except: + - tags + Python 2.6: script: - py_version=2.6 diff --git a/examples/stability/mr-max-eigvals.py b/examples/stability/mr-max-eigvals.py index f8055e648bb235d3204b061ae627d405bf7a15c5..4beab2cd791720f9648ea11d4d454e6717438048 100644 --- a/examples/stability/mr-max-eigvals.py +++ b/examples/stability/mr-max-eigvals.py @@ -1,4 +1,8 @@ from __future__ import division + +import matplotlib +matplotlib.use("Agg") # noqa + import numpy as np import numpy.linalg as la from leap.multistep.multirate import TwoRateAdamsBashforthMethod @@ -82,7 +86,10 @@ def main(): pt.gca().set_aspect("equal") pt.grid() - pt.show() + outfile = "mr-max-eigvals.pdf" + pt.savefig(outfile) + + print("Output written to %s" % outfile) if __name__ == "__main__": diff --git a/examples/stability/mr-stability-diagram.py b/examples/stability/mr-stability-diagram.py index 2cb1fe9244b5ea4c411c5fa046e6b82861ce8240..90a47c1150e27a6f523a42ad43bd493d61078d69 100644 --- a/examples/stability/mr-stability-diagram.py +++ b/examples/stability/mr-stability-diagram.py @@ -1,4 +1,8 @@ from __future__ import division, print_function + +import matplotlib +matplotlib.use("Agg") # noqa + import numpy as np import numpy.linalg as la from leap.multistep.multirate import TwoRateAdamsBashforthMethod @@ -81,7 +85,10 @@ def main(): pt.legend(loc="best") pt.grid() - pt.show() + + outfile = "mr-stability-diagram.pdf" + pt.savefig(outfile) + print("Output written to %s" % outfile) if __name__ == "__main__": diff --git a/examples/stability/plot-stability-regions.py b/examples/stability/plot-stability-regions.py index d69edc9d698c20fb4e43b6e008c5c49d2ce1a744..754ea1ad4221151928dc9db08e4473c6bb26b7a5 100644 --- a/examples/stability/plot-stability-regions.py +++ b/examples/stability/plot-stability-regions.py @@ -1,6 +1,10 @@ from __future__ import division, print_function +import matplotlib +matplotlib.use("Agg") + + def plot_stability_region(code, parallel=None, scale_factor=None, **kwargs): from leap.stability import find_stability_region points = find_stability_region(code, parallel=parallel, @@ -13,7 +17,7 @@ def plot_stability_region(code, parallel=None, scale_factor=None, **kwargs): fill(points.real, points.imag, **kwargs) -def main(save_pdfs=False): +def main(save_pdfs=True): import matplotlib.pyplot as pt pt.rc("font", size=20) #title("Stability Region") @@ -47,6 +51,7 @@ def main(save_pdfs=False): pt.ylim([-xsize/2*0.75, xsize/2*0.75]) pt.savefig("stab-regions-eq-aspect.pdf") + print("Output written to stab-regions.pdf and stab-regions-eq-aspect.pdf") else: pt.show()