From 9f63d768decc8c1d7f42e6fa2e95e454a812ab8d Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 25 May 2019 13:48:38 +0200 Subject: [PATCH] do not keep whitespaces --- python/damask/geom.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/damask/geom.py b/python/damask/geom.py index ee924f8c0..254d0fb04 100644 --- a/python/damask/geom.py +++ b/python/damask/geom.py @@ -73,7 +73,7 @@ class Geom(): elif line.lower().strip().startswith('homogenization'): homogenization = int(line.split()[1]) else: - comments.append(line[:-1]) + comments.append(line.rstrip().strip()) if isinstance(fname,str): with open(fname) as f: @@ -114,6 +114,7 @@ class Geom(): header.append('grid a {} b {} c {}'.format(*grid)) header.append('size x {} y {} z {}'.format(*self.get_size())) header.append('homogenization {}'.format(self.get_homogenization())) + if self.microstructure.dtype == 'int': format_string='%{}i'.format(int(math.floor(math.log10(self.microstructure.max())+1))) else: