# HG changeset patch # User rv43 # Date 1679420403 0 # Node ID 4f4ee8db5f674b9b18000b212f57a1b31f5839be # Parent adb84c450789f01f2132f29d5b1793371b1fc77b planemo upload for repository https://github.com/rolfverberg/galaxytools commit f8c4bdb31c20c468045ad5e6eb255a293244bc6c-dirty diff -r adb84c450789 -r 4f4ee8db5f67 tomo_reduce.py --- a/tomo_reduce.py Mon Mar 20 17:30:24 2023 +0000 +++ b/tomo_reduce.py Tue Mar 21 17:40:03 2023 +0000 @@ -15,30 +15,30 @@ # Parse command line arguments parser = argparse.ArgumentParser( description='Reduce tomography data') -# parser.add_argument('-i', '--input_file', -# required=True, -# type=pathlib.Path, -# help='''Full or relative path to the input file (in yaml or nxs format).''') -# parser.add_argument('-o', '--output_file', -# required=True, -# type=pathlib.Path, -# help='''Full or relative path to the output file (in Nexus format).''') -# parser.add_argument('--galaxy_flag', -# action='store_true', -# help='''Use this flag to run the scripts as a galaxy tool.''') -# parser.add_argument('--img_x_bounds', -# required=False, -# nargs=2, -# type=int, -# help='Vertical data reduction image range') + parser.add_argument('-i', '--input_file', + required=True, + type=pathlib.Path, + help='''Full or relative path to the input file (in yaml or nxs format).''') + parser.add_argument('-o', '--output_file', + required=True, + type=pathlib.Path, + help='''Full or relative path to the output file (in Nexus format).''') + parser.add_argument('--galaxy_flag', + action='store_true', + help='''Use this flag to run the scripts as a galaxy tool.''') + parser.add_argument('--img_x_bounds', + required=False, + nargs=2, + type=int, + help='Vertical data reduction image range') parser.add_argument('-l', '--log', # type=argparse.FileType('w'), default=sys.stdout, help='Logging stream or filename') -# parser.add_argument('--log_level', -# choices=logging._nameToLevel.keys(), -# default='INFO', -# help='''Specify a preferred logging level.''') + parser.add_argument('--log_level', + choices=logging._nameToLevel.keys(), + default='INFO', + help='''Specify a preferred logging level.''') args = parser.parse_args() # Set log configuration @@ -66,28 +66,25 @@ # tracemalloc.start() # Log command line arguments -# logging.info(f'input_file = {args.input_file}') -# logging.info(f'output_file = {args.output_file}') -# logging.info(f'galaxy_flag = {args.galaxy_flag}') -# logging.info(f'img_x_bounds = {args.img_x_bounds}') -# logging.debug(f'log = {args.log}') -# logging.debug(f'is log stdout? {args.log is sys.stdout}') -# logging.debug(f'log_level = {args.log_level}') - logging.info(f'log = {args.log}') - logging.info(f'is log stdout? {args.log is sys.stdout}') - print('Done') + logging.info(f'input_file = {args.input_file}') + logging.info(f'output_file = {args.output_file}') + logging.info(f'galaxy_flag = {args.galaxy_flag}') + logging.info(f'img_x_bounds = {args.img_x_bounds}') + logging.debug(f'log = {args.log}') + logging.debug(f'is log stdout? {args.log is sys.stdout}') + logging.debug(f'log_level = {args.log_level}') # Instantiate Tomo object -# tomo = Tomo(galaxy_flag=args.galaxy_flag) + tomo = Tomo(galaxy_flag=args.galaxy_flag) # Read input file -# data = tomo.read(args.input_file) + data = tomo.read(args.input_file) # Generate reduced tomography images -# data = tomo.gen_reduced_data(data, img_x_bounds=args.img_x_bounds) + data = tomo.gen_reduced_data(data, img_x_bounds=args.img_x_bounds) # Write output file -# data = tomo.write(data, args.output_file) + data = tomo.write(data, args.output_file) # Displaying memory usage # logging.info(f'Memory usage: {tracemalloc.get_traced_memory()}') diff -r adb84c450789 -r 4f4ee8db5f67 tomo_reduce.xml --- a/tomo_reduce.xml Mon Mar 20 17:30:24 2023 +0000 +++ b/tomo_reduce.xml Tue Mar 21 17:40:03 2023 +0000 @@ -1,24 +1,34 @@ - + Reduce tomography images + + tomo_macros.xml + + + + + - + + + + + - - -@misc{tomo, - author = {Verberg, Rolf}, - year = {2022} -} - + diff -r adb84c450789 -r 4f4ee8db5f67 tomopy_galaxy.yml --- a/tomopy_galaxy.yml Mon Mar 20 17:30:24 2023 +0000 +++ b/tomopy_galaxy.yml Tue Mar 21 17:40:03 2023 +0000 @@ -3,9 +3,9 @@ - conda-forge - defaults dependencies: - - lmfit==1.0.3 - - matplotlib==3.5.2 + - lmfit==1.1.0 + - matplotlib==3.7.1 - nexusformat==1.0.0 - - pip==22.3.1 + - pip==23.0.1 - python==3.9.13 - tomopy==1.12.2