From 5a6cd1fc8fa6198ecd867f88b5b4c06b1f606dcf Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Wed, 8 Feb 2012 12:01:38 +0000 Subject: [PATCH] slightly prettified handling of finite difference accuracy requesting --- processing/post/addDivergence.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/processing/post/addDivergence.py b/processing/post/addDivergence.py index 719485b65..2d985a18a 100755 --- a/processing/post/addDivergence.py +++ b/processing/post/addDivergence.py @@ -45,9 +45,10 @@ Deals with both vector- and tensor-valued fields. """ + string.replace('$Id$','\n','\\n') ) +accuracyChoices = ['2','4','6','8'] parser.add_option('--fdm', dest='accuracy', action='extend', type='string', \ - help='degree of central difference accuracy') + help='degree of central difference accuracy (%s)'%(','.join(accuracyChoices))) parser.add_option('--fft', dest='fft', action='store_true', \ help='calculate divergence in Fourier space') parser.add_option('-c','--coordinates', dest='coords', type='string',\ @@ -62,7 +63,6 @@ parser.set_defaults(accuracy = []) parser.set_defaults(fft = False) parser.set_defaults(vector = []) parser.set_defaults(tensor = []) -accuracyChoices = [2,4,6,8] (options,filenames) = parser.parse_args() @@ -70,7 +70,7 @@ if len(options.vector) + len(options.tensor) == 0: parser.error('no data column specified...') for choice in options.accuracy: - if int(choice) not in accuracyChoices: + if choice not in accuracyChoices: parser.error('accuracy must be chosen from %s...'%(', '.join(accuracyChoices))) if options.fft: options.accuracy.append('FFT') if not options.accuracy: