reverted back to hard-to-read but working if else statement

This commit is contained in:
Martin Diehl 2015-05-20 19:40:11 +00:00
parent d99f13a49f
commit 056ba0f2e4
1 changed files with 3 additions and 2 deletions

View File

@ -109,7 +109,7 @@ for file in files:
continue
#--- read data ------------------------------------------------------------------------------------
microstructure = np.zeros(info['grid'].prod(),'i') # initialize as flat array
microstructure = np.zeros(info['grid'].prod(),'i') # initialize as flat array
i = 0
while table.data_read():
items = table.data
@ -124,7 +124,8 @@ for file in files:
i += s
#--- do work ------------------------------------------------------------------------------------
newInfo['grid'] = np.array(int(o*float(n.translate(None,'xX'))) if [n[-1].lower() == 'x' else int(n.translate(None,'xX'))}[n[-1].lower() == 'x'] for o,n in zip(info['grid'],options.grid)],'i')
newInfo['grid'] = np.array([{True: int(o*float(n.translate(None,'xX'))),
False: int(n.translate(None,'xX'))}[n[-1].lower() == 'x'] for o,n in zip(info['grid'],options.grid)],'i')
newInfo['grid'] = np.where(newInfo['grid'] <= 0 , info['grid'],newInfo['grid'])
microstructure = microstructure.reshape(info['grid'],order='F')