From 17168525b6430fd0c9b3f3cbbc226e70f2d6f75f Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Wed, 29 May 2019 17:43:51 -0600 Subject: [PATCH] use srepr in __repr__ --- python/damask/geom.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/python/damask/geom.py b/python/damask/geom.py index 13ff5232f..8ea31643a 100644 --- a/python/damask/geom.py +++ b/python/damask/geom.py @@ -20,13 +20,14 @@ class Geom(): def __repr__(self): """Basic information on geometry definition""" - return 'grid a b c: {}\n'.format(' x '.join(map(str,self.get_grid ()))) + \ - 'size x y z: {}\n'.format(' x '.join(map(str,self.get_size ()))) + \ - 'origin x y z: {}\n'.format(' x '.join(map(str,self.get_origin()))) + \ - 'homogenization: {}\n'.format(self.get_homogenization()) + \ - '# microstructures: {}\n'.format(len(np.unique(self.microstructure))) + \ - 'max microstructures: {}\n'.format(np.nanmax(self.microstructure)) - + return util.srepr([ + 'grid a b c: {}'.format(' x '.join(map(str,self.get_grid ()))), + 'size x y z: {}'.format(' x '.join(map(str,self.get_size ()))), + 'origin x y z: {}'.format(' x '.join(map(str,self.get_origin()))), + 'homogenization: {}'.format(self.get_homogenization()), + '# microstructures: {}'.format(len(np.unique(self.microstructure))), + 'max microstructure: {}'.format(np.nanmax(self.microstructure)), + ]) def update(self,microstructure=None,size=None,origin=None,rescale=False): """Updates microstructure and size"""