Skip to content

Commit

Permalink
fix pyright errors (#1920)
Browse files Browse the repository at this point in the history
  • Loading branch information
njzjz authored May 12, 2023
1 parent 3e674d4 commit f0e21aa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion reacnetgenerator/_draw.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def _draw(self, timeaxis=None):
G.add_weighted_edges_from(
[(showname[name[i]], showname[name[j]], table[i][j])]
)
weights = np.array([math.log(G[u][v]["weight"] + 1) for u, v in G.edges()])
weights = np.array([math.log(G[u][v]["weight"] + 1) for u, v in G.edges()]) # type: ignore
widths = (
weights
/ np.max(weights)
Expand Down
8 changes: 4 additions & 4 deletions reacnetgenerator/_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,13 @@ def convertSMILES(self, atoms, bonds):
ValueError
(RDKit error) Maximum BFS search size exceeded.
"""
m = Chem.RWMol(Chem.MolFromSmiles(""))
m = Chem.RWMol(Chem.MolFromSmiles("")) # type: ignore
d = {}
for name, number in zip(self.atomnames[atoms], atoms):
d[number] = m.AddAtom(Chem.Atom(name))
d[number] = m.AddAtom(Chem.Atom(name)) # type: ignore
for atom1, atom2, level in bonds:
m.AddBond(d[atom1], d[atom2], Chem.BondType(level))
name = Chem.MolToSmiles(m)
m.AddBond(d[atom1], d[atom2], Chem.BondType(level)) # type: ignore
name = Chem.MolToSmiles(m) # type: ignore
return name

def _getatomsandbonds(self, line):
Expand Down
3 changes: 2 additions & 1 deletion reacnetgenerator/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from pathlib import Path
from typing import Dict, List, Tuple, Union

import ase
import ase.geometry
import ase.units
import numpy as np


Expand Down

0 comments on commit f0e21aa

Please sign in to comment.