napari_track_edit.data_views.lazy_array_wrapper =============================================== .. py:module:: napari_track_edit.data_views.lazy_array_wrapper Classes ------- .. autoapisummary:: napari_track_edit.data_views.lazy_array_wrapper.LazyArrayWrapper Functions --------- .. autoapisummary:: napari_track_edit.data_views.lazy_array_wrapper._is_fancy_index Module Contents --------------- .. py:function:: _is_fancy_index(index) Return True if index is a fancy index (tuple containing array-likes). .. py:class:: LazyArrayWrapper(data) Wrapper around lazy/read-only arrays that materializes fancy indexing. Lazy array backends like tracksdata's GraphArrayView return view objects from __getitem__ rather than numpy values. This breaks napari code that does fancy indexing (e.g. ``data[tuple_of_arrays] == value``). This wrapper intercepts fancy indexing and materializes one first-dimension slice at a time, returning numpy values. All other indexing patterns and attribute access are delegated to the underlying array. The wrapper intentionally does not implement __setitem__, preserving the read-only nature of the underlying array for detection via ``hasattr(data, "__setitem__")``. .. py:attribute:: _data .. py:property:: wrapped The underlying array object. .. py:property:: shape .. py:property:: dtype .. py:property:: ndim .. py:property:: size .. py:method:: __len__() .. py:method:: __array__(dtype=None, copy=None) .. py:method:: __getitem__(index) .. py:method:: _materialize_fancy(index) Materialize fancy indexing by reading individual coordinates. Each coordinate tuple is looked up via scalar indexing on the underlying array, which is fast when the array has an internal cache (e.g. GraphArrayView's NDChunkCache). .. py:method:: __getattr__(name) .. py:method:: __repr__()