RakipInitiative / ModelRepository

Joint project of EFSA, Federal Institute For Risk Assessment, DTU and ANSES to create a online model repository.
GNU General Public License v3.0
2 stars 0 forks source link

Editor/Runner Bug: creating model with ggplot2 fails #330

Closed schuelet closed 2 years ago

schuelet commented 3 years ago

In the Editor I tried to create a simple model: script:

library(ggplot2) out <- x* 20

visualization: plot(out)

The plot sometimes pops up (outside the Runner node) and then the Runner fails with Rserve crashing.

@ahmadswaid and @miguelalba Can you reproduce this? I can't figure out why this fails.

knime://external-KNIME-Server/FSKX_Testing/FSK-Lab_2.0/broken_workflows/editor_ggplot_fail

ahmadswaid commented 3 years ago

@schuelet I can reproduce it, investigating...

schuelet commented 3 years ago

@ahmadswaid do you think you will have time for that or should I take this?

ahmadswaid commented 3 years ago

@schuelet: sorry I forget about it. I will try to solve it.

ahmadswaid commented 3 years ago

@schuelet: there is no problem with loading ggplot2 in any script of the model, I tried to use this library with a new demo editors and it worked fine. To be honest, I don't what is wrong with your demo (it doesn't even contains any hidden or special characters), I rewrote the same exact model with another editor and it worked fine.

knime://BfR-extern/FSKX_Testing/FSK-Lab_2.0/broken_workflows/editor_ggplot_working

schuelet commented 3 years ago

@ahmadswaid Very interesting, the models do indeed work but only if language_written_in is not edited. Once you provide that, the model will fail. I will have a look at the Scripthandler, maybe there is something messed up going on.

schuelet commented 3 years ago

The issue is related to the GgPlot2Plotter class. That is the Plotter chosen when a model contains the line library(ggplot2) If the visualization script now contains the command "plot(...)", which is not a ggplot function, then "ggsave" fails or can't create a valid svg file. Possibly related to dev.off().

schuelet commented 2 years ago

fixed in https://github.com/SiLeBAT/FSK-Lab/pull/996