From 9922f5f646ecb83948b3a769639dd064435e657c Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 16 Nov 2018 12:23:45 +0100 Subject: [PATCH] adjusted to python3 translate is more complicated now: https://stackoverflow.com/questions/41708770 --- processing/pre/geom_rescale.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/processing/pre/geom_rescale.py b/processing/pre/geom_rescale.py index cc904e27b..c0945a63c 100755 --- a/processing/pre/geom_rescale.py +++ b/processing/pre/geom_rescale.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2.7 +#!/usr/bin/env python # -*- coding: UTF-8 no BOM -*- import os,sys,math @@ -82,11 +82,11 @@ for name in filenames: 'microstructures': 0, } - newInfo['grid'] = np.array([{True:round(o*float(n.translate(None,'xX'))), - False: round(float(n.translate(None,'xX')))}[n[-1].lower() == 'x'] + newInfo['grid'] = np.array([{True: round(o*float(n.lower().replace('x',''))), + False: round(float(n.lower().replace('x','')))}[n[-1].lower() == 'x'] for o,n in zip(info['grid'],options.grid)],'i') - newInfo['size'] = np.array([{True: o*float(n.translate(None,'xX')) , - False: float(n.translate(None,'xX')) }[n[-1].lower() == 'x'] + newInfo['size'] = np.array([{True: o*float(n.lower().replace('x','')), + False: float(n.lower().replace('x',''))}[n[-1].lower() == 'x'] for o,n in zip(info['size'],options.size)],'d') newInfo['grid'] = np.where(newInfo['grid'] <= 0 , info['grid'],newInfo['grid']) newInfo['size'] = np.where(newInfo['size'] <= 0.0, info['size'],newInfo['size'])