Skip to content

Commit

Permalink
Merge pull request #229 from VlachosGroup/gui-dev
Browse files Browse the repository at this point in the history
Complete GUI Overhaul
  • Loading branch information
JacksonBurns authored Aug 18, 2022
2 parents db8c731 + 289c936 commit f81476b
Show file tree
Hide file tree
Showing 8 changed files with 400 additions and 195 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.8', '3.9']
name: Python ${{ matrix.python-version }} sample
Expand Down
2 changes: 1 addition & 1 deletion aimsim/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
from . import chemical_datastructures
from . import utils

__version__ = "1.0.3"
__version__ = "1.1.0"
22 changes: 16 additions & 6 deletions aimsim/chemical_datastructures/molecule_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class MoleculeSet:
Spectral Embedding ('spectral_embedding')
"""

def __init__(
self,
molecule_database_src,
Expand Down Expand Up @@ -396,6 +397,10 @@ def worker(thread_idx, n_mols, start_idx, end_idx, queue): # pragma: no cover
except NotInitializedError as e:
e.message += "Similarity matrix could not be set "
raise e
except ValueError as e:
raise RuntimeError(
f'Unable to proccess molecule {molecule.mol_text}'
) from e
queue.put(local_similarity_matrix)
return None

Expand Down Expand Up @@ -448,12 +453,17 @@ def worker(thread_idx, n_mols, start_idx, end_idx, queue): # pragma: no cover
"Computing similarity of molecule num "
f"{target_mol_id + 1} against {source_mol_id + 1}"
)
similarity_matrix[
source_mol_id, target_mol_id
] = molecule.get_similarity_to(
self.molecule_database[target_mol_id],
similarity_measure=self.similarity_measure,
)
try:
similarity_matrix[
source_mol_id, target_mol_id
] = molecule.get_similarity_to(
self.molecule_database[target_mol_id],
similarity_measure=self.similarity_measure,
)
except ValueError as e:
raise RuntimeError(
f'Unable to proccess molecule {molecule.mol_text}'
) from e

self.similarity_matrix = similarity_matrix

Expand Down
4 changes: 3 additions & 1 deletion aimsim/ops/similarity_measures.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,9 @@ def __call__(self, mol1_descriptor, mol2_descriptor):
similarity_ (float): Similarity value
"""
if not self._validate_fprint(mol1_descriptor) or not self._validate_fprint(mol2_descriptor):
raise ValueError('Molecule descriptor has no active bits')
raise ValueError(
f'Molecule descriptor ({mol1_descriptor.label_}) has no active bits.'
)
similarity_ = None
if self.metric == "l0_similarity":
try:
Expand Down
2 changes: 1 addition & 1 deletion aimsim/tasks/measure_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def __call__(self,
n_threads=molecule_set_configs.get(
'n_threads', 1),
sampling_ratio=subsample_subset_size)
except (InvalidConfigurationError, ValueError) as e:
except (InvalidConfigurationError, ValueError, RuntimeError) as e:
if is_verbose:
print(f'Could not try {fingerprint_type} with '
f'similarity measure {similarity_measure} due to '
Expand Down
Binary file added interfaces/UI/AIMSim-GUI-corner-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit f81476b

Please sign in to comment.