File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 1111def _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
4345class Probe :
You can’t perform that action at this time.
0 commit comments