From 5c20609e81a4783ca390964c8f3f56740f42bec3 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 16 Feb 2019 22:20:10 +0100 Subject: [PATCH] more verbose help, drop support for really old vtk --- PRIVATE | 2 +- processing/post/addLinked.py | 2 +- processing/post/addMises.py | 2 +- processing/post/addOrientations.py | 2 +- processing/post/addPole.py | 2 +- processing/post/addSpectralDecomposition.py | 2 +- processing/post/addStrainTensors.py | 2 +- processing/post/averageDown.py | 2 +- processing/post/binXY.py | 2 +- processing/post/blowUp.py | 2 +- processing/post/filterTable.py | 2 +- processing/post/vtk_addGridData.py | 5 ++--- processing/post/vtk_addPointcloudData.py | 8 ++------ processing/post/vtk_pointCloud.py | 5 ++--- processing/post/vtk_rectilinearGrid.py | 3 +-- 15 files changed, 18 insertions(+), 25 deletions(-) diff --git a/PRIVATE b/PRIVATE index a76f03d99..7e51c3e08 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit a76f03d99492ff14b7942124d76952c675aa85c3 +Subproject commit 7e51c3e08655261ec9bd43c6841575e323927de7 diff --git a/processing/post/addLinked.py b/processing/post/addLinked.py index 097f8f2c5..bed3da30a 100755 --- a/processing/post/addLinked.py +++ b/processing/post/addLinked.py @@ -13,7 +13,7 @@ scriptID = ' '.join([scriptName,damask.version]) # MAIN # -------------------------------------------------------------------- -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ +parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """ Add data of selected column(s) from (first) row of linked ASCIItable that shares the linking column value. """, version = scriptID) diff --git a/processing/post/addMises.py b/processing/post/addMises.py index 789540072..35a6922c3 100755 --- a/processing/post/addMises.py +++ b/processing/post/addMises.py @@ -24,7 +24,7 @@ def Mises(what,tensor): # MAIN # -------------------------------------------------------------------- -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ +parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """ Add vonMises equivalent values for symmetric part of requested strains and/or stresses. """, version = scriptID) diff --git a/processing/post/addOrientations.py b/processing/post/addOrientations.py index 41fa7a5df..bcb292ef9 100755 --- a/processing/post/addOrientations.py +++ b/processing/post/addOrientations.py @@ -38,7 +38,7 @@ def check_matrix(M): # MAIN # -------------------------------------------------------------------- -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ +parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """ Add quaternion and/or Bunge Euler angle representation of crystal lattice orientation. Orientation is given by quaternion, Euler angles, rotation matrix, or crystal frame coordinates (i.e. component vectors of rotation matrix). diff --git a/processing/post/addPole.py b/processing/post/addPole.py index 27e44e2a1..628d64d5e 100755 --- a/processing/post/addPole.py +++ b/processing/post/addPole.py @@ -13,7 +13,7 @@ scriptID = ' '.join([scriptName,damask.version]) # MAIN # -------------------------------------------------------------------- -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ +parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """ Add coordinates of stereographic projection of given direction (pole) in crystal frame. """, version = scriptID) diff --git a/processing/post/addSpectralDecomposition.py b/processing/post/addSpectralDecomposition.py index e7d552c70..f3c25b117 100755 --- a/processing/post/addSpectralDecomposition.py +++ b/processing/post/addSpectralDecomposition.py @@ -13,7 +13,7 @@ scriptID = ' '.join([scriptName,damask.version]) # MAIN # -------------------------------------------------------------------- -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ +parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """ Add column(s) containing eigenvalues and eigenvectors of requested symmetric tensor column(s). """, version = scriptID) diff --git a/processing/post/addStrainTensors.py b/processing/post/addStrainTensors.py index 7e16d976c..375b0b5e8 100755 --- a/processing/post/addStrainTensors.py +++ b/processing/post/addStrainTensors.py @@ -25,7 +25,7 @@ def operator(stretch,strain,eigenvalues): # MAIN # -------------------------------------------------------------------- -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ +parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """ Add column(s) containing given strains based on given stretches of requested deformation gradient column(s). """, version = scriptID) diff --git a/processing/post/averageDown.py b/processing/post/averageDown.py index ac7cc00dd..3a70cf314 100755 --- a/processing/post/averageDown.py +++ b/processing/post/averageDown.py @@ -14,7 +14,7 @@ scriptID = ' '.join([scriptName,damask.version]) # MAIN # -------------------------------------------------------------------- -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ +parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """ Average each data block of size 'packing' into single values thus reducing the former grid to grid/packing. """, version = scriptID) diff --git a/processing/post/binXY.py b/processing/post/binXY.py index 2c148e69a..dc286b7ac 100755 --- a/processing/post/binXY.py +++ b/processing/post/binXY.py @@ -13,7 +13,7 @@ scriptID = ' '.join([scriptName,damask.version]) # MAIN # -------------------------------------------------------------------- -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ +parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """ Produces a binned grid of two columns from an ASCIItable, i.e. a two-dimensional probability density map. """, version = scriptID) diff --git a/processing/post/blowUp.py b/processing/post/blowUp.py index e06791afe..d596bb751 100755 --- a/processing/post/blowUp.py +++ b/processing/post/blowUp.py @@ -13,7 +13,7 @@ scriptID = ' '.join([scriptName,damask.version]) # MAIN # -------------------------------------------------------------------- -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ +parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """ Blows up each value to a surrounding data block of size 'packing' thus increasing the former resolution to resolution*packing. diff --git a/processing/post/filterTable.py b/processing/post/filterTable.py index 865df6c03..2703ea274 100755 --- a/processing/post/filterTable.py +++ b/processing/post/filterTable.py @@ -30,7 +30,7 @@ def sortingList(labels,whitelistitems): # MAIN # -------------------------------------------------------------------- -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ +parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """ Filter rows according to condition and columns by either white or black listing. Examples: diff --git a/processing/post/vtk_addGridData.py b/processing/post/vtk_addGridData.py index 315071a4b..a1713afb1 100755 --- a/processing/post/vtk_addGridData.py +++ b/processing/post/vtk_addGridData.py @@ -17,7 +17,7 @@ scriptID = ' '.join([scriptName,damask.version]) msg = "Add scalars, vectors, and/or an RGB tuple from" msg += "an ASCIItable to existing VTK grid (.vtr/.vtk/.vtu)." parser = OptionParser(option_class=damask.extendableOption, - usage='%prog options [file[s]]', + usage='%prog options [ASCIItable(s)]', description = msg, version = scriptID) @@ -172,8 +172,7 @@ for name in filenames: writer.SetDataModeToBinary() writer.SetCompressorTypeToZLib() - if vtk.VTK_MAJOR_VERSION <= 5: writer.SetInput(rGrid) - else: writer.SetInputData(rGrid) + writer.SetInputData(rGrid) writer.Write() # ------------------------------------------ render result --------------------------------------- diff --git a/processing/post/vtk_addPointcloudData.py b/processing/post/vtk_addPointcloudData.py index d75eb97b4..369320d3d 100755 --- a/processing/post/vtk_addPointcloudData.py +++ b/processing/post/vtk_addPointcloudData.py @@ -15,7 +15,7 @@ scriptID = ' '.join([scriptName,damask.version]) # -------------------------------------------------------------------- parser = OptionParser(option_class=damask.extendableOption, - usage='%prog options [file[s]]', + usage='%prog options [ASCIItable(s)]', description = """Add scalar and RGB tuples from ASCIItable to existing VTK point cloud (.vtp).""", version = scriptID) @@ -46,8 +46,6 @@ parser.add_option('-c', '--color', dest='color', action='extend', parser.set_defaults(data = [], tensor = [], color = [], - inplace = False, - render = False, ) (options, filenames) = parser.parse_args() @@ -151,14 +149,12 @@ for name in filenames: # ------------------------------------------ output result --------------------------------------- Polydata.Modified() - if vtk.VTK_MAJOR_VERSION <= 5: Polydata.Update() writer = vtk.vtkXMLPolyDataWriter() writer.SetDataModeToBinary() writer.SetCompressorTypeToZLib() writer.SetFileName(os.path.splitext(options.vtk)[0]+('.vtp' if options.inplace else '_added.vtp')) - if vtk.VTK_MAJOR_VERSION <= 5: writer.SetInput(Polydata) - else: writer.SetInputData(Polydata) + writer.SetInputData(Polydata) writer.Write() # ------------------------------------------ render result --------------------------------------- diff --git a/processing/post/vtk_pointCloud.py b/processing/post/vtk_pointCloud.py index 44168fb60..2aad22479 100755 --- a/processing/post/vtk_pointCloud.py +++ b/processing/post/vtk_pointCloud.py @@ -78,7 +78,6 @@ for name in filenames: Polydata.SetPoints(Points) Polydata.SetVerts(Vertices) Polydata.Modified() - if vtk.VTK_MAJOR_VERSION <= 5: Polydata.Update() # ------------------------------------------ output result --------------------------------------- @@ -94,8 +93,8 @@ for name in filenames: writer.SetHeader('# powered by '+scriptID) writer.WriteToOutputStringOn() - if vtk.VTK_MAJOR_VERSION <= 5: writer.SetInput(Polydata) - else: writer.SetInputData(Polydata) + + writer.SetInputData(Polydata) writer.Write() diff --git a/processing/post/vtk_rectilinearGrid.py b/processing/post/vtk_rectilinearGrid.py index 36218d68d..2e7c66ad5 100755 --- a/processing/post/vtk_rectilinearGrid.py +++ b/processing/post/vtk_rectilinearGrid.py @@ -125,8 +125,7 @@ for name in filenames: writer.SetHeader('# powered by '+scriptID) writer.WriteToOutputStringOn() - if vtk.VTK_MAJOR_VERSION <= 5: writer.SetInput(rGrid) - else: writer.SetInputData(rGrid) + writer.SetInputData(rGrid) writer.Write()