+
    LV-ja  ã                   ó@   € ^ RI t^ RItRR.t]! RR7      tRR ltR tR# )	é    NÚsave_npzÚload_npzF)Úallow_picklec                óF  € / pVP                   R9   d)   VP                  VP                  VP                  R7       M°VP                   R8X  d   VP                  VP                  R7       M‚VP                   R8X  dW   VP
                  ^8X  d)   VP                  VP                  VP                  R7       M8VP                  VP                  R7       MRVP                    R2p\        V4      hVP                  VP                   P                  R	4      VP                  VP                  R
7       \        V\        P                  P                   4      '       d   VP                  RR7       V'       d   \"        P$                  ! V 3/ VB  R# \"        P&                  ! V 3/ VB  R# )aÑ  Save a sparse matrix or array to a file using ``.npz`` format.

Parameters
----------
file : str or file-like object
    Either the file name (string) or an open file (file-like object)
    where the data will be saved. If file is a string, the ``.npz``
    extension will be appended to the file name if it is not already
    there.
matrix: spmatrix or sparray
    The sparse matrix or array to save.
    Supported formats: ``csc``, ``csr``, ``bsr``, ``dia`` or ``coo``.
compressed : bool, optional
    Allow compressing the file. Default: True

See Also
--------
scipy.sparse.load_npz: Load a sparse matrix from a file using ``.npz`` format.
numpy.savez: Save several arrays into a ``.npz`` archive.
numpy.savez_compressed : Save several arrays into a compressed ``.npz`` archive.

Examples
--------
Store sparse matrix to disk, and load it again:

>>> import numpy as np
>>> import scipy as sp
>>> sparse_matrix = sp.sparse.csc_matrix([[0, 0, 3], [4, 0, 0]])
>>> sparse_matrix
<Compressed Sparse Column sparse matrix of dtype 'int64'
    with 2 stored elements and shape (2, 3)>
>>> sparse_matrix.toarray()
array([[0, 0, 3],
       [4, 0, 0]], dtype=int64)

>>> sp.sparse.save_npz('/tmp/sparse_matrix.npz', sparse_matrix)
>>> sparse_matrix = sp.sparse.load_npz('/tmp/sparse_matrix.npz')

>>> sparse_matrix
<Compressed Sparse Column sparse matrix of dtype 'int64'
    with 2 stored elements and shape (2, 3)>
>>> sparse_matrix.toarray()
array([[0, 0, 3],
       [4, 0, 0]], dtype=int64)
)ÚindicesÚindptrÚdia)ÚoffsetsÚcoo)ÚrowÚcol)Úcoordsz4Save is not implemented for sparse matrix of format Ú.Úascii)ÚformatÚshapeÚdataT)Ú	_is_arrayN©ÚcscÚcsrÚbsr)r   Úupdater   r   r
   Úndimr   r   r   ÚNotImplementedErrorÚencoder   r   Ú
isinstanceÚspÚsparseÚsparrayÚnpÚsavez_compressedÚsavez)ÚfileÚmatrixÚ
compressedÚarrays_dictÚmsgs   &&&  Úh/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/scipy/sparse/_matrix_io.pyr   r      s=  € ð\ €KØ‡}�}Ð-Ô-Ø×Ñ 6§>¡>¸&¿-¹-ÐÕHØ	�‰˜%Ô	Ø×Ñ 6§>¡>ÐÕ2Ø	�‰˜%Ô	Ø�;‰;˜!Ôà×Ñ 6§:¡:°6·:±:ÐÕ>à×Ñ f§m¡mÐÕ4àDÀVÇ]Á]ÀOÐSTÐUˆÜ! #Ó&Ð&Ø×ÑØ�}‰}×#Ñ# GÓ,Ø�l‰lØ�[‰[ð ô ô
 �&œ"Ÿ)™)×+Ñ+×,Ò,Ø×Ñ TÐÔ*ßÜ
×Ò˜DÑ0 KÔ0ä
�Š�Ñ%˜Ô%ó    c                óÊ  € \         P                  ! V 3/ \        B ;_uu_ 4       pVP                  R4      pVf   \	        RV  R24      hVP                  4       p\        V\        4      '       g   VP                  R4      pVP                  R4      '       d   VR,           pM	VR,           p \        \        P                  V 4      pTR9   d4   T! TR,          TR,          TR,          3TR,          R7      uuRRR4       # TR8X  d,   T! TR,          TR,          3TR,          R7      uuRRR4       # TR8X  dg   RT9   d,   T! TR,          TR,          3TR,          R7      uuRRR4       # T! TR,          TR,          TR,          33TR,          R7      uuRRR4       # \        RT R24      h  \         d   p\	        R	T R
24      ThRp?ii ; i  + '       g   i     R# ; i)a7  Load a sparse array/matrix from a file using ``.npz`` format.

Parameters
----------
file : str or file-like object
    Either the file name (string) or an open file (file-like object)
    where the data will be loaded.

Returns
-------
result : csc_array, csr_array, bsr_array, dia_array or coo_array
    A sparse array/matrix containing the loaded data.

Raises
------
OSError
    If the input file does not exist or cannot be read.

See Also
--------
scipy.sparse.save_npz: Save a sparse array/matrix to a file using ``.npz`` format.
numpy.load: Load several arrays from a ``.npz`` archive.

Examples
--------
Store sparse array/matrix to disk, and load it again:

>>> import numpy as np
>>> import scipy as sp
>>> sparse_array = sp.sparse.csc_array([[0, 0, 3], [4, 0, 0]])
>>> sparse_array
<Compressed Sparse Column sparse array of dtype 'int64'
    with 2 stored elements and shape (2, 3)>
>>> sparse_array.toarray()
array([[0, 0, 3],
       [4, 0, 0]], dtype=int64)

>>> sp.sparse.save_npz('/tmp/sparse_array.npz', sparse_array)
>>> sparse_array = sp.sparse.load_npz('/tmp/sparse_array.npz')

>>> sparse_array
<Compressed Sparse Column sparse array of dtype 'int64'
    with 2 stored elements and shape (2, 3)>
>>> sparse_array.toarray()
array([[0, 0, 3],
       [4, 0, 0]], dtype=int64)

In this example we force the result to be csr_array from csr_matrix
>>> sparse_matrix = sp.sparse.csc_matrix([[0, 0, 3], [4, 0, 0]])
>>> sp.sparse.save_npz('/tmp/sparse_matrix.npz', sparse_matrix)
>>> tmp = sp.sparse.load_npz('/tmp/sparse_matrix.npz')
>>> sparse_array = sp.sparse.csr_array(tmp)
r   Nz	The file z+ does not contain a sparse array or matrix.r   r   Ú_arrayÚ_matrixzUnknown format "Ú"r   r   r   r   )r   r	   r
   r   r   r   r   z4Load is not implemented for sparse matrix of format r   r   )r!   ÚloadÚPICKLE_KWARGSÚgetÚ
ValueErrorÚitemr   ÚstrÚdecodeÚgetattrr   r   ÚAttributeErrorr   )r$   ÚloadedÚsparse_formatÚsparse_typeÚclsÚes   &     r)   r   r   T   sÞ  € ôl 
�Š�Ñ	'œ×	'Ò	'¨6ØŸ
™
 8Ó,ˆØÒ Ü˜y¨¨ð /9ð :ó ;ð ;à%×*Ñ*Ó,ˆä˜-¬×-Ò-ð *×0Ñ0°Ó9ˆMà�:‰:�k×"Ò"Ø'¨(Õ2‰Kà'¨)Õ3ˆKð	GÜœ"Ÿ)™)¨ }Ó6ˆCð Ð1Ô1Ù˜˜v�¨¨yÕ(9¸6À(Õ;KÐLØ# G�_ô.÷/ 
(Ò	'ð2 ˜eÔ#Ù˜˜v�¨¨yÕ(9Ð:À&ÈÅ/ÔR÷5 
(Ò	'ð6 ˜eÔ#Ø˜6Ô!Ù˜F 6�N¨F°8Õ,<Ð=ÀVÈGÅ_ÔU÷; 
(Ò	'ñ< ˜˜v�¨°­¸¸u½Ð(FÐGØ# G�_ô.÷= 
(Ò	'ôB &ð )AØANÀÈqð'Ró Sð Søô ô 	GÜÐ/°¨}¸AÐ>Ó?ÀQÐFûð	Gú÷' 
(×	'Ð	'úsN   ¤A2GÂGÂ+F.Ã/GÄ 'GÄ2.GÅ+)GÆGÆ.GÆ9G	Ç	GÇGÇG"	)T)	Únumpyr!   Úscipyr   Ú__all__Údictr0   r   r   © r*   r)   Ú<module>rB      s/   ðÛ Û à�zÐ
"€ñ  %Ô(€ôF&ôRXSr*   