Skip to content

Commit 6e2bd04

Browse files
committed
Fix black and mypy
1 parent 90a7012 commit 6e2bd04

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

rxnmapper/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""rxnmapper initialization."""
2+
23
__name__ = "rxnmapper"
34
__version__ = "0.3.0" # managed by bump2version
45

rxnmapper/attention.py

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
separating on reactants and products, including special tokens and not including special tokens, in the atom
88
domain / in the token domain, and accounting for adjacent atoms in molecules.
99
"""
10+
1011
import logging
1112
from typing import List, Optional
1213

rxnmapper/core.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Core RXN Attention Mapper module."""
2+
23
from __future__ import absolute_import, division, print_function, unicode_literals
34

45
import logging

rxnmapper/smiles_utils.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Contains functions needed to process reaction SMILES and their tokens"""
2+
23
from __future__ import absolute_import, division, print_function, unicode_literals
34

45
import logging
@@ -72,7 +73,7 @@ def get_atom_types_smiles(smiles: str) -> List[int]:
7273
# If `smiles` is a set of molecules, it may contain a "~".
7374
smiles_mol = smiles_to_mol(smiles.replace("~", "."), sanitize=False)
7475

75-
atom_types = [atom.GetAtomicNum() for atom in smiles_mol.GetAtoms()]
76+
atom_types = [atom.GetAtomicNum() for atom in smiles_mol.GetAtoms()] # type: ignore[call-arg]
7677

7778
return atom_types
7879

@@ -315,7 +316,7 @@ def canonicalize_and_atom_map(smi: str, return_equivalent_atoms=False):
315316
316317
"""
317318
mol = smiles_to_mol(smi, sanitize=False)
318-
for atom in mol.GetAtoms():
319+
for atom in mol.GetAtoms(): # type: ignore[call-arg]
319320
if atom.HasProp("molAtomMapNumber"):
320321
atom_map = atom.GetAtomMapNum()
321322
atom.SetProp("atom_map", str(atom_map))
@@ -329,7 +330,7 @@ def canonicalize_and_atom_map(smi: str, return_equivalent_atoms=False):
329330
]
330331
)
331332

332-
atom_maps_canonical = [mol.GetAtoms()[idx].GetProp("atom_map") for idx in order]
333+
atom_maps_canonical = [mol.GetAtoms()[idx].GetProp("atom_map") for idx in order] # type: ignore[call-arg]
333334

334335
if not return_equivalent_atoms:
335336
return (can_smi, atom_maps_canonical)
@@ -366,7 +367,7 @@ def generate_atom_mapped_reaction_atoms(
366367
i = -1
367368
atom_mapped_precursors_list = []
368369
for precursor_mol in precursors_mols:
369-
for atom in precursor_mol.GetAtoms():
370+
for atom in precursor_mol.GetAtoms(): # type: ignore[call-arg]
370371
i += 1
371372
if i in product_atom_maps:
372373
# atom maps start at an index of 1
@@ -394,7 +395,7 @@ def generate_atom_mapped_reaction_atoms(
394395
i = -1
395396
atom_mapped_products_list = []
396397
for products_mol in products_mols:
397-
for atom in products_mol.GetAtoms():
398+
for atom in products_mol.GetAtoms(): # type: ignore[call-arg]
398399
i += 1
399400
atom_map = product_mapping_dict.get(i, i + 1)
400401
atom.SetProp("molAtomMapNumber", str(atom_map))

0 commit comments

Comments
 (0)