easier with zip
This commit is contained in:
parent
f733dad8b7
commit
a2b21abcba
|
@ -50,11 +50,9 @@ for name in filenames:
|
|||
if options.rh: v[np.linalg.det(v) < 0.0,:,2] *= -1.0
|
||||
|
||||
for i,o in enumerate(['Min','Mid','Max']):
|
||||
table.add('eigval{}({})'.format(o,tensor),u[:,i],
|
||||
scriptID+' '+' '.join(sys.argv[1:]))
|
||||
table.add('eigval{}({})'.format(o,tensor),u[:,i], scriptID+' '+' '.join(sys.argv[1:]))
|
||||
|
||||
for i,o in enumerate(['Min','Mid','Max']):
|
||||
table.add('eigvec{}({})'.format(o,tensor),v[:,:,i],
|
||||
scriptID+' '+' '.join(sys.argv[1:]))
|
||||
table.add('eigvec{}({})'.format(o,tensor),v[:,:,i],scriptID+' '+' '.join(sys.argv[1:]))
|
||||
|
||||
table.to_ASCII(sys.stdout if name is None else name)
|
||||
|
|
|
@ -43,9 +43,7 @@ for name in filenames:
|
|||
damask.util.report(scriptName,name)
|
||||
|
||||
table = damask.Table.from_ASCII(StringIO(''.join(sys.stdin.read())) if name is None else name)
|
||||
for i,label in enumerate(options.labels):
|
||||
table.set(label,
|
||||
table.get(label)*float(options.factor[i]),
|
||||
scriptID+' '+' '.join(sys.argv[1:]))
|
||||
for label,factor in zip(options.labels,options.factor):
|
||||
table.set(label,table.get(label)*float(factor),scriptID+' '+' '.join(sys.argv[1:]))
|
||||
|
||||
table.to_ASCII(sys.stdout if name is None else name)
|
||||
|
|
|
@ -43,9 +43,7 @@ for name in filenames:
|
|||
damask.util.report(scriptName,name)
|
||||
|
||||
table = damask.Table.from_ASCII(StringIO(''.join(sys.stdin.read())) if name is None else name)
|
||||
for i,label in enumerate(options.labels):
|
||||
table.set(label,
|
||||
table.get(label)+float(options.offset[i]),
|
||||
scriptID+' '+' '.join(sys.argv[1:]))
|
||||
for label,offset in zip(options.labels,options.offset):
|
||||
table.set(label,table.get(label)+float(offset),scriptID+' '+' '.join(sys.argv[1:]))
|
||||
|
||||
table.to_ASCII(sys.stdout if name is None else name)
|
||||
|
|
Loading…
Reference in New Issue