Skip to content

Commit 16184bc

Browse files
committed
Rewrite a loop as list comprehension
1 parent 603ab45 commit 16184bc

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

stagpy/plates.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ def detect_plates_vzcheck(step, vz_thres_ratio=0):
3737
dvphi = np.diff(vphi_surf) / (r_c[-1] * dphi)
3838
dvx_thres = 16 * step.timeinfo.loc['vrms']
3939

40-
limits = []
41-
for phi in range(0, nphi):
42-
mark = all(abs(dvphi[i % nphi]) <= abs(dvphi[phi])
43-
for i in range(phi - nphi // 33, phi + nphi // 33))
44-
if mark and abs(dvphi[phi]) >= dvx_thres:
45-
limits.append(phi)
40+
limits = [
41+
phi for phi in range(nphi)
42+
if (abs(dvphi[phi]) >= dvx_thres and
43+
all(abs(dvphi[i % nphi]) <= abs(dvphi[phi])
44+
for i in range(phi - nphi // 33, phi + nphi // 33)))
45+
]
4646

4747
# verifying vertical velocity
4848
vz_thres = 0

0 commit comments

Comments
 (0)