Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump pyright to 1.1.363 #2232

Merged
merged 5 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pyright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
- run: uv pip install --system -e .
- uses: jakebailey/pyright-action@v2
with:
version: 1.1.308
version: 1.1.363
18 changes: 9 additions & 9 deletions reacnetgenerator/_detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,11 @@ def _compressvalue(self, x):
return listtobytes(np.array(x))

@abstractmethod
def _readNfunc(self, f):
def _readNfunc(self, f) -> int:
pass

@abstractmethod
def _readstepfunc(self, item):
def _readstepfunc(self, item) -> Tuple[List[bytes], Tuple[int, int]]:
pass

def _connectmolecule(self, bond, level):
Expand Down Expand Up @@ -207,7 +207,7 @@ def _writemoleculetempfile(self, d):
@_Detect.register_subclass("bond")
@_Detect.register_subclass("lammpsbondfile")
class _DetectLAMMPSbond(_Detect):
def _readNfunc(self, f):
def _readNfunc(self, f) -> int:
iscompleted = False
N = None
atomtype = None
Expand Down Expand Up @@ -236,10 +236,10 @@ def _readNfunc(self, f):
self.atomtype = atomtype
return steplinenum

def _readstepfunc(self, item):
def _readstepfunc(self, item) -> Tuple[List[bytes], Tuple[int, int]]:
step, lines = item
bond: list[Optional[Tuple[int]]] = [None] * self.N
level: list[Optional[Tuple[int]]] = [None] * self.N
bond: list[Optional[Tuple[int, ...]]] = [None] * self.N
level: list[Optional[Tuple[int, ...]]] = [None] * self.N
timestep = None
for line in lines:
if line:
Expand Down Expand Up @@ -390,7 +390,7 @@ def _readNfunc(self, f):
self.atomtype = atomtype
return steplinenum

def _readstepfunc(self, item):
def _readstepfunc(self, item) -> Tuple[List[bytes], Tuple[int, int]]:
step, lines = item
step_atoms = []
ss = []
Expand Down Expand Up @@ -439,7 +439,7 @@ def _readstepfunc(self, item):
zhi = ss[2][1]
boxsize = np.array(
[
[xhi - xlo, 0.0, 0.0], # type: ignore
[xhi - xlo, 0.0, 0.0],
[xy, yhi - ylo, 0.0],
[xz, yz, zhi - zlo],
]
Expand Down Expand Up @@ -477,7 +477,7 @@ def _readNfunc(self, f):
steplinenum = N + 2
return steplinenum

def _readstepfunc(self, item):
def _readstepfunc(self, item) -> Tuple[List[bytes], Tuple[int, int]]:
step, lines = item
timestep = step, step
step_atoms = []
Expand Down
5 changes: 4 additions & 1 deletion reacnetgenerator/_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,11 @@ def _printtable(self, allroute, timeaxis=None):
if all(reactionnumber >= 0):
table[tuple(reactionnumber)] = n_reaction

species_idx = pd.Index(species)
df = pd.DataFrame(
table[: len(species), : len(species)], index=species, columns=species
table[: len(species), : len(species)],
index=species_idx,
columns=species_idx,
)
df.to_csv(
self.tablefilename
Expand Down
8 changes: 4 additions & 4 deletions reacnetgenerator/_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,13 +258,13 @@ def convertSMILES(self, atoms, bonds):
ValueError
(RDKit error) Maximum BFS search size exceeded.
"""
m = Chem.RWMol(Chem.MolFromSmiles("")) # type: ignore
m = Chem.RWMol(Chem.MolFromSmiles(""))
d = {}
for name, number in zip(self.atomnames[atoms], atoms):
d[number] = m.AddAtom(Chem.Atom(name)) # type: ignore
d[number] = m.AddAtom(Chem.Atom(name))
for atom1, atom2, level in bonds:
m.AddBond(d[atom1], d[atom2], Chem.BondType(level)) # type: ignore
name = Chem.MolToSmiles(m) # type: ignore
m.AddBond(d[atom1], d[atom2], Chem.BondType(level))
name = Chem.MolToSmiles(m)
return self._re(name)

def _getatomsandbonds(self, line):
Expand Down
Empty file added reacnetgenerator/py.typed
Empty file.
Loading