Fixed build_objective
This commit is contained in:
parent
4d0275e9a4
commit
24976cd726
@ -41,7 +41,7 @@ def build_objective(ls, state_vector, p):
|
||||
:rtype: function
|
||||
"""
|
||||
def objective(*m):
|
||||
return sum(l(state_vector, p, m) for l in ls)
|
||||
return sum(l(state_vector, p, list(m)) for l in ls)
|
||||
return objective
|
||||
|
||||
|
||||
|
@ -32,7 +32,7 @@ class Nlp(TestCase):
|
||||
[0.3, -0.3]]
|
||||
m1 = mock('m1')
|
||||
m2 = mock('m2')
|
||||
m = (m1, m2)
|
||||
m = [m1, m2]
|
||||
container = mock('function container')
|
||||
expect(container).l0(state_vector, p, m).and_return(2).once()
|
||||
expect(container).l1(state_vector, p, m).and_return(3).once()
|
||||
|
Loading…
x
Reference in New Issue
Block a user