simplified if—else with a = b if c else d

This commit is contained in:
Philip Eisenlohr 2015-11-10 01:35:26 +00:00
parent ccf7530121
commit 434bf2413e
1 changed files with 2 additions and 2 deletions

View File

@ -76,8 +76,8 @@ for name in filenames:
microstructure = table.microstructure_read(info['grid']) # read microstructure microstructure = table.microstructure_read(info['grid']) # read microstructure
formatwidth = int(math.floor(math.log10(microstructure.max())+1)) # efficient number printing format formatwidth = int(math.floor(math.log10(microstructure.max())+1)) # efficient number printing format
if options.oneD: table.data = microstructure table.data = microstructure if options.oneD else \
else: table.data = microstructure.reshape((info['grid'][0],info['grid'][1]*info['grid'][2]),order='F').transpose() microstructure.reshape((info['grid'][0],info['grid'][1]*info['grid'][2]),order='F').transpose()
table.data_writeArray('%%%ii'%(formatwidth),delimiter = ' ') table.data_writeArray('%%%ii'%(formatwidth),delimiter = ' ')
#--- output finalization -------------------------------------------------------------------------- #--- output finalization --------------------------------------------------------------------------