bbopt / nomad

NOMAD - A blackbox optimization software
https://nomad-4-user-guide.readthedocs.io/
GNU Lesser General Public License v3.0
114 stars 24 forks source link

Strange behaviour using PyNOMAD #121

Closed asortino closed 1 year ago

asortino commented 1 year ago

Hi everyone, I'm writing an application for which NOMAD is used as MIP solver. Calling PyNOMAD (v4.3.1) recurrently, a failure happens:

result = PyNomad.optimize(objective, x0, lb, ub, params)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
>   ???
E   AttributeError: 'bytes' object has no attribute 'encode'. Did you mean: 'decode'?
PyNomad.pyx:192: AttributeError

A similar problem was already mentioned and solved in #53, but, in the new version, the problem seems to be there again.

(As suggested in #53, a simple workaround, that works for me, is to create a copy of the parameter list)

Best regards, Alessio

jan-provaznik commented 1 year ago

It seems that the changes made in https://github.com/bbopt/nomad/pull/80 have been reverted with the commit d7c1b52f0add9cf51cedc89c188e9a822be69594. The diff confirms this. I'll make another patch and a pull request again to address this problem.