KhiopsML / khiops-python

The Python library of the Khiops AutoML suite
https://khiops.org
BSD 3-Clause Clear License
8 stars 1 forks source link

Add function to open the external visualization tool #195

Open folmos-at-orange opened 6 days ago

folmos-at-orange commented 6 days ago

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}")


- Test manually, test in CI optional.
- Change the Tutorials so they use this function instead of the locally defined one.
popescu-v commented 2 days 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:

folmos-at-orange commented 1 day ago

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.