Skip to content

Commit

Permalink
chore(base.py.Fitness): add assert message
Browse files Browse the repository at this point in the history
Co-Authored-By: François-Michel De Rainville <f.derainville@gmail.com>
  • Loading branch information
yxliang01 and fmder authored Mar 20, 2020
1 parent 53e9640 commit e26aae3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion deap/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit e26aae3

Please sign in to comment.