Skip to content

Possible duplicated objective allowed in campaign #95

@tautomer

Description

@tautomer

The current code is

    def suggest(self, **optim_kwargs):
        """
        Maps Optimizer.suggest method
        """
        if self.optimizer.is_fit:
            try:
                # In case X_space has changed, re-set the optimizer X_space
                self.optimizer.set_X_space(self.X_space)
                X, eval = self.optimizer.suggest(objective=self.objective,
                                                 out_constraints=self.output_constraints,
                                                 **optim_kwargs)
                return (X, eval)
            except Exception:
                warnings.warn('Optimization failed')
                return None

objective=self.objective is passed in and objective could be within optim_kwargs, which I think should be allowed as well.

Additionally, the try... except.. block, while catches all errors, almost silently suppress the error, so there is no way for users to know what exactly happened. It will make sense to print out traceback information at higher verbosity.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions