Description:
I'm using pymoo in a FastAPI application where visualization and plotting are not required. However, pymoo currently has a direct dependency on matplotlib, which significantly increases the application's size and install time, especially in serverless or containerized environments.
I would like to request splitting the plotting-related functionality into an optional package extra, such as pymoo[visualization]. This would allow users who need plotting to install it explicitly, while those who don't (like in my FastAPI application) can avoid the unnecessary matplotlib dependency.
Benefits:
- Reduced Application Size: Minimizes the footprint of pymoo in applications where plotting is not needed.
- Faster Installation: Improves installation speed by avoiding the
matplotlib dependency.
- Cleaner Dependencies: Provides a more granular control over dependencies.
- Improved Compatibility: Can reduce dependency conflicts.
Proposed Changes:
- Create a dedicated
pymoo/visualization module/subpackage: Move all plotting-related code into this separate module/subpackage.
- Define a
visualization extra: In setup.py, define a visualization extra that includes matplotlib as a dependency.
- Ensure no core modules import from
pymoo/visualization: Verify that the core optimization modules do not import anything from the plotting module.
- Documentation Update: Update the documentation to reflect the optional
plotting extra and guide users on how to install it.
Example Usage (with the proposed change):
Context:
My specific use case involves embedding pymoo into a FastAPI backend. In this context, generating plots is completely irrelevant, and the inclusion of matplotlib is a significant overhead.
I believe this change would make pymoo more versatile and efficient for a broader range of applications.
Would the pymoo maintainers consider implementing this feature?
Thank you for your time and consideration.
Description:
I'm using pymoo in a FastAPI application where visualization and plotting are not required. However, pymoo currently has a direct dependency on
matplotlib, which significantly increases the application's size and install time, especially in serverless or containerized environments.I would like to request splitting the plotting-related functionality into an optional package extra, such as
pymoo[visualization]. This would allow users who need plotting to install it explicitly, while those who don't (like in my FastAPI application) can avoid the unnecessarymatplotlibdependency.Benefits:
matplotlibdependency.Proposed Changes:
pymoo/visualizationmodule/subpackage: Move all plotting-related code into this separate module/subpackage.visualizationextra: Insetup.py, define avisualizationextra that includesmatplotlibas a dependency.pymoo/visualization: Verify that the core optimization modules do not import anything from the plotting module.plottingextra and guide users on how to install it.Example Usage (with the proposed change):
Install with plotting:
Install without plotting:
Context:
My specific use case involves embedding pymoo into a FastAPI backend. In this context, generating plots is completely irrelevant, and the inclusion of
matplotlibis a significant overhead.I believe this change would make pymoo more versatile and efficient for a broader range of applications.
Would the pymoo maintainers consider implementing this feature?
Thank you for your time and consideration.