This PR fixes the issue by defining dummy FloatSlider and IntSlider classes which do not raise exceptions when instantiated. This allows the patched @interact to handle the missing ipywidgets scenario gracefully.
After applying the changes suggested in this PR the ImportError is raised as intended.
$ python -c "import seaborn; seaborn.choose_colorbrewer_palette('quatlitative')"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "<redacted>/seaborn/seaborn/widgets.py", line 141, in choose_colorbrewer_palette
@interact
^^^^^^^^
File "<redacted>/seaborn/seaborn/widgets.py", line 10, in interact
raise ImportError(msg)
ImportError: Interactive palettes require `ipywidgets`, which is not installed.
This addresses #3755
Resolution
This PR fixes the issue by defining dummy
FloatSlider
andIntSlider
classes which do not raise exceptions when instantiated. This allows the patched@interact
to handle the missing ipywidgets scenario gracefully.After applying the changes suggested in this PR the
ImportError
is raised as intended.