From 01a0f122230d9ee5691738a7fb138e1e2974d93e Mon Sep 17 00:00:00 2001 From: William Heymann Date: Tue, 17 Aug 2021 09:28:53 +0200 Subject: [PATCH] scoretest no longer uses deap --- CADETMatch.pyproj | 2 +- CADETMatch/search/scoretest.py | 38 ++++++---------------------------- 2 files changed, 7 insertions(+), 33 deletions(-) diff --git a/CADETMatch.pyproj b/CADETMatch.pyproj index 594a834..9516585 100644 --- a/CADETMatch.pyproj +++ b/CADETMatch.pyproj @@ -12,7 +12,7 @@ {888888a0-9f3d-457c-b088-3a5042f75d52} Standard Python launcher CondaEnv|CondaEnv|pymoo_devel - "F:\ryzen_pymoo_unsga3\search\multistart\dextran.json" 12 + "F:\ryzen_pymoo_unsga3\search\scoretest\dextran.json" 12 False true diff --git a/CADETMatch/search/scoretest.py b/CADETMatch/search/scoretest.py index dc72e30..1dc49fc 100644 --- a/CADETMatch/search/scoretest.py +++ b/CADETMatch/search/scoretest.py @@ -19,7 +19,6 @@ def run(cache, tools, creator): path = Path(cache.settings["resultsDirBase"], cache.settings["csv"]) with path.open("a", newline="") as csvfile: writer = csv.writer(csvfile, delimiter=",", quoting=csv.QUOTE_ALL) - pop = cache.toolbox.population(n=0) sim_start = generation_start = time.time() result_data = { "input": [], @@ -34,6 +33,7 @@ def run(cache, tools, creator): "confidence": [], } + population = [] if "seeds" in cache.settings: seed_pop = [ pop.Individual( @@ -41,7 +41,7 @@ def run(cache, tools, creator): ) for sublist in cache.settings["seeds"] ] - pop.extend(seed_pop) + population.extend(seed_pop) if cache.metaResultsOnly: hof = pareto.DummyFront() @@ -59,10 +59,9 @@ def run(cache, tools, creator): similar=pareto.similar, similar_fit=pareto.similar_fit_meta(cache) ) - invalid_ind = [ind for ind in pop if not ind.fitness.valid] stalled, stallWarn, progressWarn = util.eval_population( cache, - invalid_ind, + population, writer, csvfile, hof, @@ -74,7 +73,7 @@ def run(cache, tools, creator): progress.writeProgress( cache, -1, - pop, + population, hof, meta_hof, grad_hof, @@ -85,7 +84,7 @@ def run(cache, tools, creator): ) if cache.settings.get("condTest", None): - for ind in invalid_ind: + for ind in population: J = jacobian.jac(ind, cache) multiprocessing.get_logger().info("%s %s", ind, J) @@ -125,29 +124,4 @@ def setupDEAP( base, tools, ): - "setup the DEAP variables" - creator.create( - "Individual", - pop.Individual - ) - - creator.create( - "IndividualMeta", - pop.Individual - ) - cache.toolbox.register( - "individualMeta", util.initIndividual, creator.IndividualMeta, cache - ) - - cache.toolbox.register( - "individual", - util.generateIndividual, - creator.Individual, - len(cache.MIN_VALUE), - cache.MIN_VALUE, - cache.MAX_VALUE, - cache, - ) - cache.toolbox.register( - "population", tools.initRepeat, list, cache.toolbox.individual - ) + pass