fixed nasty ABS that caused wrong packing for 1,2,1,1,1,... and the like

This commit is contained in:
Philip Eisenlohr 2016-12-25 12:39:49 -05:00
parent f6513842e0
commit 49eb7aa1be
1 changed files with 7 additions and 7 deletions

View File

@ -36,12 +36,12 @@ for name in filenames:
table.head_read() table.head_read()
info,extra_header = table.head_getGeom() info,extra_header = table.head_getGeom()
damask.util.croak(['grid a b c: %s'%(' x '.join(map(str,info['grid']))), damask.util.croak(['grid a b c: {}'.format(' x '.join(map(str,info['grid']))),
'size x y z: %s'%(' x '.join(map(str,info['size']))), 'size x y z: {}'.format(' x '.join(map(str,info['size']))),
'origin x y z: %s'%(' : '.join(map(str,info['origin']))), 'origin x y z: {}'.format(' : '.join(map(str,info['origin']))),
'homogenization: %i'%info['homogenization'], 'homogenization: {}'.format(info['homogenization']),
'microstructures: %i'%info['microstructures'], 'microstructures: {}'.format(info['microstructures']),
]) ])
errors = [] errors = []
if np.any(info['grid'] < 1): errors.append('invalid grid a b c.') 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) else: items = map(int,items)
for current in 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' compressType = 'to'
reps += 1 reps += 1
elif current == former and start == former: elif current == former and start == former: