From 0c43a9377a737bed4f7d0aacd17d3fcac9131914 Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Tue, 13 Mar 2018 22:23:25 -0500 Subject: [PATCH 1/6] Make stability examples safe for headless execution --- examples/stability/mr-max-eigvals.py | 9 ++++++++- examples/stability/mr-stability-diagram.py | 9 ++++++++- examples/stability/plot-stability-regions.py | 7 ++++++- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/examples/stability/mr-max-eigvals.py b/examples/stability/mr-max-eigvals.py index f8055e6..4beab2c 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 2cb1fe9..90a47c1 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 d69edc9..754ea1a 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() -- GitLab From f3b552ac3f75b9644275729464c38a751ee22bd2 Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Tue, 13 Mar 2018 22:24:38 -0500 Subject: [PATCH 2/6] Add examples CI job --- .gitlab-ci.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c73b67d..fe50965 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,6 +22,17 @@ Python 3.5: except: - tags +Python 3.5 Examples: + script: + - py_version=3.5 + - export 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.5 + except: + - tags + Python 2.6: script: - py_version=2.6 -- GitLab From 463c8d550c8f2bfdfdbc6e26925c65672b427036 Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Tue, 13 Mar 2018 22:35:21 -0500 Subject: [PATCH 3/6] Cargo culting --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fe50965..2b1eb0c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -25,11 +25,12 @@ Python 3.5: Python 3.5 Examples: script: - py_version=3.5 - - export EXTRA_INSTALL="numpy scipy matplotlib" + - 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.5 + - gfortran except: - tags -- GitLab From 57664355fbfe78d5fdc9a999fbf821ad5a617513 Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Tue, 13 Mar 2018 22:39:48 -0500 Subject: [PATCH 4/6] [ci skip] Revert "Cargo culting" This reverts commit 463c8d550c8f2bfdfdbc6e26925c65672b427036. --- .gitlab-ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2b1eb0c..fe50965 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -25,12 +25,11 @@ Python 3.5: Python 3.5 Examples: script: - py_version=3.5 - - EXTRA_INSTALL="numpy scipy matplotlib" + - export 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.5 - - gfortran except: - tags -- GitLab From 1a41d6854978dded61ca94079d758dcb49ff2d2c Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Tue, 13 Mar 2018 22:43:32 -0500 Subject: [PATCH 5/6] Trigger build --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fe50965..c3d998e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -25,7 +25,7 @@ Python 3.5: Python 3.5 Examples: script: - py_version=3.5 - - export EXTRA_INSTALL="numpy scipy matplotlib" + - 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: -- GitLab From c9dff2abdf6b64ce8d1f8b479de0734065ef36bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Kl=C3=B6ckner?= Date: Wed, 14 Mar 2018 00:49:32 -0400 Subject: [PATCH 6/6] Use Py 3.6 for examples test --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c3d998e..543a0f4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,14 +22,14 @@ Python 3.5: except: - tags -Python 3.5 Examples: +Python 3.6 Examples: script: - - py_version=3.5 + - 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.5 + - python3.6 except: - tags -- GitLab