Skip to content

Commit

Permalink
fix lint format
Browse files Browse the repository at this point in the history
  • Loading branch information
TieuLongPhan committed Nov 11, 2024
1 parent 705a41b commit 8e2f854
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 19 deletions.
23 changes: 14 additions & 9 deletions Test/SynITS/test_its_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,21 @@ def test_parallel_process_smiles(self):

# Inequivalent AAM
self.assertEqual(results_wrong[0]["equivariant"], 0)

def test_unsanitize_smiles(self):
test_2 = {'R_ID':'R_1',
'Map': '[CH2:1]=[CH2:2].[H:3][H:4]>>[CH2:1]([H:3])[CH2:2]([H:4])'}
its_true, _ = ITSExtraction.process_mapped_smiles(test_2, ['Map'])
its_false, _ = ITSExtraction.process_mapped_smiles(test_2, ['Map'], sanitize=False)
self.assertNotEqual(len(its_true['ITSGraph'][2].nodes()), len(its_false['ITSGraph'][2].nodes()))
self.assertEqual(len(its_true['ITSGraph'][2].nodes()), 2)
self.assertEqual(len(its_false['ITSGraph'][2].nodes()), 4)

def test_unsanitize_smiles(self):
test_2 = {
"R_ID": "R_1",
"Map": "[CH2:1]=[CH2:2].[H:3][H:4]>>[CH2:1]([H:3])[CH2:2]([H:4])",
}
its_true, _ = ITSExtraction.process_mapped_smiles(test_2, ["Map"])
its_false, _ = ITSExtraction.process_mapped_smiles(
test_2, ["Map"], sanitize=False
)
self.assertNotEqual(
len(its_true["ITSGraph"][2].nodes()), len(its_false["ITSGraph"][2].nodes())
)
self.assertEqual(len(its_true["ITSGraph"][2].nodes()), 2)
self.assertEqual(len(its_false["ITSGraph"][2].nodes()), 4)


if __name__ == "__main__":
Expand Down
1 change: 0 additions & 1 deletion Test/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import tempfile



class TestCMD(unittest.TestCase):

def setUp(self):
Expand Down
5 changes: 3 additions & 2 deletions syntemp/SynChemistry/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

warnings.warn(
"The 'SynChemistry' subpackage is deprecated and will be removed in future releases. "
"Please migrate to the 'synutility' package as soon as possible, which offers enhanced functionality. "
"Please migrate to the 'synutility' package as soon as possible,"
+ " which offers enhanced functionality. "
"You can install it directly using pip: `pip install synutility`.",
FutureWarning
FutureWarning,
)
8 changes: 5 additions & 3 deletions syntemp/SynITS/its_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from syntemp.SynRule.rules_extraction import RuleExtraction



logger = setup_logging()


Expand Down Expand Up @@ -178,7 +177,9 @@ def process_mapped_smiles(

# Check if mapper_names is not empty to avoid IndexError
if mapper_names:
if "[O]" in Standardize().remove_atom_mapping(mapped_smiles[mapper_names[0]]):
if "[O]" in Standardize().remove_atom_mapping(
mapped_smiles[mapper_names[0]]
):
target_dict["ITSGraph"] = graphs_by_map.get(mapper_names[0], None)
target_dict["GraphRules"] = rules_by_map.get(mapper_names[0], None)
else:
Expand Down Expand Up @@ -220,7 +221,8 @@ def parallel_process_smiles(
- export_full (bool): Whether to export the full results. Defaults to False.
- ignore_aromaticity (bool): Whether to ignore aromaticity in the graph.
Defaults to False.
- confident_mapper (str): The mapper name to use if the check_method is 'RC'. Defaults to 'graphormer'.
- confident_mapper (str): The mapper name to use if the check_method is 'RC'.
Defaults to 'graphormer'.
- symbol (str): The symbol to use if the check_method is 'RC'. Defaults to '>>'.
- sanitize (bool): Whether to sanitize the molecule(s). Defaults to True.
Expand Down
5 changes: 3 additions & 2 deletions syntemp/SynUtils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

warnings.warn(
"The 'SynUtils' subpackage is deprecated and will be removed in future releases. "
"Please migrate to the 'synutility' package as soon as possible, which offers enhanced functionality. "
"Please migrate to the 'synutility' package as soon as possible,"
+ " which offers enhanced functionality. "
"You can install it directly using pip: `pip install synutility`.",
FutureWarning
FutureWarning,
)
5 changes: 3 additions & 2 deletions syntemp/SynVis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

warnings.warn(
"The 'SynVis' subpackage is deprecated and will be removed in future releases. "
"Please migrate to the 'synutility' package as soon as possible, which offers enhanced functionality. "
"Please migrate to the 'synutility' package as soon as possible,"
+ " which offers enhanced functionality. "
"You can install it directly using pip: `pip install synutility`.",
FutureWarning
FutureWarning,
)

0 comments on commit 8e2f854

Please sign in to comment.