+
    nDjJ                       ^ RI Ht ^ RIt^ RIHtHt ^ RIHtHtH	t	H
t
Ht ^ RIt^ RIHt ^ RIt^ RIHtHt ^ RIHt ^RIHt ]	! R4      t ! R	 R
4      t] ! R R]4      4       t] ! R R]4      4       t] ! R R]4      4       t ! R R]],          4      t ! R R4      t ! R R]],          4      t  ! R R]4      t! ! R R]4      t"]! RR7      R R l4       t#R# )    )annotationsN)IterableIterator)GenericProtocolTypeVaroverloadruntime_checkable)definefields)ComponentDescriptor)catch_and_log_exceptionsTc                  N    ] tR t^tRtR R ltR R ltR R ltRR	 R
 lltRt	R# )DescribedComponentBatchz
A `ComponentBatchLike` object with its associated `ComponentDescriptor`.

Used by implementers of `AsComponents` to both efficiently expose their component data
and assign the right tags given the surrounding context.
c               $    V ^8  d   QhRRRRRR/# )   batchComponentBatchLike
descriptorr   returnNone )formats   "V/data/cameron/venvs/s3viz/lib/python3.14/site-packages/rerun_sdk/rerun/_baseclasses.py__annotate__$DescribedComponentBatch.__annotate__   s$     & &0 &>Q &VZ &    c                	    Wn         W n        R # N_batch_descriptor)selfr   r   s   &&&r   __init__ DescribedComponentBatch.__init__   s    %r   c                   V ^8  d   QhRR/# r   r   r   r   )r   s   "r   r   r      s        &9  r   c                    V P                   # )z1Returns the complete descriptor of the component.)r#   r$   s   &r   component_descriptor,DescribedComponentBatch.component_descriptor   s    r   c                   V ^8  d   QhRR/# r   r   pa.Arrayr   )r   s   "r   r   r   #   s     , , ,r   c                6    V P                   P                  4       # )zq
Returns a `pyarrow.Array` of the component data.

Part of the [`rerun.ComponentBatchLike`][] logging interface.
)r"   as_arrow_arrayr*   s   &r   r1   &DescribedComponentBatch.as_arrow_array#   s     {{))++r   Nc                    V ^8  d   QhRRRR/# r   lengthsnpt.ArrayLike | Noner   ComponentColumnr   )r   s   "r   r   r   +   s     H H!5 H Hr   c                0    \        V P                  WR7      # a_  
Partitions the component batch into multiple sub-batches, forming a column.

This makes it possible to use `rr.send_columns` to send columnar data directly into Rerun.

The returned columns will be partitioned into unit-length sub-batches by default.
Use `ComponentColumn.partition` to repartition the data as needed.

Parameters
----------
lengths:
    The offsets to partition the component at.
    If specified, `lengths` must sum to the total length of the component batch.
    If left unspecified, it will default to unit-length batches.

Returns
-------
The partitioned component batch as a column.

r5   )r7   r#   r$   r5   s   &&r   	partition!DescribedComponentBatch.partition+   s    * t//GGr   r!   r    )
__name__
__module____qualname____firstlineno____doc__r%   r+   r1   r<   __static_attributes__r   r   r   r   r      s"    & ,H Hr   r   c                  &    ] tR t^CtRtR R ltRtR# )r   zSDescribes interface for objects that can be converted to batch of rerun Components.c                   V ^8  d   QhRR/# r.   r   )r   s   "r   r   ComponentBatchLike.__annotate__G   s       r   c                    R# )z0Returns a `pyarrow.Array` of the component data.Nr   r*   s   &r   r1   !ComponentBatchLike.as_arrow_arrayG   s    r   r   N)r>   r?   r@   rA   rB   r1   rC   r   r   r   r   r   C   s    ] r   r   c                  &    ] tR t^LtRtR R ltRtR# )AsComponentszIDescribes interface for interpreting an object as a bundle of Components.c                   V ^8  d   QhRR/# r   r   zlist[DescribedComponentBatch]r   )r   s   "r   r   AsComponents.__annotate__P   s      &C r   c                    R# )z
Returns an iterable of `ComponentBatchLike` objects.

Each object in the iterable must adhere to the `ComponentBatchLike` interface.
Nr   r*   s   &r   as_component_batches!AsComponents.as_component_batchesP   s     	r   r   N)r>   r?   r@   rA   rB   rO   rC   r   r   r   rJ   rJ   L   s    S r   rJ   c                  b    ] tR t^YtRtR R lt]R R l4       t]R R l4       tR R	 lt	]t
R
tR# )	ArchetypezBase class for all archetypes.c                   V ^8  d   QhRR/# r   r   strr   )r   s   "r   r   Archetype.__annotate__]   s     * * *r   c                	   a aa ^ RI Ho \        S 4      oR VVV 3R llpRP                  V! 4       4      pV'       d   RSP                   RV R2# RSP                   R2# )	r   )pformatc                   V ^8  d   QhRR/# )r   r   zIterable[str]r   )r   s   "r   r   'Archetype.__str__.<locals>.__annotate__b   s     	: 	:] 	:r   c               3  J  <"   \        S4       F  p R V P                  9   g   K  \        SV P                  4      pVf   K2  \        VRR4      pVf   RpM4\        P
                  ! RRS! V! 4       P                  4       R^R7      4      pRV P                   R	V 2x  K  	  R# 5i)
	componentNr1   z	<unknown>z\[\s+\[z[[T)compactindentz  =)r   metadatagetattrnameresub	to_pylist)fldcompr1   comp_contentsclsrX   r$   s       r   fields_repr&Archetype.__str__.<locals>.fields_reprb   s     c{#,,."42D| %,T3CT%JN%-(3 )+&gn6F6P6P6R\`ij.k) sxxj-99# #s   B#A>B#z,
zrr.z(
z
)z())pprintrX   typejoinr>   )r$   rj   argsri   rX   s   f  @@r   __str__Archetype.__str__]   sZ    "4j	: 	:( zz+-(c$s33b))r   c                   V ^8  d   QhRR/# rT   r   )r   s   "r   r   rV   }   s     E E# Er   c                	    V P                   P                  R 4      pRP                  . VP                  R^4      RR OV P                  N4      # )z
rerun_sdk..N)r?   removeprefixrn   rsplitr>   )ri   modules   & r   	archetypeArchetype.archetype|   sH     ,,\:xxC&--Q/4CcllCDDr   c                   V ^8  d   QhRR/# rT   r   )r   s   "r   r   rV      s     2 2S 2r   c                	P    V P                  4       P                  R ^4      R,          # )rt   ru   )ry   rw   ri   s   &r   archetype_short_nameArchetype.archetype_short_name   s     }}%%c1-b11r   c                   V ^8  d   QhRR/# rL   r   )r   s   "r   r   rV      s      &C r   c                h   . p\        \        V 4      4       F  pRVP                  9   g   K  \        WP                  4      pVf   K1  \        V P                  4       R,           VP                  ,           VP                  V P                  4       R7      pVP                  \        W44      4       K  	  V# )zm
Return all the component batches that make up the archetype.

Part of the `AsComponents` logging interface.
r\   :)component_typery   )r   rm   r`   ra   rb   r   r~   _COMPONENT_TYPEry   appendr   )r$   batchesrf   rg   descrs   &    r   rO   Archetype.as_component_batches   s     $t*%Ccll*tXX.#/113c9CHHD'+';';"&.."2E
 NN#:4#GH & r   r   N)r>   r?   r@   rA   rB   rp   classmethodry   r~   rO   __repr__rC   r   r   r   rR   rR   Y   s@    (*> E E 2 2* Hr   rR   c                      ] tR t^t$ RtR]R&    RR R llt]R R l4       tR R	 lt	R
 R lt
]R R l4       tR R ltRtR# )	BaseBatchNzpa.DataType | None_ARROW_DATATYPEc               $    V ^8  d   QhRRRRRR/# )r   dataT | Nonestrictzbool | Noner   r   r   )r   s   "r   r   BaseBatch.__annotate__   s!     $> $>X $>{ $>d $>r   c                   Ve   \        V P                  P                  VR7      ;_uu_ 4        \        V\        P
                  4      '       d#   VP                  V P                  8X  d   Wn        M V P                  WP                  4      V n         RRR4       R# \        V P                  4      V n        R#   + '       g   i     L,; i)a  
Construct a new batch.

This method must flexibly accept native data (which comply with type `T`). Subclasses must provide a type
parameter specifying the type of the native data (this is automatically handled by the code generator).

A value of None indicates that the component should be cleared and results in the creation of an empty
array.

The actual creation of the Arrow array is delegated to the `_native_to_pa_array()` method, which is not
implemented by default.

Parameters
----------
data:
    The data to convert into an Arrow array.
strict:
    Whether to raise an exception if the data cannot be converted into an Arrow array. If None, the value
    defaults to the value of the `rerun.strict` global setting.

Returns
-------
The Arrow array encapsulating the data.

N)r   )r   	__class__r>   
isinstancepaArrayrm   r   pa_array_native_to_pa_array_empty_pa_array)r$   r   r   s   &&&r   r%   BaseBatch.__init__   s    4 )$..*A*A&QQdBHH--$))t?S?S2S$(M$($<$<TCWCW$XDM RQ ((<(<= RQs   A$B88C	c                    V ^8  d   QhRRRR/# )r   r   r   r   zBaseBatch[T] | Noner   )r   s   "r   r   r      s      h +> r   c                    Vf   R# V ! V4      # )ax  
Primary method for creating Arrow arrays for components.

The default value of None is preserved in the field to indicate that the optional field was not specified.
If any value other than None is provided, it is passed through to `__init__`.

Parameters
----------
data:
    The data to convert into an Arrow array.

Returns
-------
The Arrow array encapsulating the data.

Nr   )ri   r   s   &&r   
_converterBaseBatch._converter   s    $ <t9r   c                    V ^8  d   QhRRRR/# )r   otherobjectr   boolr   )r   s   "r   r   r      s     / /F /t /r   c                	l    \        V\        4      '       g   \        # V P                  VP                  8H  # r    )r   r   NotImplementedr   )r$   r   s   &&r   __eq__BaseBatch.__eq__   s(    %++!!}}..r   c                   V ^8  d   QhRR/# r   r   intr   )r   s   "r   r   r           " " "r   c                	,    \        V P                  4      # r    )lenr   r*   s   &r   __len__BaseBatch.__len__       4==!!r   c               $    V ^8  d   QhRRRRRR/# )r   r   r   	data_typepa.DataTyper   r/   r   )r   s   "r   r   r      s!     " "! " " "r   c                    \         h)a-  
Converts native data into an Arrow array.

Subclasses must provide an implementation of this method (via an override) if they are to be used as either
an archetype's field (which should be the case for all components), or a (delegating) component's field (for
datatypes). Datatypes which are used only within other datatypes may omit implementing this method, provided
that the top-level datatype implements it.

A hand-coded override must be provided for the code generator to implement this method. The override must be
named `native_to_pa_array_override()` and exist as a static member of the `<TYPE>Ext` class located in
`<type>_ext.py`.

`ColorExt.native_to_pa_array_override()` in `color_ext.py` is a good example of how to implement this method, in
conjunction with the native type's converter (see `rgba__field_converter_override()`, used to construct the
native `Color` object).

Parameters
----------
data:
    The data to convert into an Arrow array.
data_type:
    The Arrow data type of the data.

Returns
-------
The Arrow array encapsulating the data.

)NotImplementedError)r   r   s   &&r   r   BaseBatch._native_to_pa_array   s
    < "!r   c                   V ^8  d   QhRR/# r.   r   )r   s   "r   r   r     s       r   c                    V P                   # za
The component as an arrow batch.

Part of the [`rerun.ComponentBatchLike`][] logging interface.
r   r*   s   &r   r1   BaseBatch.as_arrow_array  s     }}r   r   r    )r>   r?   r@   rA   r   __annotations__r%   r   r   r   r   staticmethodr   r1   rC   r   r   r   r   r      sR    *.O'.)$>L  ,/
" " "> r   r   c                      ] tR tRtRt]R R l4       t]R R l4       t]R R l4       t]R	R
/R R ll4       tR	R
RR
/R R lltR R ltR R ltR R lt	Rt
R
# )r7   i  a.  
A column of components that can be sent using `send_columns`.

This is represented by a ComponentBatch array that has been partitioned into multiple segments.
This is useful for reinterpreting a single contiguous batch as multiple sub-batches
to use with the [`send_columns`][rerun.send_columns] API.
c               $    V ^8  d   QhRRRRRR/# )r   r   str | ComponentDescriptorcomponent_batchr   r   r   r   )r   s   "r   r   ComponentColumn.__annotate__  s(      - , 
	r   c                	    R # r    r   )r$   r   r   s   &&&r   r%   ComponentColumn.__init__  s    
 r   c               (    V ^8  d   QhRRRRRRRR/# )	r   r   r   r   r   r5   npt.ArrayLiker   r   r   )r   s   "r   r   r   "  s2      - ,
  
r   c               	    R # r    r   r$   r   r   r5   s   &&&$r   r%   r   !       r   c               (    V ^8  d   QhRRRRRRRR/# )	r   r   r   r   r   offsetsznpt.NDArray[np.int32]r   r   r   )r   s   "r   r   r   +  s2      - ,
 ' 
r   c               	    R # r    r   )r$   r   r   r   s   &&&$r   r%   r   *  r   r   r5   Nc               (    V ^8  d   QhRRRRRRRR/# )	r   r   r   r   r   r5   r6   r   r   r   )r   s   "r   r   r   4  s2      - ,
 & 
r   c               	    R # r    r   r   s   &&&$r   r%   r   3  r   r   r   c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r   r   r   r   r   r5   r6   r   znpt.NDArray[np.int32] | Noner   r   r   )r   s   "r   r   r   <  s<     5= 5=-5= ,5=
 &5= .5= 
5=r   c                  \        V\        4      '       d   \        V4      pM\        V\        4      '       d   TpVe   Ve   \        R4      hWn        W n        Ve	   W@n        R# Ve   \        P                  ! V4      pVP                  ^8w  d   \        R4      hVP                  4       P                  \        P                  4      p\        P                  ! \        P                  ! ^ .\        P                  R7      \        P                  ! V\        P                  R7      34      V n        R# \        VP!                  4       4      p\        P"                  ! V^,           \        P                  R7      V n        R# )a  
Construct a new component column.

This makes it possible to use `rr.send_columns` to send columnar data directly into Rerun.

The returned column will be partitioned into unit-length sub-batches by default.
Use `ComponentColumn.partition` to repartition the data as needed.

Parameters
----------
descriptor:
    The component descriptor for this component batch.
component_batch:
    The component batch to partition into a column.
lengths:
    The lengths of each partition. Must sum to the total length of the component batch.
    If left unspecified, it will default to unit-length batches.
    Mutually exclusive with `offsets`.
offsets:
    Pre-computed int32 offsets array (including the leading 0).
    Mutually exclusive with `lengths`.

Nz,Cannot specify both `lengths` and `offsets`.zLengths must be a 1D array.)dtype)r   rU   r   
ValueErrorr   r   _offsetsnparrayndimflattenastypeint32concatenatecumsumr   r1   arange)r$   r   r   r5   r   ns   &&&$$ r   r%   r   <  s
   > j#&&,Z8J
$788#J7#6KLL$.#M hhw'G||q  !>??oo'..rxx8GNNBHHaS,I299U\dfdldlKm+noDM O2245AIIa!e288<DMr   c                   V ^8  d   QhRR/# r(   r   )r   s   "r   r   r   s  s      &9 r   c                    V P                   # )zr
Returns the complete descriptor of the component.

Part of the [`rerun.ComponentBatchLike`][] logging interface.
)r   r*   s   &r   r+   $ComponentColumn.component_descriptors  s     r   c                   V ^8  d   QhRR/# r.   r   )r   s   "r   r   r   {  s     > > >r   c                    V P                   P                  4       p\        P                  P	                  V P
                  V4      # r   )r   r1   r   	ListArrayfrom_arraysr   )r$   r   s   & r   r1   ComponentColumn.as_arrow_array{  s3     $$335||''u==r   c                    V ^8  d   QhRRRR/# )r   r5   r   r   r7   r   )r   s   "r   r   r     s     W W W? Wr   c                F    \        V P                  V P                  VR7      # )a  
(Re)Partitions the column.

This makes it possible to use `rr.send_columns` to send columnar data directly into Rerun.

The returned columns will be partitioned into unit-length sub-batches by default.
Use `ComponentColumn.partition` to repartition the data as needed.

Parameters
----------
lengths:
    The offsets to partition the component at.

Returns
-------
The (re)partitioned column.

r:   )r7   r   r   r;   s   &&r   r<   ComponentColumn.partition  s    & t0D0DgVVr   )r   r   r   )r>   r?   r@   rA   rB   r	   r%   r+   r1   r<   rC   r   r   r   r7   r7     s           
 )- 5=
 )-5= 155=n>W Wr   r7   c                  J    ] tR tRtRtR R ltR R ltR R ltR	 R
 ltRt	R# )ComponentColumnListi  zu
A collection of [`ComponentColumn`][rerun.ComponentColumn]s.

Useful to partition and log multiple columns at once.
c                    V ^8  d   QhRRRR/# )r   columnszIterable[ComponentColumn]r   r   r   )r   s   "r   r    ComponentColumnList.__annotate__  s     & & 9 &d &r   c                	&    \        V4      V n        R # r    )list_columns)r$   r   s   &&r   r%   ComponentColumnList.__init__  s    Wr   c                   V ^8  d   QhRR/# )r   r   zIterator[ComponentColumn]r   )r   s   "r   r   r     s     # #3 #r   c                	,    \        V P                  4      # r    )iterr   r*   s   &r   __iter__ComponentColumnList.__iter__  s    DMM""r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r     r   r   c                	,    \        V P                  4      # r    )r   r   r*   s   &r   r   ComponentColumnList.__len__  r   r   c                    V ^8  d   QhRRRR/# )r   r5   r   r   r   r   )r   s   "r   r   r     s     V V V3F Vr   c                r    \        V P                   Uu. uF  q"P                  V4      NK  	  up4      # u upi )a/  
(Re)Partitions the columns.

This makes it possible to use `rr.send_columns` to send columnar data directly into Rerun.

The returned columns will be partitioned into unit-length sub-batches by default.
Use `ComponentColumn.partition` to repartition the data as needed.

Parameters
----------
lengths:
    The offsets to partition the component at.
    If specified, `lengths` must sum to the total length of the component batch.
    If left unspecified, it will default to unit-length batches.

Returns
-------
The partitioned component batch as a column.

)r   r   r<   )r$   r5   cols   && r   r<   ComponentColumnList.partition  s,    * #dmm#TmsMM'$:m#TUU#Ts   4)r   N)
r>   r?   r@   rA   rB   r%   r   r   r<   rC   r   r   r   r   r     s"    &#"V Vr   r   c                  >    ] tR tRtR R ltR R ltR
R R lltR	tR# )ComponentBatchMixini  c                   V ^8  d   QhRR/# rT   r   )r   s   "r   r    ComponentBatchMixin.__annotate__  s     $ $ $r   c                    V P                   # zc
Returns the name of the component.

Part of the [`rerun.ComponentBatchLike`][] logging interface.
)r   r*   s   &r   r   "ComponentBatchMixin.component_type  s     ###r   c                    V ^8  d   QhRRRR/# )r   r   r   r   r   r   )r   s   "r   r   r    s     9 9$7 9<S 9r   c                    \        W4      # )z`Wraps the current `ComponentBatchLike` in a `DescribedComponentBatch` with the given descriptor.)r   )r$   r   s   &&r   	describedComponentBatchMixin.described  s    &t88r   Nc                    V ^8  d   QhRRRR/# r4   r   )r   s   "r   r   r    s     M M!5 M Mr   c                8    \        V P                  4       WR7      # r9   )r7   r   r;   s   &&r   r<   ComponentBatchMixin.partition  s    * t224dLLr   r   r    )r>   r?   r@   rA   r   r  r<   rC   r   r   r   r   r     s    $9M Mr   r   c                  R    ] tR tRtRt]R R l4       t]R R l4       tR R ltR	t	R
# )ComponentMixini  z
Makes components adhere to the `ComponentBatchLike` interface.

A single component will always map to a batch of size 1.

The class using the mixin must define the `_BATCH_TYPE` field, which should be a subclass of `BaseBatch`.
c                   V ^8  d   QhRR/# )r   r   r   r   )r   s   "r   r   ComponentMixin.__annotate__  s     / /; /r   c                .    V P                   P                  # )z`
The pyarrow type of this batch.

Part of the [`rerun.ComponentBatchLike`][] logging interface.
)_BATCH_TYPEr   r}   s   &r   
arrow_typeComponentMixin.arrow_type       ...r   c                   V ^8  d   QhRR/# rT   r   )r   s   "r   r   r    s     / /s /r   c                .    V P                   P                  # r  )r  r   r}   s   &r   r   ComponentMixin.component_type  r  r   c                   V ^8  d   QhRR/# r.   r   )r   s   "r   r   r    s     9 9 9r   c                B    V P                  V .4      P                  4       # r   )r  r1   r*   s   &r   r1   ComponentMixin.as_arrow_array  s      '6688r   r   N)
r>   r?   r@   rA   rB   r   r  r   r1   rC   r   r   r   r  r    s9     / / / /9 9r   r  zcreating empty array)contextc                    V ^8  d   QhRRRR/# )r   rm   r   r   r/   r   )r   s   "r   r   r     s     ## ##+ ##( ##r   c                   V \         P                  ! 4       8X  d   \         P                  ! ^ 4      # \        V \         P                  4      '       d%   V P                  \        V P                  4      4      # \        V \         P                  4      '       Ed]   V P                  R8X  d   \         P                  P                  T ^ R\         P                  ! . \         P                  ! 4       R7      P                  4       ^,          \         P                  ! . \         P                  ! 4       R7      P                  4       ^,          .V  Uu. uF  p\        VP                   4      NK  	  upR7      # \         P                  P                  T ^ R\         P                  ! . \         P                  ! 4       R7      P                  4       ^,          .V  Uu. uF  p\        VP                   4      NK  	  upR7      # \        V \         P"                  4      '       dN   \         P$                  P'                  V  Uu. uF  p\        VP                   4      NK  	  up\)        V 4      R7      # \         P                  ! . V R7      # u upi u upi u upi )r   denseN)rm   )rm   lengthbufferschildren)r   )r   nullnullsr   ExtensionType
wrap_arrayr   storage_type	UnionTypemode
UnionArrayfrom_buffersr   int8r   r   rm   
StructTypeStructArrayr   r   )rm   
field_types   & r   r   r     s   rwwyxx{$(())t/@/@ABB $%%99==--HHRbggi088:1=HHRbhhj199;A>
 NRRTz/*//:TR . 	 	 ==--HHRbggi088:1= NRRTz/*//:TR .   $&&~~))^b*c^bPZ?:??+K^b*clpqulv)ww88BT""# S S
 +ds   I7I</J)$
__future__r   rc   collections.abcr   r   typingr   r   r   r	   r
   numpyr   numpy.typingnptpyarrowr   attrsr   r   rerun_bindingsr   error_utilsr   r   r   r   rJ   rR   r   r7   r   r   r  r   r   r   r   <module>r9     s    " 	 . J J      . 1CL-H -H`    	8 	 	 B B BJo
 odFW FWR%V(?3 %VP"M, "MJ!9' !9H "89## :##r   