Project-Platypus / Platypus

A Free and Open Source Python Library for Multiobjective Optimization
GNU General Public License v3.0
573 stars 152 forks source link

ImportError: cannot import name 'default_variator' from 'platypus' #246

Closed EwoutH closed 2 months ago

EwoutH commented 2 months ago

Our CI detected a new import error, on using platypus-opt 1.3.0.

ImportError: cannot import name 'default_variator' from 'platypus'

Location the import error originates from: outputspace_exploration.py#L30

dhadka commented 2 months ago

I sent a PR to EMAWorkbench with two possible fixes. One in the PR and one in the PR's description, depending if you want to support both versions of just 1.3.0 moving forward.

https://github.com/quaquel/EMAworkbench/pull/369

dhadka commented 2 months ago

Version 1.3.1 is published that adds these methods back. However, they now warn about being deprecated, so you may still see CI errors if pytest is configured to fail on warnings.

If it's still causing issues for your CI, you might need to ignore these with something like:

import warnings
warnings.filterwarnings('ignore', message=".*PlatypusConfig.*", category=DeprecationWarning)

or

-Wignore::DeprecationWarning::
EwoutH commented 2 months ago

Thanks for both the bugfix release and the solutions provided!