From 24d1528e04c77d3a22e50a7a76314978f2f5e3dc Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 20 Jul 2018 03:31:46 +0200 Subject: [PATCH] on the way to full python 3 compatibility --- PRIVATE | 2 +- processing/pre/hybridIA_linODFsampling.py | 2 +- processing/pre/mentat_spectralBox.py | 13 ++++++++++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/PRIVATE b/PRIVATE index 4cbe7024b..12ecac5ad 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit 4cbe7024b4ebd1ef3ee35fbf8b9676f1c377f462 +Subproject commit 12ecac5ad75a160d5ee8e2b18b752fdab11dfa0d diff --git a/processing/pre/hybridIA_linODFsampling.py b/processing/pre/hybridIA_linODFsampling.py index e4735674a..d1b0efd57 100755 --- a/processing/pre/hybridIA_linODFsampling.py +++ b/processing/pre/hybridIA_linODFsampling.py @@ -270,7 +270,7 @@ for name in filenames: ODF['limit'] = np.radians(limits[1,:]) # right hand limits in radians ODF['center'] = 0.0 if all(limits[0,:]<1e-8) else 0.5 # vertex or cell centered - ODF['interval'] = np.array(map(len,[np.unique(table.data[:,i]) for i in range(3)]),'i') # steps are number of distict values + ODF['interval'] = np.array(list(map(len,[np.unique(table.data[:,i]) for i in range(3)])),'i') # steps are number of distict values ODF['nBins'] = ODF['interval'].prod() ODF['delta'] = np.radians(np.array(limits[1,0:3]-limits[0,0:3])/(ODF['interval']-1)) # step size diff --git a/processing/pre/mentat_spectralBox.py b/processing/pre/mentat_spectralBox.py index 16c982f82..0299b35dc 100755 --- a/processing/pre/mentat_spectralBox.py +++ b/processing/pre/mentat_spectralBox.py @@ -77,7 +77,14 @@ def mesh(r,d): "%f %f %f"%(-d[0],d[1],d[2]), "%f %f %f"%(-d[0],d[1],0.0), "*add_elements", - range(1,9), + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", "*sub_divisions", "%i %i %i"%(r[2],r[1],r[0]), "*subdivide_elements", @@ -201,7 +208,7 @@ if options.port: except: parser.error('no valid Mentat release found.') -# --- loop over input files ------------------------------------------------------------------------- +# --- loop over input files ------------------------------------------------------------------------ if filenames == []: filenames = [None] @@ -236,7 +243,7 @@ for name in filenames: # --- read data ------------------------------------------------------------------------------------ - microstructure = table.microstructure_read(info['grid']).reshape(info['grid'].prod(),order='F') # read microstructure + microstructure = table.microstructure_read(info['grid']).reshape(info['grid'].prod(),order='F') # read microstructure cmds = [\ init(),