Skip to content

Commit

Permalink
Merge pull request #236 from VlachosGroup/tooltip-test-dev
Browse files Browse the repository at this point in the history
This pull request changes the `ToolTip` to use a better maintained alternative (as well as a unit test to that effect) and updates the format and build checker GitHub actions to more recent versions of python.
  • Loading branch information
JacksonBurns authored Jan 11, 2023
2 parents 8b5c042 + 12db311 commit 514356a
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 14 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/check_pypi_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v1
with:
python-version: '3.9'
architecture: x64
- name: Install Dependencies
run: |
# install our dependencies
conda install python=3.7
conda install -c rdkit rdkit
python -m pip install rdkit-pypi
python -m pip install networkx==2.1
python -m pip install pycodestyle autopep8
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/format_code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v1
with:
python-version: '3.9'
architecture: x64
- name: Install Dependencies
run: |
# install our dependencies
conda install python=3.7
conda install -c rdkit rdkit
conda list
python -m pip install rdkit-pypi
python -m pip install networkx==2.1
python -m pip install pycodestyle autopep8
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
architecture: x64
- name: Install Dependencies
run: |
sudo apt-get install -y idle3 python3-tk
python -m pip install rdkit-pypi
python -m pip install networkx==2.1
python -m pip install openpyxl
Expand Down
34 changes: 27 additions & 7 deletions interfaces/UI/AIMSim_ui_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@


import customtkinter as ctk
from idlelib.tooltip import ToolTip
from tktooltip import ToolTip

ctk.set_appearance_mode("dark") # Modes: system (default), light, dark
ctk.set_default_color_theme("blue") # Themes: blue (default), dark-blue, green
Expand Down Expand Up @@ -385,46 +385,66 @@ def updateCompatibleMetricsListener(event):
sticky="w",
)

# add tooltips
# add ToolTips
ToolTip(
self.openConfigButton,
"Open the config file\nfor the last run",
follow=True,
delay=2.0,
)
ToolTip(
self.runButton,
"Write a config file\nand call AIMSim"
"Write a config file\nand call AIMSim",
follow=True,
delay=2.0,
)
ToolTip(
self.targetMoleculeEntry,
"SMILES string or Filepath for an 'external'\nmolecule for comparison to the others"
"SMILES string or Filepath for an 'external'\nmolecule for comparison to the others",
follow=True,
delay=2.0,
)
ToolTip(
self.browseButton,
"Open a File Explorer to locate molecules\nin a supported data format"
"Open a File Explorer to locate molecules\nin a supported data format",
follow=True,
delay=2.0,
)
ToolTip(
self.useMeasureSearchCheckbox,
"Automatically determines best metric\nfor molecules with responses"
"Automatically determines best metric\nfor molecules with responses",
follow=True,
delay=2.0,
)
ToolTip(
self.showAllDescriptorsButton,
"Show experimental descriptors from\nother libraries in the dropdown",
follow=True,
delay=2.0,
)
ToolTip(
self.verboseCheckbutton,
"Check this for additional output\non the terminal or debugging",
follow=True,
delay=2.0,
)
ToolTip(
self.identifyOutliersCheckbutton,
"Isolation Forest to identify outliers\nin sets of molecules with responses",
follow=True,
delay=2.0,
)
ToolTip(
self.multiprocessingCheckbutton,
"Allow use of multiple processing\ncores (automatically configured)",
follow=True,
delay=2.0,
)
ToolTip(
self.molecularDescriptorCombobox,
"Tip: Use AIMSim from the command line\nto access descriptors from Mordred and Padel"
"Tip: Use AIMSim from the command line\nto access descriptors from Mordred and Padel",
follow=True,
delay=2.0,
)

def browseCallback(self):
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ psutil
padelpy
plotly
customtkinter
tkinter-tooltip
21 changes: 21 additions & 0 deletions tests/test_ToolTip.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
""" Test the ToolTip package (and all UI packages) """
import unittest


class TestToolTip(unittest.TestCase):
"""
Test the ToolTip package (and all UI packages) by importing them
"""

def test_import(self):
"""Attempt to import the UI app to ensure imports are correct
"""
try:
from interfaces.UI.AIMSim_ui_main import AIMSimUiApp
except Exception:
self.fail('Unable to import AIMSim UI')


if __name__ == "__main__":
unittest.main()

0 comments on commit 514356a

Please sign in to comment.