Skip to content

Commit

Permalink
MCMC is now running again after all the changes to move CADETMatch to…
Browse files Browse the repository at this point in the history
… PyPi
  • Loading branch information
Immudzen committed Oct 10, 2019
1 parent f0f9913 commit 81ad0ef
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CADETMatch/CADETMatch.pyproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<IsWindowsApplication>False</IsWindowsApplication>
<InterpreterId>CondaEnv|CondaEnv|CADETMatch</InterpreterId>
<LaunchProvider>Standard Python launcher</LaunchProvider>
<CommandLineArguments>"C:\Users\kosh_000\CADET\lessons\lesson_0\example.json" 2</CommandLineArguments>
<CommandLineArguments>"F:\temp\cadet_tutorial\lesson_7\bypass\example_bypass.json" 2</CommandLineArguments>
<EnableNativeCodeDebugging>False</EnableNativeCodeDebugging>
<InterpreterArguments>-m scoop -n 6</InterpreterArguments>
</PropertyGroup>
Expand Down
20 changes: 10 additions & 10 deletions CADETMatch/match.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,15 @@ def setupTemplates(cache):

util.setupSimulation(template, cache.target[name]['time'], cache.target[name]['smallest_peak'], cache)

start = time.time()
util.runExperiment(None, experiment, cache.settings, cache.target, template, float(experiment['timeout'])*10, cache)
elapsed = time.time() - start

scoop.logger.info("simulation took %s", elapsed)

#timeout needs to be stored in the template so all processes have it without calculating it
template.root.timeout = elapsed * 10

if cache.settings['searchMethod'] != 'MCMC' and "kde_synthetic" in cache.settings:
#the base case needs to be saved since the normal template file is what the rest of the code will look for
template_base_path = Path(cache.settings['resultsDirMisc'], "template_%s_base.h5" % name)
Expand All @@ -212,18 +221,9 @@ def setupTemplates(cache):
template_bias.save()
template = template_bias

start = time.time()
util.runExperiment(None, experiment, cache.settings, cache.target, template, float(experiment['timeout'])*10, cache)
elapsed = time.time() - start

scoop.logger.info("simulation took %s", elapsed)

#change to where we want the template created
template.filename = template_path.as_posix()

#timeout needs to be stored in the template so all processes have it without calculating it
template.root.timeout = elapsed * 10


template.save()

experiment['simulation'] = template
Expand Down
2 changes: 1 addition & 1 deletion CADETMatch/pareto.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ def __init__(self, similar=None):
similar = eq
super().__init__(similar)

def update(self, population, cache):
def update(self, population):
"do not put anything in this front, it is just needed to maintain compatibility"
pass
4 changes: 2 additions & 2 deletions CADETMatch/search/mcmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,9 @@ def run(cache, tools, creator):

result_data = {'input':[], 'output':[], 'output_meta':[], 'results':{}, 'times':{}, 'input_transform':[], 'input_transform_extended':[], 'strategy':[],
'mean':[], 'confidence':[], 'mcmc_score':[]}
halloffame = pareto.DummyFront(similar=util.similar, similar_fit=util.similar_fit)
halloffame = pareto.DummyFront(similar=util.similar)
meta_hof = pareto.ParetoFront(similar=util.similar, similar_fit=util.similar_fit_meta)
grad_hof = pareto.DummyFront(similar=util.similar, similar_fit=util.similar_fit)
grad_hof = pareto.DummyFront(similar=util.similar)

def local(results):
return process(cache, halloffame, meta_hof, grad_hof, result_data, results, writer, csvfile, sampler)
Expand Down

0 comments on commit 81ad0ef

Please sign in to comment.