simplified boolean dictionaries to “if else” constructs.
This commit is contained in:
parent
acc2cb656b
commit
df5dd98576
|
@ -631,8 +631,7 @@ def ParsePostfile(p,filename, outputFormat):
|
|||
|
||||
for (name,N) in outputFormat['Crystallite']['outputs']: # add crystallite outputs
|
||||
for i in range(N):
|
||||
label = {False: '%i_%s'%(grain+1, name),
|
||||
True:'%i_%i_%s'%(grain+1,i+1,name)}[N > 1]
|
||||
label = '%i_'%(grain+1) + '%i_'%(i+1) if N>1 else '' + name
|
||||
stat['IndexOfLabel'][label] = startIndex + offset
|
||||
stat['LabelOfElementalScalar'][startIndex + offset] = label
|
||||
offset += 1
|
||||
|
@ -643,8 +642,7 @@ def ParsePostfile(p,filename, outputFormat):
|
|||
|
||||
for (name,N) in outputFormat['Constitutive']['outputs']: # add constitutive outputs
|
||||
for i in range(N):
|
||||
label = {False: '%i_%s'%(grain+1, name),
|
||||
True:'%i_%i_%s'%(grain+1,i+1,name)}[N > 1]
|
||||
label = '%i_'%(grain+1) + ('%i_'%(i+1) if N>1 else '') + name
|
||||
stat['IndexOfLabel'][label] = startIndex + offset
|
||||
try:
|
||||
stat['LabelOfElementalScalar'][startIndex + offset] = label
|
||||
|
|
Loading…
Reference in New Issue