From: W. Trevor King Date: Wed, 20 Oct 2010 07:51:29 +0000 (-0400) Subject: Teardown manager after use in velocity_dependant_scan.main(). X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b8da2369fe6823942446a55ecd7b734fd0dc5cfd;p=sawsim.git Teardown manager after use in velocity_dependant_scan.main(). --- diff --git a/pysawsim/velocity_dependant_scan.py b/pysawsim/velocity_dependant_scan.py index caf3d30..bb29272 100644 --- a/pysawsim/velocity_dependant_scan.py +++ b/pysawsim/velocity_dependant_scan.py @@ -276,12 +276,14 @@ def main(): sawsim_histogram.CACHE_DIR = options.cache_dir manager = get_manager(options.manager)() - - hm = HistogramMatcher( - file(velocity_file, 'r'), param_format_string=options.param_format, - N=options.N, manager=manager, residual_type=options.residual, - plot=options.plot_residuals, use_cache=options.use_cache, - clean_cache=options.clean_cache) - #hm.fit(initial_params) - hm.plot(param_ranges, logx=options.logx, logy=options.logy, - contour=options.contour_plot) + try: + hm = HistogramMatcher( + file(velocity_file, 'r'), param_format_string=options.param_format, + N=options.N, manager=manager, residual_type=options.residual, + plot=options.plot_residuals, use_cache=options.use_cache, + clean_cache=options.clean_cache) + #hm.fit(initial_params) + hm.plot(param_ranges, logx=options.logx, logy=options.logy, + contour=options.contour_plot) + finally: + manager.teardown()