Skip to content
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

Make Ax optional #156

Merged
merged 12 commits into from
Dec 22, 2023
Merged

Make Ax optional #156

merged 12 commits into from
Dec 22, 2023

Conversation

RemiLehe
Copy link
Collaborator

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`

Copy link
Member

@AngelFP AngelFP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @RemiLehe . Could you have a look at the comments? It would also be good to reflect this change in the docs.

@@ -24,7 +24,6 @@ classifiers = [
dependencies = [
'libensemble @ git+https://github.com/Libensemble/libensemble@develop',
'jinja2',
'ax-platform >= 0.3.4',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add pandas here? It is not only needed for testing.

pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Show resolved Hide resolved
@ax3l ax3l added the enhancement New feature or request label Dec 17, 2023
Co-authored-by: Ángel Ferran Pousa <angel.ferran.pousa@desy.de>
Copy link
Member

@AngelFP AngelFP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a table to the docs to illustrate the dependencies
image

and updated the installation instructions, except the ones for Perlmutter. @RemiLehe @ax3l could you check if they should also be updated? Once that's done I'm OK to merge.

@RemiLehe
Copy link
Collaborator Author

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

@AngelFP AngelFP changed the title Make Ax optional for optimas Make Ax optional Dec 22, 2023
@AngelFP
Copy link
Member

AngelFP commented Dec 22, 2023

@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.

@AngelFP AngelFP merged commit 0024ed8 into main Dec 22, 2023
7 of 8 checks passed
@AngelFP AngelFP deleted the remove_ax_dependency branch December 22, 2023 17:02
ax3l added a commit to ax3l/optimas that referenced this pull request Mar 28, 2024
Fix the readme so it installs all dependencies by default.
Follow-up to optimas-org#156.
ax3l added a commit to ax3l/optimas that referenced this pull request Mar 28, 2024
Fix the readme so it installs all dependencies by default.
Follow-up to optimas-org#156.

Use recommended/best practice pip syntax (as a module).
ax3l added a commit to ax3l/optimas that referenced this pull request Apr 30, 2024
Fix the readme so it installs all dependencies by default.
Follow-up to optimas-org#156.

Use recommended/best practice pip syntax (as a module).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants