new printing for python3 and corrected help
This commit is contained in:
parent
d1dc976eda
commit
809f03bef5
|
@ -104,7 +104,7 @@ slipSystems = {
|
||||||
# --------------------------------------------------------------------
|
# --------------------------------------------------------------------
|
||||||
|
|
||||||
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """
|
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """
|
||||||
Add RGB color value corresponding to TSL-OIM scheme for inverse pole figures.
|
Add columns listing Schmid factors (and optional trace vector of selected system) for given Euler angles.
|
||||||
|
|
||||||
""", version = scriptID)
|
""", version = scriptID)
|
||||||
|
|
||||||
|
@ -152,7 +152,7 @@ parser.add_option('-q', '--quaternion',
|
||||||
type = 'string', metavar = 'string',
|
type = 'string', metavar = 'string',
|
||||||
help = 'quaternion label')
|
help = 'quaternion label')
|
||||||
|
|
||||||
parser.set_defaults(force = [0.0,0.0,1.0],
|
parser.set_defaults(force = (0.0,0.0,1.0),
|
||||||
normal = None,
|
normal = None,
|
||||||
lattice = latticeChoices[0],
|
lattice = latticeChoices[0],
|
||||||
CoverA = math.sqrt(8./3.),
|
CoverA = math.sqrt(8./3.),
|
||||||
|
|
|
@ -133,10 +133,10 @@ class myThread (threading.Thread):
|
||||||
break
|
break
|
||||||
elif currentError[i] < target[i]['error']: # better fit
|
elif currentError[i] < target[i]['error']: # better fit
|
||||||
bestSeedsUpdate = time.time() # save time of better fit
|
bestSeedsUpdate = time.time() # save time of better fit
|
||||||
damask.util.croak('Thread %i: Better match (%i bins, %6.4f --> %6.4f)'
|
damask.util.croak('Thread {:d}: Better match ({:d} bins, {:6.4f} --> {:6.4f})'\
|
||||||
%(self.threadID,i+1,target[i]['error'],currentError[i]))
|
.format(self.threadID,i+1,target[i]['error'],currentError[i]))
|
||||||
damask.util.croak(' target: %s'%np.array_str(target[i]['histogram']))
|
damask.util.croak(' target: '+np.array_str(target[i]['histogram']))
|
||||||
damask.util.croak(' best: %s'%np.array_str(currentHist[i]))
|
damask.util.croak(' best: '+np.array_str(currentHist[i]))
|
||||||
currentSeedsName = baseFile+'_'+str(bestSeedsUpdate).replace('.','-') # name of new seed file (use time as unique identifier)
|
currentSeedsName = baseFile+'_'+str(bestSeedsUpdate).replace('.','-') # name of new seed file (use time as unique identifier)
|
||||||
perturbedSeedsVFile.reset()
|
perturbedSeedsVFile.reset()
|
||||||
bestSeedsVFile.close()
|
bestSeedsVFile.close()
|
||||||
|
@ -149,7 +149,7 @@ class myThread (threading.Thread):
|
||||||
for j in xrange(nMicrostructures): # save new errors for all bins
|
for j in xrange(nMicrostructures): # save new errors for all bins
|
||||||
target[j]['error'] = currentError[j]
|
target[j]['error'] = currentError[j]
|
||||||
if myMatch > match: # one or more new bins have no deviation
|
if myMatch > match: # one or more new bins have no deviation
|
||||||
damask.util.croak( 'Stage %i cleared'%(myMatch))
|
damask.util.croak( 'Stage {:d} cleared'.format(myMatch))
|
||||||
match=myMatch
|
match=myMatch
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
break
|
break
|
||||||
|
@ -164,8 +164,8 @@ class myThread (threading.Thread):
|
||||||
target[j]['error'] = currentError[j]
|
target[j]['error'] = currentError[j]
|
||||||
randReset = True
|
randReset = True
|
||||||
else: #--- not all grains are tessellated
|
else: #--- not all grains are tessellated
|
||||||
damask.util.croak('Thread %i: Microstructure mismatch (%i microstructures mapped)'
|
damask.util.croak('Thread {:d}: Microstructure mismatch ({:d} microstructures mapped)'\
|
||||||
%(self.threadID,myNmicrostructures))
|
.format(self.threadID,myNmicrostructures))
|
||||||
randReset = True
|
randReset = True
|
||||||
|
|
||||||
|
|
||||||
|
@ -243,7 +243,7 @@ if os.path.isfile(os.path.splitext(options.seedFile)[0]+'.seeds'):
|
||||||
else:
|
else:
|
||||||
bestSeedsVFile.write(damask.util.execute('seeds_fromRandom'+\
|
bestSeedsVFile.write(damask.util.execute('seeds_fromRandom'+\
|
||||||
' -g '+' '.join(map(str, options.grid))+\
|
' -g '+' '.join(map(str, options.grid))+\
|
||||||
' -r %i'%options.randomSeed+\
|
' -r {:d}'.format(options.randomSeed)+\
|
||||||
' -N '+str(nMicrostructures))[0])
|
' -N '+str(nMicrostructures))[0])
|
||||||
bestSeedsUpdate = time.time()
|
bestSeedsUpdate = time.time()
|
||||||
|
|
||||||
|
@ -279,7 +279,7 @@ if options.maxseeds < 1:
|
||||||
else:
|
else:
|
||||||
maxSeeds = options.maxseeds
|
maxSeeds = options.maxseeds
|
||||||
|
|
||||||
if match >0: damask.util.croak('Stage %i cleared'%match)
|
if match >0: damask.util.croak('Stage {:d} cleared'.format(match))
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
initialGeomVFile.close()
|
initialGeomVFile.close()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue