adjusted to python3
translate is more complicated now: https://stackoverflow.com/questions/41708770
This commit is contained in:
parent
3a22e31f1b
commit
9922f5f646
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2.7
|
#!/usr/bin/env python
|
||||||
# -*- coding: UTF-8 no BOM -*-
|
# -*- coding: UTF-8 no BOM -*-
|
||||||
|
|
||||||
import os,sys,math
|
import os,sys,math
|
||||||
|
@ -82,11 +82,11 @@ for name in filenames:
|
||||||
'microstructures': 0,
|
'microstructures': 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
newInfo['grid'] = np.array([{True:round(o*float(n.translate(None,'xX'))),
|
newInfo['grid'] = np.array([{True: round(o*float(n.lower().replace('x',''))),
|
||||||
False: round(float(n.translate(None,'xX')))}[n[-1].lower() == 'x']
|
False: round(float(n.lower().replace('x','')))}[n[-1].lower() == 'x']
|
||||||
for o,n in zip(info['grid'],options.grid)],'i')
|
for o,n in zip(info['grid'],options.grid)],'i')
|
||||||
newInfo['size'] = np.array([{True: o*float(n.translate(None,'xX')) ,
|
newInfo['size'] = np.array([{True: o*float(n.lower().replace('x','')),
|
||||||
False: float(n.translate(None,'xX')) }[n[-1].lower() == 'x']
|
False: float(n.lower().replace('x',''))}[n[-1].lower() == 'x']
|
||||||
for o,n in zip(info['size'],options.size)],'d')
|
for o,n in zip(info['size'],options.size)],'d')
|
||||||
newInfo['grid'] = np.where(newInfo['grid'] <= 0 , info['grid'],newInfo['grid'])
|
newInfo['grid'] = np.where(newInfo['grid'] <= 0 , info['grid'],newInfo['grid'])
|
||||||
newInfo['size'] = np.where(newInfo['size'] <= 0.0, info['size'],newInfo['size'])
|
newInfo['size'] = np.where(newInfo['size'] <= 0.0, info['size'],newInfo['size'])
|
||||||
|
|
Loading…
Reference in New Issue