Skip to content

Commit

Permalink
fixed exec for Python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
avehtari committed Jun 8, 2016
1 parent 6dd14b6 commit 4a7f6fe
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions GPyOpt/core/task/space.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,8 @@ def indicator_constrains(self,x):
I_x = np.ones((x.shape[0],1))
if self.constrains != None:
for d in self.constrains:
exec('constrain = lambda x:' + d['constrain'])
constrain
exec("ind_x = (constrain(x)<0)*1")
exec('constrain = lambda x:' + d['constrain'],globals())
ind_x = (constrain(x)<0)*1
I_x *= ind_x.reshape(x.shape[0],1)
return I_x

Expand Down

0 comments on commit 4a7f6fe

Please sign in to comment.