Open folmos-at-orange opened 4 months ago
Perhaps also add a dedicated sklearn helper, like show_report
which takes a fitted estimator as a parameter and calls os_open
to show the report? Thus, the user need not look-up the report; this would be transparent.
Or, instead of having a helper, add a method on sklearn estimators to do this? And then, in #90, we would change / upgrade this method so that:
Yes, I'm ok with show_report
in sklean estimators (the only minor issue is that we will have to write an ugly temporary file). We should have both show_report
as a class method and as a standalone function for the UX of core
users.
With respect to the fallback I'm ok as well.
In the weekly it was settled to call the function visualize_report
.
Description
While waiting for the visualization widget #90, add a simple function to open a (co)visualization report file.
Questions/Ideas
def os_open(path): """Opens a file or directory with its default application, prints a message on failure""" try: if platform.system() == "Windows": os.startfile(path) elif platform.system() == "Darwin": subprocess.call(["open", path]) else: subprocess.call(["xdg-open", path]) except OSError as error: print("Could not open report file {error}. Path: {path}")