[cig-commits] [commit] master: py: Add command-line argument to disable plotting. (63a378a)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Thu Jan 8 21:13:33 PST 2015
Repository : https://github.com/geodynamics/specfem1d
On branch : master
Link : https://github.com/geodynamics/specfem1d/compare/81ba23d88e3baad884dd78c47c7581ffe856f7b2...9969ec4660bfbd56d30e7cea351276fec0318f59
>---------------------------------------------------------------
commit 63a378a0fe16e81bd1edc22321796851d73d7a3e
Author: Elliott Sales de Andrade <esalesde at physics.utoronto.ca>
Date: Thu Jan 8 13:46:48 2015 -0500
py: Add command-line argument to disable plotting.
This overrides the setting in the config file, so that the CI build can
force disable plotting.
>---------------------------------------------------------------
63a378a0fe16e81bd1edc22321796851d73d7a3e
Python_version/config.py | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/Python_version/config.py b/Python_version/config.py
index 17e694d..43789d1 100644
--- a/Python_version/config.py
+++ b/Python_version/config.py
@@ -12,6 +12,7 @@ is implemented.
@author: Alexis Bottero (alexis.bottero at gmail.com)
"""
+import argparse
try:
# Python 3
from configparser import SafeConfigParser
@@ -106,6 +107,13 @@ class Parameter(object):
self.plot = cp.getboolean('global', 'PLOT')
self.dplot = cp.getfloat('global', 'DPLOT')
+ parser = argparse.ArgumentParser(
+ description='Spectral element method in a 1D medium')
+ parser.add_argument('--no-plot', action='store_true',
+ help='Force disable plotting')
+ args = parser.parse_args()
+ self.plot = self.plot and not args.no_plot
+
self.nGLL = self.N + 1 # Number of GLL points per elements
self.nGLJ = self.NGLJ + 1 # Number of GLJ in the first element
self.nGlob = (self.nSpec - 1) * self.N + self.NGLJ + 1 # Number of points in the array
More information about the CIG-COMMITS
mailing list