Fix: Allow optional installation of matplotlib#749
Fix: Allow optional installation of matplotlib#749mspi92 wants to merge 4 commits intoanyoptimization:mainfrom
Conversation
|
Thanks for the PR! I agree that removing matplotlib as a mandatory dependency would be great. However, some of the
My usual stance is that a library should be fully importable without any extras installed. But that certain functions may fail when called (with a helpful error message) if certain extras aren't installed. Usually that means performing the import of the optional dependency within a function, rather than at the top level of a module, and handling the case that an (It would be nice if we had a test in the suite that imported |
|
Thanks for the response.
|
|
after debating this a little bit with myself, I agree that (However, I also understand that there could be use cases where this functionality is not required) I will close this issue for now. |
First of all: Excuse me for not opening an issue first, but the fix is so small that I thought I might as well :D
I discovered that matplotlib is listed as a hard dependency in
pyproject.tomlwhich will always be installed.This contradicts the optional
pymoo[visualization]depency and the wrapper implemented for matplotlib inpymoo.visualization.matplotlib.I suspect that the entry was falsely copied over when migrating from the
setup.pyto pyproject.toml.Thank you very much