Skip to content

Broken dependency in design space Bayesian optimization #2322

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
yuanshen-flexcompute opened this issue Mar 17, 2025 · 4 comments · Fixed by #2323
Closed

Broken dependency in design space Bayesian optimization #2322

yuanshen-flexcompute opened this issue Mar 17, 2025 · 4 comments · Fixed by #2323
Assignees
Labels
2.9 will go into version 2.9.*

Comments

@yuanshen-flexcompute
Copy link

Describe the bug
The Bayesian Optimizer MethodBayOpt relies on an external library bayesian-optimization. The external library changed their API in an update that breaks dependency with MethodBayOpt. The most recent version of bayesian-optimization that still works is 1.5.1.

Version history: https://github.com/bayesian-optimization/BayesianOptimization/releases
Update that broke the dependency: bayesian-optimization/BayesianOptimization#447

To Reproduce
Steps to reproduce the behavior:

  1. Install the latest version of bayesian-optimization library
  2. Open a notebook that uses MethodBayOpt or set up a dummy DesignSpace.
  3. Execute the design space using run().

Expected behavior
The design space run() fails with an error message about missing bayes_opt library.

Additional context
The version 1.5.1 of bayesian-optimization has been tested to work successfully without error. Since this is an external library that the user is expected to install by themselves, we can update our documentation to emphasize that they should install the older 1.5.1 version.

@yuanshen-flexcompute
Copy link
Author

Per Tom's suggestion: Update the line

from

"Cannot run Bayesian optimization as 'bayes_opt' module not found. Please check installation or run 'pip install bayesian-optimization'."

to

"Cannot run Bayesian optimization as 'bayes_opt' module not found. Please check installation or run 'pip install bayesian-optimization==1.5.1'."

@yaugenst-flex
Copy link
Collaborator

Hmm I thought we addressed this in #2281, but it doesn't apply to packaging... I can change the message, but more generally we should probably start bundling packages for packages @daquinteroflex?

@daquinteroflex
Copy link
Collaborator

daquinteroflex commented Mar 18, 2025

Bundling might be an interesting approach, but also it's a question if people want to share tidy3d dependencies within their own environments and whether we want to support that or have tidy3d work in a kind of self contained way via dependency bundling into executales. I'm also curious how that'd work for distribution in pypi in terms of size. Another aspect is compatibility on the backend with bundling, which could be tricky in the short run but possible in the long run - but we can chat about that via slack.

Maybe for now, we dont have a tidy3d[design] when I've just checked. I guess just change this pyproject.toml requirement line

bayesian-optimization = { version = "<2", optional = true }
and go from there. Eventually these "plugin" dependencies groups can become their own pyproject.toml if we decide to split them off at some point I guess too, or even could be a bundled package? Not sure how that'd work?

@yaugenst-flex
Copy link
Collaborator

Maybe for now, we dont have a tidy3d[design] when I've just checked. I guess just change this pyproject.toml requirement line

yeah maybe there was a misunderstanding, but this is what I meant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.9 will go into version 2.9.*
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants