Mercurial > repos > greg > icqsol_compose_shapes
changeset 1:e3350521105e draft
Uploaded
author | greg |
---|---|
date | Fri, 04 Dec 2015 09:22:33 -0500 |
parents | 36f5fa5bd6d9 |
children | 111dc6a5577c |
files | icqsol_compose_shapes.py |
diffstat | 1 files changed, 17 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/icqsol_compose_shapes.py Sat Nov 14 14:06:46 2015 -0500 +++ b/icqsol_compose_shapes.py Fri Dec 04 09:22:33 2015 -0500 @@ -7,10 +7,10 @@ # Parse Command Line. parser = argparse.ArgumentParser() -parser.add_argument( '--expression', dest='expression', help='Composition expression' ) -parser.add_argument( '--shape_dataset', dest='shape_datasets', action='append', nargs=4, help='Shape datasets selected from history' ) -parser.add_argument( '--output', dest='output', help='Output dataset' ) -parser.add_argument( '--output_vtk_type', dest='output_vtk_type', help='Output file format and type' ) +parser.add_argument('--expression', dest='expression', help='Composition expression') +parser.add_argument('--shape_dataset', dest='shape_datasets', action='append', nargs=4, help='Shape datasets selected from history') +parser.add_argument('--output', dest='output', help='Output dataset') +parser.add_argument('--output_vtk_type', dest='output_vtk_type', help='Output file format and type') args = parser.parse_args() @@ -19,26 +19,26 @@ shape_mgr = ShapeManager() # Load the shapes. -for ( expression_var, dataset_path, galaxy_ext, vtk_dataset_type ) in args.shape_datasets: +for (expression_var, dataset_path, galaxy_ext, vtk_dataset_type) in args.shape_datasets: # Define the file format and type. - format, file_type = icqsol_utils.get_format_and_type( galaxy_ext ) + format, file_type = icqsol_utils.get_format_and_type(galaxy_ext) if format == 'vtk': - shape_mgr.setReader( file_format=format, vtk_dataset_type=vtk_dataset_type ) + shape_mgr.setReader(file_format=format, vtk_dataset_type=vtk_dataset_type) else: - shape_mgr.setReader( file_format=format ) - icqsol_path = icqsol_utils.get_input_file_path( tmp_dir, dataset_path, format ) - shape_tuple = ( expression_var, shape_mgr.loadAsShape( icqsol_path ) ) - shape_tuples.append( shape_tuple ) + shape_mgr.setReader(file_format=format) + icqsol_path = icqsol_utils.get_input_file_path(tmp_dir, dataset_path, format) + shape_tuple = (expression_var, shape_mgr.loadAsShape(icqsol_path)) + shape_tuples.append(shape_tuple) # Define the output file format and type. -output_format, output_file_type = icqsol_utils.get_format_and_type( args.output_vtk_type ) -tmp_output_path = icqsol_utils.get_temporary_file_path( tmp_dir, output_format ) +output_format, output_file_type = icqsol_utils.get_format_and_type(args.output_vtk_type) +tmp_output_path = icqsol_utils.get_temporary_file_path(tmp_dir, output_format) -shape_mgr.setWriter( file_format=output_format, vtk_dataset_type=icqsol_utils.POLYDATA ) +shape_mgr.setWriter(file_format=output_format, vtk_dataset_type=icqsol_utils.POLYDATA) # Compose the shapes. -composite_shape = shape_mgr.composeShapes( shape_tuples, args.expression ) +composite_shape = shape_mgr.composeShapes(shape_tuples, args.expression) # Save the output. -shape_mgr.saveShape( shape=composite_shape, file_name=tmp_output_path, file_type=output_file_type ) -shutil.move( tmp_output_path, args.output ) +shape_mgr.saveShape(shape=composite_shape, file_name=tmp_output_path, file_type=output_file_type) +shutil.move(tmp_output_path, args.output)