From 8dec96dc40aa2aae0f8c152c3ce51b3ecc664c92 Mon Sep 17 00:00:00 2001 From: albert bou Date: Thu, 8 Aug 2024 18:08:47 +0200 Subject: [PATCH] improve tests --- .github/unittest/install_dependencies.sh | 2 +- .github/unittest/install_dependencies_nightly.sh | 2 +- tests/test_tokenizers.py | 9 ++++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/unittest/install_dependencies.sh b/.github/unittest/install_dependencies.sh index cb17626..b5d29cb 100644 --- a/.github/unittest/install_dependencies.sh +++ b/.github/unittest/install_dependencies.sh @@ -5,7 +5,7 @@ python -m pip install --upgrade pip python -m pip install flake8 pytest pytest-cov hydra-core tqdm python -m pip install torch torchvision python -m pip install transformers promptsmiles torchrl rdkit==2023.3.3 MolScore # causal-conv1d>=1.4.0 mamba-ssm==1.2.2 -python -m pip install deepsmiles selfies smi2sdf smi2svg # atomInSmiles safe +python -m pip install deepsmiles selfies smi2sdf smi2svg atomInSmiles safe-mol python -m pip install molbloom # Verify installations diff --git a/.github/unittest/install_dependencies_nightly.sh b/.github/unittest/install_dependencies_nightly.sh index 751fc97..5b5a079 100644 --- a/.github/unittest/install_dependencies_nightly.sh +++ b/.github/unittest/install_dependencies_nightly.sh @@ -5,7 +5,7 @@ python -m pip install --upgrade pip python -m pip install flake8 pytest pytest-cov hydra-core tqdm python -m pip install torch torchvision python -m pip install transformers promptsmiles torchrl rdkit==2023.3.3 MolScore # causal-conv1d>=1.4.0 mamba-ssm==1.2.2 -python -m pip install deepsmiles selfies smi2sdf smi2svg # atomInSmiles safe +python -m pip install deepsmiles selfies smi2sdf smi2svg atomInSmiles safe-mol python -m pip install molbloom # Verify installations diff --git a/tests/test_tokenizers.py b/tests/test_tokenizers.py index 1e2165b..c1aa629 100644 --- a/tests/test_tokenizers.py +++ b/tests/test_tokenizers.py @@ -1,7 +1,7 @@ -import pytest import warnings from functools import partial -from rdkit.Chem import AllChem as Chem + +import pytest from acegen.vocabulary.tokenizers import ( AISTokenizer, @@ -13,6 +13,7 @@ SMILESTokenizerGuacaMol, SmiZipTokenizer, ) +from rdkit.Chem import AllChem as Chem try: import deepsmiles @@ -376,4 +377,6 @@ def test_smiles_based_tokenizers(tokenizer, available, error): eq, err = smiles_eq(decoded_smiles, smiles) assert eq, err if decoded_smiles != smiles: - warnings.warn(f"{tokenizer.__name__} behaviour: {smiles} -> {decoded_smiles}") + warnings.warn( + f"{tokenizer.__name__} behaviour: {smiles} -> {decoded_smiles}" + )