CEMeNT-PSAAP / MCDC

MC/DC: Monte Carlo Dynamic Code
https://mcdc.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
23 stars 24 forks source link

Moved tkinter to try/except in mcdc/visualizer #220

Closed clemekay closed 3 months ago

clemekay commented 3 months ago

@jpmorgan98 This isn't quite what you said you wanted to do in #214, but it maybe accomplishes the goals of that? Moving the tkinter module to the existing try/except module in mcdc/vis and adding a sys.exit() to the ImportError exception handling makes it so that any vis-dependency-related errors only print when trying to call mcdc.visualizer().

Making this a draft since I'm on a Mac that can't use the dependencies, I can only test the exception handling haha. If someone else could test that the visualizer itself still works, perhaps this small change is a good option?

jpmorgan98 commented 3 months ago

I was planing on moving that whole visualizer to a sub-folder such that a user would have to import mcdc.visualizer. Kinda like scipy's integration library. That all these errors will show if a user specifically imports them