diff --git a/lib/damask/asciitable.py b/lib/damask/asciitable.py index 8921f0ea6..4fe4f9156 100644 --- a/lib/damask/asciitable.py +++ b/lib/damask/asciitable.py @@ -139,10 +139,10 @@ class ASCIItable(): # ------------------------------------------------------------------ def head_read(self): """ - get column labels by either reading - - the first row or, if keyword "head[*]" is present, - the last line of the header + get column labels + + by either reading the first row or, + if keyword "head[*]" is present, the last line of the header """ import re,shlex @@ -275,14 +275,13 @@ class ASCIItable(): # ------------------------------------------------------------------ def labels(self, tags = None, - raw = False, - ): + raw = False): """ - returns abstract labels (e.g. "x" for "1_x","2_x",...) - unless raw output is requested. + tell abstract labels. + + "x" for "1_x","2_x",... unless raw output is requested. operates on object tags or given list. """ - from collections import Iterable if tags is None: tags = self.tags diff --git a/processing/post/addCalculation.py b/processing/post/addCalculation.py index 6152ba948..124949623 100755 --- a/processing/post/addCalculation.py +++ b/processing/post/addCalculation.py @@ -167,8 +167,8 @@ for name in filenames: oldIndices = table.label_indexrange(label) Nold = max(1,len(oldIndices)) # Nold could be zero for new columns Nnew = len(output.label_indexrange(label)) - output.data_append(eval(evaluator[label]) if label in options.labels - and (condition == '' or eval(eval(evaluator_condition))) + output.data_append(eval(evaluator[label]) if label in options.labels and + (condition == '' or eval(eval(evaluator_condition))) else np.tile([table.data[i] for i in oldIndices] if label in tabLabels else np.nan, diff --git a/processing/post/addCompatibilityMismatch.py b/processing/post/addCompatibilityMismatch.py index 182a3df0a..e4fc4a145 100755 --- a/processing/post/addCompatibilityMismatch.py +++ b/processing/post/addCompatibilityMismatch.py @@ -64,10 +64,12 @@ for name in filenames: errors = [] remarks = [] - if table.label_dimension(options.pos) != 3: errors.append('coordinates "{}" are not a vector.'.format(options.pos)) + if table.label_dimension(options.pos) != 3: + errors.append('coordinates "{}" are not a vector.'.format(options.pos)) else: colCoord = table.label_index(options.pos) - if table.label_dimension(options.defgrad) != 9: errors.append('deformation gradient "{}" is not a tensor.'.format(options.defgrad)) + if table.label_dimension(options.defgrad) != 9: + errors.append('deformation gradient "{}" is not a tensor.'.format(options.defgrad)) else: colF = table.label_index(options.defgrad) if remarks != []: damask.util.croak(remarks) @@ -91,7 +93,7 @@ for name in filenames: maxcorner = np.array(map(max,coords)) grid = np.array(map(len,coords),'i') size = grid/np.maximum(np.ones(3,'d'), grid-1.0) * (maxcorner-mincorner) # size from edge to edge = dim * n/(n-1) - size = np.where(grid > 1, size, min(size[grid > 1]/grid[grid > 1])) # spacing for grid==1 set to smallest among other spacings + size = np.where(grid > 1, size, min(size[grid > 1]/grid[grid > 1])) # grid==1 spacing set to smallest among other ones N = grid.prod()