Skip to content

Commit f07c39a

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/assertion_for_unique_positions' into assertion_for_unique_positions
2 parents 05f2071 + e9d89fc commit f07c39a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/probeinterface/probe.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
def _raise_non_unique_positions_error(positions):
1212
"""
1313
Check for duplicate positions and raise ValueError with detailed information.
14-
14+
1515
Parameters
1616
----------
1717
positions : array
1818
Array of positions to check for duplicates.
19-
19+
2020
Raises
2121
------
2222
ValueError
@@ -29,15 +29,17 @@ def _raise_non_unique_positions_error(positions):
2929
duplicates[pos_key].append(index)
3030
else:
3131
duplicates[pos_key] = [index]
32-
32+
3333
duplicate_groups = {pos: indices for pos, indices in duplicates.items() if len(indices) > 1}
3434
duplicate_info = []
3535
for pos, indices in duplicate_groups.items():
3636
pos_str = f"({', '.join(map(str, pos))})"
3737
indices_str = f"[{', '.join(map(str, indices))}]"
3838
duplicate_info.append(f"Position {pos_str} appears at indices {indices_str}")
39-
40-
raise ValueError(f"Contact positions must be unique within a probe. Found {len(duplicate_groups)} duplicate(s): {'; '.join(duplicate_info)}")
39+
40+
raise ValueError(
41+
f"Contact positions must be unique within a probe. Found {len(duplicate_groups)} duplicate(s): {'; '.join(duplicate_info)}"
42+
)
4143

4244

4345
class Probe:

0 commit comments

Comments
 (0)