sgio.check_duplicate_ids#

sgio.check_duplicate_ids(ids: List[int] | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], id_type: str = 'ID') List[int]#

Check for duplicate IDs in a list.

Parameters:
  • ids (list of int or array-like) – List or array of IDs to check for duplicates.

  • id_type (str, default 'ID') – Type of ID being checked (e.g., ‘Node’, ‘Element’) for error messages.

Returns:

List of duplicate IDs found (empty if no duplicates).

Return type:

list of int

Examples

>>> check_duplicate_ids([1, 2, 3, 2, 4])
[2]
>>> check_duplicate_ids([1, 2, 3, 4, 5])
[]