diff --git a/src/ansys/dpf/composites/_indexer.py b/src/ansys/dpf/composites/_indexer.py index 0bf4216fc..1e1c9957a 100644 --- a/src/ansys/dpf/composites/_indexer.py +++ b/src/ansys/dpf/composites/_indexer.py @@ -64,7 +64,7 @@ def by_id_as_array(self, entity_id: int) -> Optional[NDArray[np.int64]]: def _has_data_pointer(field: PropertyField | Field) -> bool: if ( - field._data_pointer is not None + field._data_pointer is not None # pylint: disable=protected-access and field._data_pointer.any() # pylint: disable=protected-access ): return True @@ -392,7 +392,7 @@ def by_id(self, entity_id: int) -> Optional[np.double]: if values is None or len(values) == 0: return None if len(values) == 1: - return values[0] + return cast(np.double, values[0]) raise RuntimeError("FieldIndexerWithDataPointer: by_id cannot be used for a list of data.")