From 49eb7aa1be8c779d70437576165dadc19441337a Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Sun, 25 Dec 2016 12:39:49 -0500 Subject: [PATCH] fixed nasty ABS that caused wrong packing for 1,2,1,1,1,... and the like --- processing/pre/geom_pack.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/processing/pre/geom_pack.py b/processing/pre/geom_pack.py index 24636c7d7..4932b8795 100755 --- a/processing/pre/geom_pack.py +++ b/processing/pre/geom_pack.py @@ -36,12 +36,12 @@ for name in filenames: table.head_read() info,extra_header = table.head_getGeom() - damask.util.croak(['grid a b c: %s'%(' x '.join(map(str,info['grid']))), - 'size x y z: %s'%(' x '.join(map(str,info['size']))), - 'origin x y z: %s'%(' : '.join(map(str,info['origin']))), - 'homogenization: %i'%info['homogenization'], - 'microstructures: %i'%info['microstructures'], - ]) + damask.util.croak(['grid a b c: {}'.format(' x '.join(map(str,info['grid']))), + 'size x y z: {}'.format(' x '.join(map(str,info['size']))), + 'origin x y z: {}'.format(' : '.join(map(str,info['origin']))), + 'homogenization: {}'.format(info['homogenization']), + 'microstructures: {}'.format(info['microstructures']), + ]) errors = [] if np.any(info['grid'] < 1): errors.append('invalid grid a b c.') @@ -81,7 +81,7 @@ for name in filenames: else: items = map(int,items) for current in items: - if abs(current - former) == 1 and abs(start-former) == reps - 1: + if abs(current - former) == 1 and (start - current) == reps*(former - current): compressType = 'to' reps += 1 elif current == former and start == former: