simplified if—else with a = b if c else d
This commit is contained in:
parent
ccf7530121
commit
434bf2413e
|
@ -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 --------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue