Skip to content

Commit

Permalink
adding a show() command if we have rdkit installed
Browse files Browse the repository at this point in the history
  • Loading branch information
brifordwylie committed Dec 27, 2024
1 parent fdc74a4 commit a3eb6cf
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/workbench/repl/workbench_shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import matplotlib.pyplot as plt # noqa

plt.ion()

HAVE_MATPLOTLIB = True
except ImportError:
HAVE_MATPLOTLIB = False
Expand All @@ -36,6 +35,16 @@
from workbench.api import Meta
from workbench.cached.cached_meta import CachedMeta

# If we have RDKIT/Mordred let's pull in our cheminformatics utils
try:
import rdkit # noqa
import mordred # noqa
from workbench.utils import chem_utils

HAVE_CHEM_UTILS = True
except ImportError:
HAVE_CHEM_UTILS = False


def onboard():
"""Onboard a new user to Workbench"""
Expand Down Expand Up @@ -152,6 +161,10 @@ def __init__(self):
self.commands["cached_meta"] = self.switch_to_cached_meta
self.commands["direct_meta"] = self.switch_to_direct_meta

# Add cheminformatics utils if available
if HAVE_CHEM_UTILS:
self.commands["show"] = chem_utils.show

def start(self):
"""Start the Workbench IPython shell"""
cprint("magenta", "\nWelcome to Workbench!")
Expand Down

0 comments on commit a3eb6cf

Please sign in to comment.