optimas-org / optimas

Optimization at scale, powered by libEnsemble
https://optimas.readthedocs.io
Other
22 stars 13 forks source link

Make Ax optional #156

Closed RemiLehe closed 8 months ago

RemiLehe commented 9 months ago

This PR removes ax-platform from the dependencies of optimas, since this can be quite a heavy dependency (but adds pandas which, as it turns out, was a hidden dependency of optimas).

The user will get an error telling them to install ax-platform whenever they try to instantiate an Ax-based generator, but Ax is not installed:

In [1]: from optimas.generators import AxSingleFidelityGenerator # no import error

In [2]: gen = AxSingleFidelityGenerator()
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Cell In[2], line 1
----> 1 gen = AxSingleFidelityGenerator()

File ~/Documents/codes/optimas/optimas/generators/ax/import_error_dummy_generator.py:14, in AxImportErrorDummyGenerator.__init__(self, *args, **kwargs)
     11 def __init__(
     12     self, *args, **kwargs
     13 ) -> None:
---> 14     raise RuntimeError(
     15         "You need to install ax-platform, in order "
     16         "to use Ax-based generators in optimas.\n"
     17         "e.g. with `pip install ax-platform >= 0.3.4`"
     18     )

RuntimeError: You need to install ax-platform, in order to use Ax-based generators in optimas.
e.g. with `pip install ax-platform >= 0.3.4`
RemiLehe commented 8 months ago

@AngelFP Awesome, thanks a lot! I updated the Perlmutter instructions. Feel free to merge the PR :)

AngelFP commented 8 months ago

@AngelFP Awesome, thanks a lot! I updated the Perlmutter instructions. Feel free to merge the PR :)

Great! I'll merge as soon as the tests are done.