Skip to content

Commit

Permalink
rename function
Browse files Browse the repository at this point in the history
  • Loading branch information
klausweinbauer committed Mar 12, 2024
1 parent 4ef9f9e commit 6c06b2e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ from fgutils.utils import mol_to_graph
smiles = "O=C(C)Oc1ccccc1C(=O)O" # acetylsalicylic acid
mol_graph = mol_to_graph(rdmolfiles.MolFromSmiles(smiles))
index_map, groups = fgutils.get_functional_groups_raw(mol_graph)
index_map, groups = fgutils.get_functional_groups(mol_graph)
print(index_map, groups)
```

Expand Down
2 changes: 1 addition & 1 deletion fgutils/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from .query import get_functional_groups_raw
from .query import get_functional_groups
2 changes: 1 addition & 1 deletion fgutils/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def is_functional_group(graph, index: int, config: FGConfig):
return is_fg, sorted(fg_indices)


def get_functional_groups_raw(graph) -> tuple[dict, list[str]]:
def get_functional_groups(graph) -> tuple[dict, list[str]]:
def _query(nodes: list[FGTreeNode], graph, idx, checked_groups=[]):
fg_groups = []
fg_indices = []
Expand Down
6 changes: 3 additions & 3 deletions test/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import collections
import rdkit.Chem.rdmolfiles as rdmolfiles

from fgutils.query import get_functional_groups_raw, is_functional_group
from fgutils.query import get_functional_groups, is_functional_group
from fgutils.parse import parse
from fgutils.fgconfig import get_FG_by_name
from fgutils.utils import mol_to_graph
Expand Down Expand Up @@ -60,7 +60,7 @@ def _assert_not_fg(raw_result, fg_name, indices):

def test_get_functional_groups_raw():
mol = parse("C=O")
r = get_functional_groups_raw(mol)
r = get_functional_groups(mol)
_assert_fg(r, "carbonyl", [0, 1])
_assert_fg(r, "ketone", [0, 1])
_assert_fg(r, "aldehyde", [0, 1])
Expand Down Expand Up @@ -109,6 +109,6 @@ def test_get_functional_group(name, smiles, anchor, exp_indices):
def test_functional_group_on_compound(smiles, functional_groups, exp_indices):
assert len(functional_groups) == len(exp_indices)
mol = mol_to_graph(rdmolfiles.MolFromSmiles(smiles))
r = get_functional_groups_raw(mol)
r = get_functional_groups(mol)
for fg, indices in zip(functional_groups, exp_indices):
_assert_fg(r, fg, indices)

0 comments on commit 6c06b2e

Please sign in to comment.