Closed dietmarw closed 5 months ago
Do you just want to (optionally) skip the tests or get rid of kaleido altogether?
Fancy plot capabilities are not the primary function of FMPy (I'd think). This could be achieved outside it. So removing the Kaleido dependency (and therefore possibly the chromium parts) might then reduce also a FMPy install/image considerably.
The plot function is an integral part of the library. However, you can choose which dependencies to install if you don't need it (see https://github.com/CATIA-Systems/FMPy/blob/main/setup.py#L201).
The issue is still not resolved since plot_result
depends on kaleido. So if you do not install it then you can not use plot_result
which is part of the core util
and not just a part of some extra examples. So plot_result
could be improved to fall back on matplotlib (after all that is the dependency as mentioned for plot and not kaleido). https://github.com/CATIA-Systems/FMPy/blob/main/setup.py#L203
Would that be possible?
We plan to use (only) Plotly for all plots in the future (see also #614).
But this means that FMPy would be not suitable to run in a Docker container. Which would be a real shame since there are a lot of applications areas for that. So having a fallback to matplotlib would be real improvement.
(or any other more lightweight plot solution, does not need to be matplotlib)
But this means that FMPy would be not suitable to run in a Docker container.
Why not? Just don't use the plot functions.
well the plot functions are part of the core utils of FMPy. So it is strange that it will not work. Mind it is only the write to file where kaleido is currently needed. So if that can be done differently you have a more robust FMPy also suitable for containers.
When running the
plot_result
function inside a Docker container one experiences the issue that there is not enough shared memory for chromium (which kaleido uses). There are some hacks to try to make it work but, really it would be much nicer if there was a configuration option forplot_result
that allows to use matplotlib instead.I did see https://github.com/CATIA-Systems/FMPy/blob/main/fmpy/__init__.py#L12 But that does not help since this would mean using an own custom version of FMPy instead of the officially released one.