Mercurial > repos > rv43 > tomo
comparison tomo_find_center.py @ 15:1bcca1f2adb4 draft
"planemo upload for repository https://github.com/rolfverberg/galaxytools commit 38c19bf5addbc46f45d598f981bb1a48f7bca691"
| author | rv43 |
|---|---|
| date | Wed, 13 Apr 2022 16:02:44 +0000 |
| parents | 40395e60d2be |
| children | ba5866d0251d |
comparison
equal
deleted
inserted
replaced
| 14:50c8d19d5f89 | 15:1bcca1f2adb4 |
|---|---|
| 2 | 2 |
| 3 import logging | 3 import logging |
| 4 | 4 |
| 5 import sys | 5 import sys |
| 6 import argparse | 6 import argparse |
| 7 import tracemalloc | |
| 7 | 8 |
| 8 from tomo import Tomo | 9 from tomo import Tomo |
| 9 | 10 |
| 10 def __main__(): | 11 def __main__(): |
| 11 | 12 |
| 31 parser.add_argument('--output_config', | 32 parser.add_argument('--output_config', |
| 32 required=True, help='Output config') | 33 required=True, help='Output config') |
| 33 parser.add_argument('-l', '--log', | 34 parser.add_argument('-l', '--log', |
| 34 type=argparse.FileType('w'), default=sys.stdout, help='Log file') | 35 type=argparse.FileType('w'), default=sys.stdout, help='Log file') |
| 35 args = parser.parse_args() | 36 args = parser.parse_args() |
| 37 | |
| 38 # Starting memory monitoring | |
| 39 tracemalloc.start() | |
| 36 | 40 |
| 37 # Set basic log configuration | 41 # Set basic log configuration |
| 38 logging_format = '%(asctime)s : %(levelname)s - %(module)s : %(funcName)s - %(message)s' | 42 logging_format = '%(asctime)s : %(levelname)s - %(module)s : %(funcName)s - %(message)s' |
| 39 log_level = 'INFO' | 43 log_level = 'INFO' |
| 40 level = getattr(logging, log_level.upper(), None) | 44 level = getattr(logging, log_level.upper(), None) |
| 69 galaxy_param = {'row_bounds' : args.row_bounds, 'center_rows' : args.center_rows, | 73 galaxy_param = {'row_bounds' : args.row_bounds, 'center_rows' : args.center_rows, |
| 70 'center_type_selector' : args.center_type_selector, 'set_center' : args.set_center, | 74 'center_type_selector' : args.center_type_selector, 'set_center' : args.set_center, |
| 71 'set_range' : args.set_range, 'set_step' : args.set_step} | 75 'set_range' : args.set_range, 'set_step' : args.set_step} |
| 72 tomo.findCenters(galaxy_param) | 76 tomo.findCenters(galaxy_param) |
| 73 | 77 |
| 78 # Displaying memory usage | |
| 79 logging.info(f'Memory usage: {tracemalloc.get_traced_memory()}') | |
| 80 | |
| 81 # stopping memory monitoring | |
| 82 tracemalloc.stop() | |
| 83 | |
| 74 if __name__ == "__main__": | 84 if __name__ == "__main__": |
| 75 __main__() | 85 __main__() |
| 76 | 86 |
