From e26aae3a186a83fa0edebd02eecaee5f13c8e612 Mon Sep 17 00:00:00 2001 From: Xiao Liang Date: Sat, 21 Mar 2020 00:14:54 +0800 Subject: [PATCH] chore(base.py.Fitness): add assert message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: François-Michel De Rainville --- deap/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deap/base.py b/deap/base.py index ce36c8ef9..0d2a30e05 100644 --- a/deap/base.py +++ b/deap/base.py @@ -185,7 +185,7 @@ def getValues(self): return tuple(map(truediv, self.wvalues, self.weights)) def setValues(self, values): - assert len(values) == len(self.weights) + assert len(values) == len(self.weights), "Assigned values have not the same length than fitness weights" try: self.wvalues = tuple(map(mul, values, self.weights)) except TypeError: