From 409a75c96461e47d971fdcc8db88084f1f5d3bb7 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 16 Nov 2014 21:44:46 +0000 Subject: [PATCH] fixed 2 small flaws in geom_fromAng, corrected stringID and stringName in all remaining files in 'pre' --- processing/pre/OIMang_hex2cub.py | 4 ++-- processing/pre/abq_addUserOutput.py | 2 +- processing/pre/geom_fromAng.py | 9 +++++---- processing/pre/geom_fromVPSC.py | 4 ++-- processing/pre/geom_fromVoronoiTessellation.py | 4 ++-- processing/pre/geom_grainGrowth.py | 4 ++-- processing/pre/geom_toTable.py | 2 +- processing/pre/geom_translate.py | 4 ++-- processing/pre/geom_unpack.py | 4 ++-- processing/pre/geom_vicinityOffset.py | 4 ++-- processing/pre/gmsh_identifySurfaces.py | 4 ++-- processing/pre/marc_addUserOutput.py | 4 ++-- processing/pre/mentat_pbcOnBoxMesh.py | 4 ++-- processing/pre/patchFromReconstructedBoundaries.py | 4 ++-- processing/pre/seeds_fromGeom.py | 4 ++-- 15 files changed, 31 insertions(+), 30 deletions(-) diff --git a/processing/pre/OIMang_hex2cub.py b/processing/pre/OIMang_hex2cub.py index ff1d05c51..b7943bd4d 100755 --- a/processing/pre/OIMang_hex2cub.py +++ b/processing/pre/OIMang_hex2cub.py @@ -4,8 +4,8 @@ import string,os,sys from optparse import OptionParser, Option -scriptID = '$Id$' -scriptName = scriptID.split()[1] +scriptID = string.replace('$Id$','\n','\\n') +scriptName = scriptID.split()[1][:-3] #------------------------------------------------------------------------------------------------- class extendableOption(Option): diff --git a/processing/pre/abq_addUserOutput.py b/processing/pre/abq_addUserOutput.py index 4bb32b40a..f1be0070c 100755 --- a/processing/pre/abq_addUserOutput.py +++ b/processing/pre/abq_addUserOutput.py @@ -14,7 +14,7 @@ import sys,os,re,string from optparse import OptionParser import damask -scriptID = '$Id$' +scriptID = string.replace('$Id$','\n','\\n') scriptName = scriptID.split()[1][:-3] # ----------------------------- diff --git a/processing/pre/geom_fromAng.py b/processing/pre/geom_fromAng.py index aee9887e0..f8825b6f6 100755 --- a/processing/pre/geom_fromAng.py +++ b/processing/pre/geom_fromAng.py @@ -6,8 +6,8 @@ import numpy as np from optparse import OptionParser import damask -scriptID = '$Id$' -scriptName = scriptID.split()[1] +scriptID = string.replace('$Id$','\n','\\n') +scriptName = scriptID.split()[1][:-3] #-------------------------------------------------------------------------------------------------- # MAIN @@ -102,7 +102,7 @@ for file in files: phase = np.zeros(info['grid'][0]*info['grid'][1],dtype='i') else: # finished with comments block phase[point] = options.phase[int(float(words[options.column-1]) > options.threshold)] - eulerangles[point,...] = map(math.degrees, words[:3]) + eulerangles[point,...] = map(lambda x: math.degrees(float(x)), words[:3]) point += 1 if info['grid'].prod() != point: @@ -190,5 +190,6 @@ for file in files: #--- output finalization -------------------------------------------------------------------------- if file['name'] != 'STDIN': file['output'].close() + print os.path.splitext(file['name'])[0] os.rename(file['name']+'_tmp', - os.path.splitext(file['name'])[0] + '_material.config' if options.config else '.geom') + os.path.splitext(file['name'])[0] +'%s'%('_material.config' if options.config else '.geom')) diff --git a/processing/pre/geom_fromVPSC.py b/processing/pre/geom_fromVPSC.py index 3b91a458c..ad8bb5628 100755 --- a/processing/pre/geom_fromVPSC.py +++ b/processing/pre/geom_fromVPSC.py @@ -6,8 +6,8 @@ import numpy as np from optparse import OptionParser import damask -scriptID = '$Id$' -scriptName = scriptID.split()[1] +scriptID = string.replace('$Id$','\n','\\n') +scriptName = scriptID.split()[1][:-3] #-------------------------------------------------------------------------------------------------- # MAIN diff --git a/processing/pre/geom_fromVoronoiTessellation.py b/processing/pre/geom_fromVoronoiTessellation.py index f54883d72..289d5df4a 100755 --- a/processing/pre/geom_fromVoronoiTessellation.py +++ b/processing/pre/geom_fromVoronoiTessellation.py @@ -6,8 +6,8 @@ import numpy as np from optparse import OptionParser import damask -scriptID = '$Id$' -scriptName = scriptID.split()[1] +scriptID = string.replace('$Id$','\n','\\n') +scriptName = scriptID.split()[1][:-3] def meshgrid2(*arrs): diff --git a/processing/pre/geom_grainGrowth.py b/processing/pre/geom_grainGrowth.py index c2acc6e17..956aa2d4b 100755 --- a/processing/pre/geom_grainGrowth.py +++ b/processing/pre/geom_grainGrowth.py @@ -8,8 +8,8 @@ from scipy import ndimage from multiprocessing import Pool import damask -scriptID = '$Id$' -scriptName = scriptID.split()[1] +scriptID = string.replace('$Id$','\n','\\n') +scriptName = scriptID.split()[1][:-3] #-------------------------------------------------------------------------------------------------- # MAIN diff --git a/processing/pre/geom_toTable.py b/processing/pre/geom_toTable.py index 69348a4db..da7dfcc2c 100755 --- a/processing/pre/geom_toTable.py +++ b/processing/pre/geom_toTable.py @@ -7,7 +7,7 @@ from optparse import OptionParser, OptionGroup, Option, SUPPRESS_HELP import damask scriptID = string.replace('$Id$','\n','\\n') -scriptName = os.path.splitext(scriptID.split()[1])[0] +scriptName = scriptID.split()[1][:-3] #-------------------------------------------------------------------------------------------------- class extendedOption(Option): diff --git a/processing/pre/geom_translate.py b/processing/pre/geom_translate.py index ce5b238f1..da56f8078 100755 --- a/processing/pre/geom_translate.py +++ b/processing/pre/geom_translate.py @@ -5,8 +5,8 @@ import os,sys,string,re,math,numpy import damask from optparse import OptionParser, OptionGroup, Option, SUPPRESS_HELP -scriptID = '$Id$' -scriptName = scriptID.split()[1] +scriptID = string.replace('$Id$','\n','\\n') +scriptName = scriptID.split()[1][:-3] #-------------------------------------------------------------------------------------------------- class extendedOption(Option): diff --git a/processing/pre/geom_unpack.py b/processing/pre/geom_unpack.py index dc2edafb8..9a1898d52 100755 --- a/processing/pre/geom_unpack.py +++ b/processing/pre/geom_unpack.py @@ -6,8 +6,8 @@ import numpy as np from optparse import OptionParser import damask -scriptID = '$Id$' -scriptName = scriptID.split()[1] +scriptID = string.replace('$Id$','\n','\\n') +scriptName = scriptID.split()[1][:-3] #-------------------------------------------------------------------------------------------------- # MAIN diff --git a/processing/pre/geom_vicinityOffset.py b/processing/pre/geom_vicinityOffset.py index 42d675e7f..2cbd09270 100755 --- a/processing/pre/geom_vicinityOffset.py +++ b/processing/pre/geom_vicinityOffset.py @@ -5,8 +5,8 @@ import os,sys,string,re,math,numpy, damask from scipy import ndimage from optparse import OptionParser, OptionGroup, Option, SUPPRESS_HELP -scriptID = '$Id$' -scriptName = scriptID.split()[1] +scriptID = string.replace('$Id$','\n','\\n') +scriptName = scriptID.split()[1][:-3] #-------------------------------------------------------------------------------------------------- class extendedOption(Option): diff --git a/processing/pre/gmsh_identifySurfaces.py b/processing/pre/gmsh_identifySurfaces.py index 05370c98b..4ffea7cda 100755 --- a/processing/pre/gmsh_identifySurfaces.py +++ b/processing/pre/gmsh_identifySurfaces.py @@ -6,8 +6,8 @@ import damask import re from optparse import OptionParser -scriptID = '$Id$' -scriptName = scriptID.split()[1] +scriptID = string.replace('$Id$','\n','\\n') +scriptName = scriptID.split()[1][:-3] def all_same(items,a): return all(x == a for x in items) diff --git a/processing/pre/marc_addUserOutput.py b/processing/pre/marc_addUserOutput.py index baba9a149..87f91e8fa 100755 --- a/processing/pre/marc_addUserOutput.py +++ b/processing/pre/marc_addUserOutput.py @@ -10,8 +10,8 @@ that are written during the first run of the model. import sys,os,re from optparse import OptionParser -scriptID = '$Id$' -scriptName = scriptID.split()[1] +scriptID = string.replace('$Id$','\n','\\n') +scriptName = scriptID.split()[1][:-3] # ----------------------------- def ParseOutputFormat(filename,what,me): diff --git a/processing/pre/mentat_pbcOnBoxMesh.py b/processing/pre/mentat_pbcOnBoxMesh.py index afb658068..539280ff4 100755 --- a/processing/pre/mentat_pbcOnBoxMesh.py +++ b/processing/pre/mentat_pbcOnBoxMesh.py @@ -4,8 +4,8 @@ import sys,os,pwd,math,re,string,numpy, damask from optparse import OptionParser -scriptID = '$Id$' -scriptName = scriptID.split()[1] +scriptID = string.replace('$Id$','\n','\\n') +scriptName = scriptID.split()[1][:-3] sys.path.append(damask.solver.Marc().libraryPath('../../')) diff --git a/processing/pre/patchFromReconstructedBoundaries.py b/processing/pre/patchFromReconstructedBoundaries.py index 02ab0f96f..f9cc06617 100755 --- a/processing/pre/patchFromReconstructedBoundaries.py +++ b/processing/pre/patchFromReconstructedBoundaries.py @@ -4,8 +4,8 @@ import sys,os,math,re,string, damask from optparse import OptionParser, OptionGroup, Option, SUPPRESS_HELP -scriptID = '$Id$' -scriptName = scriptID.split()[1] +scriptID = string.replace('$Id$','\n','\\n') +scriptName = scriptID.split()[1][:-3] try: # check for Python Image Lib diff --git a/processing/pre/seeds_fromGeom.py b/processing/pre/seeds_fromGeom.py index 7e990be87..3deadf5b4 100755 --- a/processing/pre/seeds_fromGeom.py +++ b/processing/pre/seeds_fromGeom.py @@ -6,8 +6,8 @@ import numpy as np from optparse import OptionParser import damask -scriptID = '$Id$' -scriptName = scriptID.split()[1] +scriptID = string.replace('$Id$','\n','\\n') +scriptName = scriptID.split()[1][:-3] #-------------------------------------------------------------------------------------------------- # MAIN