values = numpy.empty((n_trials, n_objectives), dtype=numpy.float64)
params = numpy.empty((n_trials, trans.bounds.shape[0]), dtype=numpy.float64)
if self._constraints_func is not None:
n_constraints = len(next(iter(self._trial_constraints.values())))
con = numpy.empty((n_trials, n_constraints), dtype=numpy.float64)
else:
con = None
After Change
// `constraints` can be `None` if `constraints_func` raised an error. The best we
// can do is to fill with NaN.
if constraints is not None:
n_constraints = len(constraints)
if con is None:
con = numpy.full((n_trials, n_constraints), numpy.nan, dtype=numpy.float64)
con[trial_idx] = constraints