From 0574a93abe1281ea16a26c802c49dafaba97a528 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 20 Oct 2010 03:16:11 -0400 Subject: [PATCH] Pass velocity_dependant_scan.main() --manager through to SawsimHistogram. --- pysawsim/velocity_dependant_scan.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pysawsim/velocity_dependant_scan.py b/pysawsim/velocity_dependant_scan.py index c54cf29..764c03c 100644 --- a/pysawsim/velocity_dependant_scan.py +++ b/pysawsim/velocity_dependant_scan.py @@ -60,11 +60,13 @@ class HistogramMatcher (object): The main entry points are `fit()` and `plot()`. """ def __init__(self, velocity_stream, param_format_string, N=400, - residual_type='jensen-shannon', plot=True, use_cache=False): + manager=None, residual_type='jensen-shannon', plot=True, + use_cache=False): self.experiment_histograms = self.read_force_histograms(velocity_stream) self.param_format_string = param_format_string self.residual_type = residual_type self.N = N + self._manager = manager self.plot = plot self.sawsim_histogram = sawsim_histogram.SawsimHistogram( use_cache=self.use_cache) @@ -118,7 +120,7 @@ class HistogramMatcher (object): for velocity,experiment_hist in self.experiment_histograms.iteritems(): sawsim_hist = self.sawsim_histogram( param_string=self.param_string(params, velocity), N=self.N, - bin_edges=experiment_hist.bin_edges) + bin_edges=experiment_hist.bin_edges, manager=self._manager) r = experiment_histogram.residual( sawsim_hist, type=self.residual_type) residual += r @@ -270,10 +272,11 @@ def main(): velocity_file = args[0] 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, residual_type=options.residual, + N=options.N, manager=manager, residual_type=options.residual, plot=options.plot_residuals, use_cache=options.use_cache) #hm.fit(initial_params) hm.plot(param_ranges, logx=options.logx, logy=options.logy, -- 2.26.2