
    e!h                         d dl Zd dlZd dlmZ d dlmZmZmZm	Z	 d dl
mZmZmZmZmZ d Zd Zd Zd Zd	 Zej*                  j-                  d
ddg      ej*                  j-                  deeg      d               Zy)    N)assert_array_almost_equal)	csr_array
csr_matrix	coo_array
coo_matrix)breadth_first_treedepth_first_treecsgraph_to_densecsgraph_from_densecsgraph_masked_from_densec                      t        j                  g dg dg dg dg dg      } t        | d      } t        j                  g dg dg d	g d
g d
g      }dD ]$  }t        | d|      }t	        t        |      |       & y )Nr         r   r   r   r   r   r      r   r   r      r   r   r   r   r   r   r   r   r   r   r   r   
null_valuer   r   r   r   r   )r   r   r   r   r   r   r   r   r   r   TFnparrayr   r   r   r
   csgraphbfirstdirectedbfirst_tests       q/var/www/html/diagnosisapp-backend/venv/lib/python3.12/site-packages/scipy/sparse/csgraph/tests/test_traversal.pytest_graph_breadth_firstr%   	   s    hh''''	) *G
 !Q7GXX&&&&	( )F " *(!X>!"2;"?"(	**    c                      t        j                  g dg dg dg dg dg      } t        | d      } t        j                  g dg d	g d
g dg dg      }dD ]$  }t        | d|      }t	        t        |      |       & y )Nr   r   r   r   r   r   r   )r   r   r   r   r   r   r   )r   r   r   r   r   )r   r   r   r   r   r   r   r   r   r	   r   r
   )r    dfirstr"   dfirst_tests       r$   test_graph_depth_firstr+      s    hh''''	) *G
 !Q7GXX&&&&	( )F " I&w8<!"2;"?HIr&   c            	         ddl m}  ddlm} t	        j
                  g dg dg dg dg dg      }t        |      }t         | |      t              sJ t         ||      t              sJ d	D ]<  }t        t        |d
|      t              sJ t        t        |d
|      t              r<J  t        |d
      }t        |t              sJ t         | |      t              sJ t         ||      t              sJ d	D ]<  }t        t        |d
|      t              sJ t        t        |d
|      t              r<J  t        |d
      }t        |t        j                  j                        sJ |j                  t        j                   u sJ t         ||      t              sJ d	D ]<  }t        t        |d
|      t              sJ t        t        |d
|      t              r<J  t        j"                  j%                         5 }|j'                  t(        d       |j'                  t*        d       t	        j,                  g dg dg dg dg dg      }d d d        t/              }t         | |      t0              sJ t         ||      t.              sJ d	D ]<  }t        t        |d
|      t.              sJ t        t        |d
|      t.              r<J  t        |d
      }t        |t.              sJ t         | |      t0              sJ t         ||      t.              sJ d	D ]<  }t        t        |d
|      t.              sJ t        t        |d
|      t.              r<J  t        |d
      }t        |t        j                  j                        sJ t         ||      t.              sJ d	D ]<  }t        t        |d
|      t.              sJ t        t        |d
|      t.              r<J  y # 1 sw Y   xY w)Nr   )	laplacian)minimum_spanning_treer   r   r   r   r   r   r   r   zthe matrix subclass.*)
_laplacianr-   _min_spanning_treer.   r   r   r   
isinstancer   r	   r   r   r   maMaskedArray
_baseclassndarraytestingsuppress_warningsfilterDeprecationWarningPendingDeprecationWarningmatrixr   r   )r-   r.   
np_csgraphr    r"   sup
nm_csgraph
mm_csgraphs           r$   test_return_typer@   0   s   &:?****	, -J
 
#Gi()444+G4i@@@! O*7Ax@)LLL,WaBINNNO !:Ggy)))i()444+G4i@@@! O*7Ax@)LLL,WaBINNNO (
qAGgruu00111++++G4i@@@! O*7Ax@)LLL,WaBINNNO
 
	%	%	' 23

%'>?

,.EFYY / / / /	 1 2
	2 $Gi(*555+G4jAAA! P*7Ax@*MMM,WaBJOOOP !:Ggz***i(*555+G4jAAA! P*7Ax@*MMM,WaBJOOOP +:!DJj"%%"3"3444+G4jAAA! P*7Ax@*MMM,WaBJOOOP;2 2s   AO77Pc                      t        j                  dgg      } t        | d      } t        j                  dgg      }dD ]$  }t        | d|      }t	        t        |      |       & y Nr   r   r   r   r   s       r$   &test_graph_breadth_first_trivial_graphrC   u   s_    hhuoG Q7GXXse_F! I(!X>!"2;"?HIr&   c                      t        j                  dgg      } t        | d      } t        j                  dgg      }dD ]$  }t        | d|      }t	        t        |      |       & y rB   r(   r   s       r$   $test_graph_depth_first_trivial_graphrE      s`    hhuoG Q7GXXse_F! *&w8<!"2;"?"(	**r&   r"   TF	tree_funcc                    t        dgt        j                  dgdggt        j                        fd      }|j                  j
                  t        j                  k(  sJ  | |d|      }t        t        |      ddgddgg       y )Nr   r   )dtype)r   r   )shape)r"   )r   r   r   int64indicesrH   r   r
   )rF   r"   gtrees       r$   test_int64_indicesrN      ss     	A31#s288<=VLA99??bhh&&&QH-D.t41v1v6FGr&   )numpyr   pytestnumpy.testingr   scipy.sparser   r   r   r   scipy.sparse.csgraphr   r	   r
   r   r   r%   r+   r@   rC   rE   markparametrizerN    r&   r$   <module>rW      s      3 E EE E*(I&APJI	* dE]3'9;K&LMH N 4Hr&   