Skip to content

Commit

Permalink
use yield from (ruff UP028)
Browse files Browse the repository at this point in the history
  • Loading branch information
fchapoton authored and sunqm committed Oct 16, 2023
1 parent c1ae259 commit ceea353
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
3 changes: 1 addition & 2 deletions pyscf/agf2/dfragf2.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,7 @@ def prange(self, start=None, stop=None, step=None):
if stop is None: stop = self.get_naoaux()
if step is None: step = self.blockdim

for p0, p1 in mpi_helper.prange(start, stop, step):
yield p0, p1
yield from mpi_helper.prange(start, stop, step)


class _ChemistsERIs(ragf2._ChemistsERIs):
Expand Down
3 changes: 1 addition & 2 deletions pyscf/agf2/mpi_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,7 @@ def nrange(start, stop=None, step=1):
if stop is None:
start, stop = 0, start

for i in range(start+rank, stop, step*size):
yield i
yield from range(start+rank, stop, step*size)


def prange(start, stop, step):
Expand Down
3 changes: 1 addition & 2 deletions pyscf/pbc/lib/kpts.py
Original file line number Diff line number Diff line change
Expand Up @@ -1173,5 +1173,4 @@ def cache_stabilizer(self):
def loop_stabilizer(self, index):
if self._kqrts_stab is None or self._ops_stab is None:
self.cache_stabilizer()
for klcd, iop in zip(self._kqrts_stab[index], self._ops_stab[index]):
yield klcd, iop
yield from zip(self._kqrts_stab[index], self._ops_stab[index])
3 changes: 1 addition & 2 deletions pyscf/tdscf/common_slow.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,8 +605,7 @@ def __call__(self, v):
return r

def __iter__(self):
for i, o, e in zip(self.args, self.results, self.errors):
yield i, o, e
yield from zip(self.args, self.results, self.errors)

@property
def ncalls(self):
Expand Down

0 comments on commit ceea353

Please sign in to comment.