tFix string split for python3 - sphere - GPU-based 3D discrete element method algorithm with optional fluid coupling
(HTM) git clone git://src.adamsgaard.dk/sphere
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) LICENSE
---
(DIR) commit 55761643753fdef65b497f3b1cfe00b82500a0ca
(DIR) parent 2e8285a631d12ac29262a16a7dd421e88b19160f
(HTM) Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Thu, 15 Aug 2019 16:43:08 +0200
Fix string split for python3
Diffstat:
M python/sphere.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
(DIR) diff --git a/python/sphere.py b/python/sphere.py
t@@ -2956,7 +2956,7 @@ class sim:
'''
# Initialize upper wall
- self.nw = numpy.ones(1, dtype=numpy.int32)
+ self.nw = 1
self.wmode = numpy.zeros(1) # fixed BC
self.w_n = numpy.zeros(self.nw*self.nd, dtype=numpy.float64).reshape(\
self.nw,self.nd)
t@@ -4467,12 +4467,12 @@ class sim:
raise Exception("Could not run external 'porosity' program")
# read one line of output at a time
- s2 = output.split('\n')
+ s2 = output.split(b'\n')
depth = []
porosity = []
for row in s2:
if row != '\n' or row != '' or row != ' ': # skip blank lines
- s3 = row.split('\t')
+ s3 = row.split(b'\t')
if s3 != '' and len(s3) == 2: # make sure line has two vals
depth.append(float(s3[0]))
porosity.append(float(s3[1]))