+
    �°³j�(  ã                   óÂ   € ^ RI t ^ RIt^ RIHt ] P
                  ! R4      t] P
                  ! R4      t ! R R4      t] P                  P                  RR	4      R 4       tR# )
é    N)Úgraphs_equalÚnumpyÚscipyc                   ó˜   a € ] tR t^
t o R tR tR tR tR tR t	R t
R tR	 tR
 tR tR tR tR tR tR tR tR tR tR tRtV tR# )ÚTestConvertScipyc                ó8  € \         P                  ! ^
^4      V n        \         P                  ! ^
\         P                  R7      V n        V P                  \         P                  ! 4       4      V n        V P                  \         P                  ! 4       4      V n	        R# )é
   ©Úcreate_usingN)
ÚnxÚbarbell_graphÚG1Úcycle_graphÚDiGraphÚG2Úcreate_weightedÚGraphÚG3ÚG4©Úselfs   &Úb/home/luca/screen-checking/.venv/lib/python3.14/site-packages/networkx/tests/test_convert_scipy.pyÚsetup_methodÚTestConvertScipy.setup_method   s\   € Ü×"Ò" 2 qÓ)ˆŒÜ—.’. ´"·*±*Ô=ˆŒà×&Ñ&¤r§x¢x£zÓ2ˆŒØ×&Ñ&¤r§z¢z£|Ó4ˆŽó    c                ó‚   €  ! R  R4      p\         P                  ! \        P                  \        P                  V4       R# )c                   ó   € ] tR t^tRtRtR# )Ú+TestConvertScipy.test_exceptions.<locals>.GN© )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__ÚformatÚ__static_attributes__r   r   r   ÚGr      s   † ØŒFr   r&   N)ÚpytestÚraisesr   ÚNetworkXErrorÚto_networkx_graph)r   r&   s   & r   Útest_exceptionsÚ TestConvertScipy.test_exceptions   s*   € ÷	ñ 	ô 	�Š”b×&Ñ&¬×(<Ñ(<¸aÖ@r   c                óB  € \         P                  ! ^4      p\        VP                  4       4      pV UUu. uF  w  rEVNK	  	  pppV UUu. uF  w  rEVNK	  	  pppV Uu. uF  qˆ^
,           NK  	  p	p\	        WgV	4      p
VP                  V
4       V# u uppi u uppi u upi )é   )r   r   ÚlistÚedgesÚzipÚadd_weighted_edges_from)r   r&   ÚgÚeÚuÚvÚsourceÚdestÚsÚweightÚexs   &&         r   r   Ú TestConvertScipy.create_weighted   s�   € Ü�NŠN˜1ÓˆÜ�—‘“‹OˆÙ !Ô"¡™˜“!¡ˆÑ"ÙÔ ™a‘d�a“™aˆÑ Ù"(Ó)¡&˜Q�b—&�&¡&ˆÐ)Ü�˜vÓ&ˆØ	×!Ñ! "Ô%Øˆùó #ùÛ ùÚ)s   µBÁ
BÁBc                óª  € \         P                  ! W#R 7      p\         P                  ! W4      '       g   Q h\         P                  ! W#R 7      p\         P                  ! W4      '       g   Q h\         P                  ! ^ V4      P                  V4      p\         P                  ! W4      '       g   Q hVP                  4       p\         P                  ! ^ V4      P                  V4      p\         P                  ! W4      '       g   Q hVP                  4       p\         P                  ! ^ V4      P                  V4      p\         P                  ! W4      '       g   Q hVP                  4       p	\         P                  ! ^ V4      P                  V	4      p\         P                  ! W4      '       g   Q hVP                  4       p
\         P                  ! ^ V4      P                  V
4      p\         P                  ! W4      '       g   Q hVP                  4       p\         P                  ! ^ V4      P                  V4      p\         P                  ! W4      '       g   Q hR# )r
   N)r   Úfrom_scipy_sparse_arrayÚis_isomorphicr*   Úempty_graphÚ	__class__ÚtocsrÚtocooÚtocscÚtodenseÚtoarray)r   r&   ÚAr   ÚGGÚGWÚGIÚACSRÚACOOÚACSCÚADÚAAs   &&&&        r   Úidentity_conversionÚ$TestConvertScipy.identity_conversion"   s³  € Ü×'Ò'¨ÔEˆÜ×Ò ×&Ò&Ð&Ð&ä×!Ò! !Ô?ˆÜ×Ò ×&Ò&Ð&Ð&ä�^Š^˜A˜|Ó,×6Ñ6°qÓ9ˆÜ×Ò ×&Ò&Ð&Ð&à�w‰w‹yˆÜ�^Š^˜A˜|Ó,×6Ñ6°tÓ<ˆÜ×Ò ×&Ò&Ð&Ð&à�w‰w‹yˆÜ�^Š^˜A˜|Ó,×6Ñ6°tÓ<ˆÜ×Ò ×&Ò&Ð&Ð&à�w‰w‹yˆÜ�^Š^˜A˜|Ó,×6Ñ6°tÓ<ˆÜ×Ò ×&Ò&Ð&Ð&à�Y‰Y‹[ˆÜ�^Š^˜A˜|Ó,×6Ñ6°rÓ:ˆÜ×Ò ×&Ò&Ð&Ð&à�Y‰Y‹[ˆÜ�^Š^˜A˜|Ó,×6Ñ6°rÓ:ˆÜ×Ò ×&Ò&Ð&Ò&r   c                ó¸   € \         P                  P                  . RO. RO.4      p\        P                  ! \
        P                  \
        P                  V4       R# )z(Conversion from non-square sparse array.N)é   é   é   )r.   é   é   )ÚspÚsparseÚ	lil_arrayr'   r(   r   r)   r>   ©r   rG   s   & r   Ú
test_shapeÚTestConvertScipy.test_shape@   s7   € ä�I‰I×Ñ¢ªIÐ 6Ó7ˆÜ�Š”b×&Ñ&¬×(BÑ(BÀAÖFr   c                ó¦   € \         P                  ! V P                  4      pV P                  V P                  V\         P                  ! 4       4       R# )z0Conversion from graph to sparse matrix to graph.N)r   Úto_scipy_sparse_arrayr   rP   r   r[   s   & r   Útest_identity_graph_matrixÚ+TestConvertScipy.test_identity_graph_matrixE   ó2   € ä×$Ò$ T§W¡WÓ-ˆØ× Ñ  §¡¨!¬R¯XªX«ZÖ8r   c                ó¦   € \         P                  ! V P                  4      pV P                  V P                  V\         P                  ! 4       4       R# )z4Conversion from digraph to sparse matrix to digraph.N)r   r_   r   rP   r   r[   s   & r   Útest_identity_digraph_matrixÚ-TestConvertScipy.test_identity_digraph_matrixJ   ó2   € ä×$Ò$ T§W¡WÓ-ˆØ× Ñ  §¡¨!¬R¯ZªZ«\Ö:r   c                ó¦   € \         P                  ! V P                  4      pV P                  V P                  V\         P                  ! 4       4       R# )zBConversion from weighted graph to sparse matrix to weighted graph.N)r   r_   r   rP   r   r[   s   & r   Ú#test_identity_weighted_graph_matrixÚ4TestConvertScipy.test_identity_weighted_graph_matrixO   rb   r   c                ó¦   € \         P                  ! V P                  4      pV P                  V P                  V\         P                  ! 4       4       R# )zFConversion from weighted digraph to sparse matrix to weighted digraph.N)r   r_   r   rP   r   r[   s   & r   Ú%test_identity_weighted_digraph_matrixÚ6TestConvertScipy.test_identity_weighted_digraph_matrixT   rf   r   c                ó‚  € \         P                  ! ^4      p\         P                  ! ^4      p\        VP                  4       4      p\         P                  ! WR7      p\         P
                  ! V4      p\         P                  ! WR4      '       g   Q h\        P                  ! \         P                  \         P                  V. R7       V^ .,           p\        P                  ! \         P                  \         P                  W&R7       . ROp\        P                  ! \         P                  \         P                  W'R7       R# )z>Conversion from graph to sparse matrix to graph with nodelist.©ÚnodelistN)éÿÿÿÿr   rS   rT   )
r   Ú
path_graphr/   Únodesr_   r   r?   r'   r(   r)   )r   ÚP4ÚP3ro   rG   ÚGAÚlong_nlÚnon_nls   &       r   Útest_nodelistÚTestConvertScipy.test_nodelistY   sÊ   € ä�]Š]˜1ÓˆÜ�]Š]˜1ÓˆÜ˜Ÿ™›
Ó#ˆÜ×$Ò$ RÔ;ˆÜ�XŠX�a‹[ˆÜ×Ò ×'Ò'Ð'Ð'ä�Š”b×&Ñ&¬×(@Ñ(@À"ÈrÕRà˜a˜S•.ˆÜ�Š”b×&Ñ&¬×(@Ñ(@À"ÕWò ˆÜ�Š”b×&Ñ&¬×(@Ñ(@À"×Vr   c                óÎ  € \         P                  ! 4       pVP                  R  \        ^4       4       4       \         P                  ! ^4      p\         P
                  ! V4      p\        P                  P                  VP                  4       \         P
                  ! VRR7      P                  4       4       \        P                  P                  RVP                  4       ,          \         P
                  ! V4      P                  4       4       \        P                  P                  RVP                  4       ,          \         P
                  ! VRR7      P                  4       4       R# )c              3   ó@   "  € T F  qV^,           RRRR/3x € K  	  R# 5i©rS   r:   ç      à?Úotherç333333Ó?Nr   ©Ú.0Úns   & r   Ú	<genexpr>Ú7TestConvertScipy.test_weight_keyword.<locals>.<genexpr>m   ó"   é € ÐWÉhÈ˜q 1�u x°°g¸sÐ&CÕDËhùó   ‚N©r:   r}   r   r~   ©
r   r   Úadd_edges_fromÚrangerq   r_   ÚnpÚtestingÚassert_equalrE   ©r   ÚWP4rs   rG   s   &   r   Útest_weight_keywordÚ$TestConvertScipy.test_weight_keywordk   sé   € Ü�hŠh‹jˆØ×ÑÑWÌeÐTUÌhÓWÔWÜ�]Š]˜1ÓˆÜ×$Ò$ RÓ(ˆÜ
�
‰
×ÑØ�I‰I‹Kœ×1Ò1°#¸dÔC×KÑKÓMô	
ô 	�
‰
×ÑØ�!—)‘)“+Õœr×7Ò7¸Ó<×DÑDÓFô	
ô 	�
‰
×ÑØ�!—)‘)“+Õœr×7Ò7¸ÀGÔL×TÑTÓVö	
r   c                ój  € \         P                  ! 4       pVP                  R  \        ^4       4       4       \         P                  ! ^4      p\         P
                  ! VRR7      p\        P                  P                  VP                  4       \         P
                  ! VRR7      P                  4       4       \         P
                  ! VRR7      p\        P                  P                  VP                  4       \         P
                  ! VRR7      P                  4       4       \         P
                  ! VRR7      p\        P                  P                  VP                  4       \         P
                  ! VRR7      P                  4       4       \         P
                  ! VRR7      p\        P                  P                  VP                  4       \         P
                  ! VRR7      P                  4       4       \         P
                  ! VRR7      p\        P                  P                  VP                  4       \         P
                  ! VRR7      P                  4       4       \         P
                  ! VR	R7      p\        P                  P                  VP                  4       \         P
                  ! VRR7      P                  4       4       \         P
                  ! VR
R7      p\        P                  P                  VP                  4       \         P
                  ! VRR7      P                  4       4       R# )c              3   ó@   "  € T F  qV^,           RRRR/3x € K  	  R# 5ir|   r   r€   s   & r   rƒ   Ú7TestConvertScipy.test_format_keyword.<locals>.<genexpr>|   r…   r†   Úcsr©r$   Nr‡   ÚcscÚcooÚbsrÚlilÚdiaÚdokrˆ   rŽ   s   &   r   Útest_format_keywordÚ$TestConvertScipy.test_format_keywordz   s#  € Ü�hŠh‹jˆØ×ÑÑWÌeÐTUÌhÓWÔWÜ�]Š]˜1ÓˆÜ×$Ò$ R°Ô6ˆÜ
�
‰
×ÑØ�I‰I‹Kœ×1Ò1°#¸dÔC×KÑKÓMô	
ô ×$Ò$ R°Ô6ˆÜ
�
‰
×ÑØ�I‰I‹Kœ×1Ò1°#¸dÔC×KÑKÓMô	
ô ×$Ò$ R°Ô6ˆÜ
�
‰
×ÑØ�I‰I‹Kœ×1Ò1°#¸dÔC×KÑKÓMô	
ô ×$Ò$ R°Ô6ˆÜ
�
‰
×ÑØ�I‰I‹Kœ×1Ò1°#¸dÔC×KÑKÓMô	
ô ×$Ò$ R°Ô6ˆÜ
�
‰
×ÑØ�I‰I‹Kœ×1Ò1°#¸dÔC×KÑKÓMô	
ô ×$Ò$ R°Ô6ˆÜ
�
‰
×ÑØ�I‰I‹Kœ×1Ò1°#¸dÔC×KÑKÓMô	
ô ×$Ò$ R°Ô6ˆÜ
�
‰
×ÑØ�I‰I‹Kœ×1Ò1°#¸dÔC×KÑKÓMö	
r   c                ó`  € \         P                  ! \        P                  4      ;_uu_ 4        \        P                  ! 4       pVP                  R  \        ^4       4       4       \        P                  ! ^4      p\        P                  ! VRR7       RRR4       R#   + '       g   i     R# ; i)c              3   ó@   "  € T F  qV^,           RRRR/3x € K  	  R# 5ir|   r   r€   s   & r   rƒ   Ú=TestConvertScipy.test_format_keyword_raise.<locals>.<genexpr>¤   s%   é € ð ÙCK¸a�A˜•E˜H c¨7°CÐ8Õ9Ã8ùr†   Ú	any_otherr–   N)	r'   r(   r   r)   r   r‰   rŠ   rq   r_   )r   r�   rs   s   &  r   Útest_format_keyword_raiseÚ*TestConvertScipy.test_format_keyword_raise¡   sp   € Ü�]Š]œ2×+Ñ+×,Õ,Ü—(’(“*ˆCØ×Ññ ÜCHÈÄ8óô ô —’˜qÓ!ˆBÜ×$Ò$ R°Õ<÷ -×,×,Ò,ús   ­A%BÂB-	c                óê   € \         P                  ! \        P                  4      ;_uu_ 4        \        P                  ! \        P
                  ! 4       4       R R R 4       R #   + '       g   i     R # ; i)N)r'   r(   r   r)   r_   r   r   s   &r   Útest_null_raiseÚ TestConvertScipy.test_null_raiseª   s:   € Ü�]Š]œ2×+Ñ+×,Õ,Ü×$Ò$¤R§X¢X£ZÔ0÷ -×,×,Ò,ús   ­*A!Á!A2	c                ó  € \         P                  ! 4       pVP                  ^4       \         P                  ! V4      p\        P
                  P                  VP                  4       \        P                  ^ ..4      4       R# )rS   N)	r   r   Úadd_noder_   r‹   rŒ   r�   rF   Úarray©r   r&   ÚMs   &  r   Ú
test_emptyÚTestConvertScipy.test_empty®   sN   € Ü�HŠH‹JˆØ	�
‰
�1ŒÜ×$Ò$ QÓ'ˆÜ
�
‰
×Ñ §	¡	£¬R¯X©X¸°s°e«_Ö=r   c           	     ód  € \         P                  ! 4       pVP                  ^^4       VP                  ^^4       VP                  ^^4       \         P                  ! V. ROR7      p\        P
                  P                  VP                  4       \        P                  . RO. RO. RO.4      4       R# )rS   rn   N)rU   rT   rS   ©r   r   rS   )rS   r   r   ©r   rS   r   )	r   r   Úadd_edger_   r‹   rŒ   r�   rF   rª   r«   s   &  r   Útest_orderingÚTestConvertScipy.test_ordering´   sv   € Ü�JŠJ‹LˆØ	�
‰
�1�aÔØ	�
‰
�1�aÔØ	�
‰
�1�aÔÜ×$Ò$ Q²Ô;ˆÜ
�
‰
×ÑØ�I‰I‹KœŸ™¢9ªiºÐ"CÓDö	
r   c           	     óÔ  € \         P                  ! R.4      p\         P                  ! V4      p\        P                  P                  VP                  4       \        P                  ^..4      4       VP                  RR.4       \         P                  ! V. ROR7      p\        P                  P                  VP                  4       \        P                  . RO. RO. RO.4      4       R# )	rS   rn   N©rS   rS   ©rT   rU   ©rU   r.   ©rT   rU   r.   r±   )rS   r   rS   )	r   r   r_   r‹   rŒ   r�   rF   rª   r‰   r«   s   &  r   Útest_selfloop_graphÚ$TestConvertScipy.test_selfloop_graph¾   sš   € Ü�HŠH�f�XÓˆÜ×$Ò$ QÓ'ˆÜ
�
‰
×Ñ §	¡	£¬R¯X©X¸°s°e«_Ô=à	×Ñ˜& &Ð)Ô*Ü×$Ò$ Q²Ô;ˆÜ
�
‰
×ÑØ�I‰I‹KœŸ™¢9ªiºÐ"CÓDö	
r   c           	     óÔ  € \         P                  ! R.4      p\         P                  ! V4      p\        P                  P                  VP                  4       \        P                  ^..4      4       VP                  RR.4       \         P                  ! V. ROR7      p\        P                  P                  VP                  4       \        P                  . RO. RO. R	O.4      4       R# )
rS   rn   Nr¶   r·   r¸   r¹   r±   r°   )r   r   r   )	r   r   r_   r‹   rŒ   r�   rF   rª   r‰   r«   s   &  r   Útest_selfloop_digraphÚ&TestConvertScipy.test_selfloop_digraphÉ   sš   € Ü�JŠJ˜�xÓ ˆÜ×$Ò$ QÓ'ˆÜ
�
‰
×Ñ §	¡	£¬R¯X©X¸°s°e«_Ô=à	×Ñ˜& &Ð)Ô*Ü×$Ò$ Q²Ô;ˆÜ
�
‰
×ÑØ�I‰I‹KœŸ™¢9ªiºÐ"CÓDö	
r   c           	     óö  € \         P                  P                  ^^.^^..4      p\        P                  ! 4       p. ROpTP                  V UUu. uF	  w  rEWE^3NK  	  upp4       VP                  ^^^R7       \        P                  ! VR\        P                  R7      p\        Wb4      '       g   Q h\        P                  ! VR\        P                  R7      p\        Wb4      '       g   Q h. ROp\        P                  ! 4       pTP                  V UUu. uF	  w  rEWE^3NK  	  upp4       \        P                  ! VR\        P                  R7      p\        Wb4      '       g   Q h\        P                  ! 4       pVP                  \        V4      ^R7       ^V^,          ^,          ^ ,          R&   \        P                  ! VR\        P                  R7      p\        Wb4      '       g   Q hR# u uppi u uppi )	z™Tests that the :func:`networkx.from_scipy_sparse_array` function
interprets integer weights as the number of parallel edges when
creating a multigraph.

r‡   T)Úparallel_edgesr   Fr:   N)©r   r   ©r   rS   ©rS   r   )rÁ   rÂ   rÃ   r¶   r¶   )rX   rY   Ú	csr_arrayr   r   r2   r²   r>   r   ÚMultiDiGraphr‰   Úset)r   rG   Úexpectedr0   r5   r6   Úactuals   &      r   Ú+test_from_scipy_sparse_array_parallel_edgesÚ<TestConvertScipy.test_from_scipy_sparse_array_parallel_edgesÔ   s£  € ô �I‰I×Ñ ! Q ¨!¨Q¨Ð 0Ó1ˆô —:’:“<ˆÚ(ˆØ×(Ñ(Á%Ô)HÁ%¹¸¨1°«)Á%Ò)HÔIØ×Ñ˜!˜Q qÐÔ)Ü×+Ò+Ø˜d´·±ô
ˆô ˜F×-Ò-Ð-Ð-Ü×+Ò+Ø˜e´"·*±*ô
ˆô ˜F×-Ò-Ð-Ð-ò 9ˆÜ—?’?Ó$ˆØ×(Ñ(Á%Ô)HÁ%¹¸¨1°«)Á%Ò)HÔIÜ×+Ò+Ø˜d´·±ô
ˆô ˜F×-Ò-Ð-Ð-Ü—?’?Ó$ˆØ×Ñ¤ E£
°1ÐÔ5à&'ˆ���A��qÕ˜(Ñ#Ü×+Ò+Ø˜e´"·/±/ô
ˆô ˜F×-Ò-Ð-Ò-ùó7 *Iùó *Is   ÁG/
ÄG5
c                ó  € \         P                  P                  ^ ^.^^ ..4      p\        P                  ! V\        P
                  R7      p\        P
                  ! 4       pVP                  ^ ^^R7       \        W#4      '       g   Q hR# )zŠTests that a symmetric matrix has edges added only once to an
undirected multigraph when using
:func:`networkx.from_scipy_sparse_array`.

r
   r‡   N)rX   rY   rÄ   r   r>   Ú
MultiGraphr²   r   )r   rG   r&   rÇ   s   &   r   Útest_symmetricÚTestConvertScipy.test_symmetricü   sl   € ô �I‰I×Ñ ! Q ¨!¨Q¨Ð 0Ó1ˆÜ×&Ò& q´r·}±}ÔEˆÜ—=’=“?ˆØ×Ñ˜!˜Q qÐÔ)Ü˜A×(Ò(Ð(Ò(r   )r   r   r   r   N)r    r!   r"   r#   r   r+   r   rP   r\   r`   rd   rh   rk   rx   r�   r�   r£   r¦   r­   r³   rº   r½   rÉ   rÍ   r%   Ú__classdictcell__)Ú__classdict__s   @r   r   r   
   ss   ø‡ € ò5òAòò'ò<Gò
9ò
;ò
9ò
;ò
Wò$
ò%
òN=ò1ò>ò
ò	
ò	
ò&.÷P
)ð 
)r   r   Úsparse_formatc                óX  € \         P                  ! 4       pVP                  ^ ^R^/3^ ^R^/3^^ R^/3^^R^/3^^ R^/3^^R^/3.4       \        P                  P                  . RO. RO. RO.4      P                  V 4      p\        V\         P                  ! V4      4      '       g   Q hR# )z7Test all formats supported by _generate_weighted_edges.r:   N)r   rU   rT   )rU   r   rS   )rT   rS   r   )	r   r   r‰   rX   rY   Ú	coo_arrayÚasformatr   r>   )rÑ   rÇ   rG   s   &  r   Ú$test_from_scipy_sparse_array_formatsrÕ   	  s¼   € ô �xŠx‹z€HØ×Ñà��H˜a�=Ð!Ø��H˜a�=Ð!Ø��H˜a�=Ð!Ø��H˜a�=Ð!Ø��H˜a�=Ð!Ø��H˜a�=Ð!ð	
ô	ô 	�	‰	×ÑšYª	²9Ð=Ó>×GÑGÈÓV€AÜ˜¤"×"<Ò"<¸QÓ"?×@Ò@Ð@Ò@r   )r•   r—   rœ   )r'   Únetworkxr   Únetworkx.utilsr   Úimportorskipr‹   rX   r   ÚmarkÚparametrizerÕ   r   r   r   Ú<module>rÛ      sd   ðÛ ã Ý 'à×Ò˜Ó!€Ø×Ò˜Ó!€÷|)ñ |)ð~ ‡�×Ñ˜Ð*?Ó@ñAó AòAr   