Skip to content

Commit 0d2f439

Browse files
alexfiklinducer
authored andcommitted
ruff: fix B905 strict zip errors
1 parent fa19013 commit 0d2f439

File tree

6 files changed

+12
-7
lines changed

6 files changed

+12
-7
lines changed

examples/airfoil3d.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ def main():
2222
for x, r in zip(
2323
numpy.linspace(-wing_length, 0, wing_subdiv, endpoint=False),
2424
numpy.linspace(0.8, 1, wing_subdiv, endpoint=False),
25+
strict=True
2526
)
2627
]
2728
+ [(1, 0)]
@@ -30,6 +31,7 @@ def main():
3031
for x, r in zip(
3132
numpy.linspace(wing_length, 0, wing_subdiv, endpoint=False),
3233
numpy.linspace(0.8, 1, wing_subdiv, endpoint=False),
34+
strict=True
3335
)
3436
][::-1]
3537
+ [(0.7, wing_length * 1.05), (0, wing_length * 1.05)]

examples/test_tri_quadratic.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212

1313
def loop(a, b):
1414
return list(
15-
zip(list(range(a, b)), islice(cycle(list(range(a, b))), 1, None))
15+
zip(list(range(a, b)), islice(cycle(list(range(a, b))), 1, None),
16+
strict=True)
1617
)
1718

1819

meshpy/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def __str__(self):
1212

1313
lines = [
1414
" ".join([cell.ljust(col_width)
15-
for cell, col_width in zip(row, col_widths)])
15+
for cell, col_width in zip(row, col_widths, strict=True)])
1616
for row in self.Rows]
1717
return "\n".join(lines)
1818

meshpy/geometry.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ def round_trip_connect(seq):
289289
x = r*np.cos(phi) + cx
290290
y = r*np.sin(phi) + cy
291291

292-
return ([np.array(pt) for pt in zip(x, y)],
292+
return ([np.array(pt) for pt in zip(x, y, strict=True)],
293293
round_trip_connect(list(range(subdivisions))),
294294
None,
295295
subdivisions*[marker])
@@ -490,7 +490,8 @@ def connect_ring(ring1_idx, ring2_idx, marker):
490490
pairs1 = pair_with_successor(ring1)
491491
pairs2 = pair_with_successor(ring2)
492492
add_polygons(
493-
[(a, b, c, d) for ((a, b), (d, c)) in zip(pairs1, pairs2)],
493+
[(a, b, c, d)
494+
for ((a, b), (d, c)) in zip(pairs1, pairs2, strict=True)],
494495
marker=marker)
495496

496497
points = []

meshpy/ply.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def parse_line(parsers, line):
7979
return result
8080

8181
for name, line_count, props in data_queue:
82-
prop_names, parsers = list(zip(*props))
82+
prop_names, parsers = list(zip(*props, strict=True))
8383
result[name] = DataBlock(
8484
properties=prop_names,
8585
data=[parse_line(parsers, ln) for ln in lines[i:i+line_count]])

meshpy/triangle.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def subdivide_facets(subdivisions, points, facets, facet_markers=None):
8484
def intermediate_points(pa, pb, n):
8585
for i in range(1, n):
8686
tau = i/n
87-
yield [pai*(1-tau) + tau*pbi for pai, pbi in zip(pa, pb)]
87+
yield [pai*(1-tau) + tau*pbi for pai, pbi in zip(pa, pb, strict=True)]
8888

8989
if isinstance(subdivisions, int):
9090
from itertools import repeat
@@ -100,7 +100,8 @@ def intermediate_points(pa, pb, n):
100100
assert len(facets) == len(facet_markers)
101101
new_facet_markers = []
102102

103-
for facet_idx, ((pidx_a, pidx_b), subdiv) in enumerate(zip(facets, subdiv_it)):
103+
for facet_idx, ((pidx_a, pidx_b), subdiv) in enumerate(
104+
zip(facets, subdiv_it, strict=True)):
104105
facet_points = [pidx_a]
105106
for p in intermediate_points(points[pidx_a], points[pidx_b], subdiv):
106107
facet_points.append(len(new_points))

0 commit comments

Comments
 (0)