Skip to content

Commit

Permalink
Use _ for unused loop controll index
Browse files Browse the repository at this point in the history
  • Loading branch information
larsevj committed Aug 29, 2024
1 parent edb14ca commit 3e6dd7b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion python/resdata/grid/faults/fault_segments.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def pop_next(self, segment):

def print_content(self):
for d in self.__segment_map.values():
for _C, S in d.iteritems():
for _, S in d.iteritems():
print(S)


Expand Down
6 changes: 3 additions & 3 deletions python/tests/geometry_tests/test_surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ def test_create_new(self):

self.assertNotEqual(s, small)
idx = 0
for _i in range(nx):
for _j in range(ny):
for _ in range(nx):
for _ in range(ny):
s[idx] = small[idx]
idx += 1
self.assertEqual(s, small)
Expand Down Expand Up @@ -164,7 +164,7 @@ def test_ops(self):
def test_ops2(self):
s0 = Surface(self.surface_small)
surface_list = []
for _i in range(10):
for _ in range(10):
s = s0.copy()
for j in range(len(s)):
s[j] = random.random()
Expand Down
2 changes: 1 addition & 1 deletion python/tests/rd_tests/test_faults.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ def test_iter(self):
faults = FaultCollection(self.grid, self.faults1, self.faults2)
self.assertEqual(7, len(faults))
c = 0
for _f in faults:
for _ in faults:
c += 1
self.assertEqual(c, len(faults))

Expand Down
2 changes: 1 addition & 1 deletion python/tests/util_tests/test_thread_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def test_pool_unbound_fail(self):
def test_fill_pool(self):
pool = ThreadPool(4)

for _index in range(10):
for _ in range(10):
pool.addTask(self.sleepTask, 2)

pool.nonBlockingStart()
Expand Down

0 comments on commit 3e6dd7b

Please sign in to comment.