bbopt icon indicating copy to clipboard operation
bbopt copied to clipboard

Compatibility with Colab?

Open kmedved opened this issue 4 years ago • 4 comments

Is Bbopt compatible with Jupyter Notebooks? I'm trying to test it in Colab, but I'm having issues getting it to work outside of a .py format.

Thanks for the help and the very cool package.

kmedved avatar Jul 12 '21 16:07 kmedved

@kmedved It works in Jupyter notebooks—the problem is that Colab specifically doesn't let you write to local files. It looks like if you want to save state in a Colab notebook, you're supposed to write to Google Drive. I'll leave this issue open for adding an option to write to Google Drive.

evhub avatar Jul 12 '21 22:07 evhub

Thanks. Would it be possible to put add an example of notebook functionality? I'm getting tripped up on the bb = BlackBoxOptimizer(file=__file__) line in the examples, which seems more geared for a traditional .py script with a if __name__ == "__main__": interface.

Apologies for the somewhat simplistic question. Very eager to try this package.

kmedved avatar Jul 12 '21 22:07 kmedved

Yeah, I'll add some docs on that. For now, you should be able to just do:

import os
from bbopt import BlackBoxOptimizer

bb = BlackBoxOptimizer(file=os.path.join(os.getcwd(), "my_project_name"))

evhub avatar Jul 13 '21 00:07 evhub

Thank you!

kmedved avatar Jul 13 '21 02:07 kmedved