From f3c61c4f4344f7971df2b9458156c7291170057f Mon Sep 17 00:00:00 2001
From: "[6~" <inform@tiker.net>
Date: Tue, 12 May 2020 00:57:58 -0500
Subject: [PATCH] Whip examples into shape for automatic testing

---
 examples/multiple-meshes.py                        | 6 +++++-
 {examples => experiments}/refinement-playground.py | 0
 2 files changed, 5 insertions(+), 1 deletion(-)
 rename {examples => experiments}/refinement-playground.py (100%)

diff --git a/examples/multiple-meshes.py b/examples/multiple-meshes.py
index 84918e17..2dab3fab 100644
--- a/examples/multiple-meshes.py
+++ b/examples/multiple-meshes.py
@@ -1,6 +1,7 @@
 from __future__ import division
 
 import numpy as np  # noqa
+import sys
 
 
 order = 4
@@ -20,7 +21,10 @@ def main():
     draw_2d_mesh(mesh, set_bounding_box=True)
 
     import matplotlib.pyplot as pt
-    pt.show()
+    if sys.stdin.isatty():
+        pt.show()
+    else:
+        pt.savefig("plot.pdf")
 
 if __name__ == "__main__":
     main()
diff --git a/examples/refinement-playground.py b/experiments/refinement-playground.py
similarity index 100%
rename from examples/refinement-playground.py
rename to experiments/refinement-playground.py
-- 
GitLab