a
    #©bï/  ã                   @   s²  d Z ddlZddlZddlZddlZdd„ Zdd„ Zdd„ Zejd	d
�dd„ ƒZ	ejd	d
�dd„ ƒZ
zddlZd	ZW n eyŠ   dZY n0 zddlZd	ZW n ey²   dZY n0 zddlZd	ZW n eyÚ   dZY n0 zddlZd	ZW n e�y   dZY n0 zddlZd	ZW n e�y.   dZY n0 zddlZd	ZW n e�yX   dZY n0 zddlZd	ZW n e�y‚   dZY n0 zddlZd	ZW n e�y¬   dZY n0 zddlZd	ZW n e�yÖ   dZY n0 g Zg d¢Zg d¢Z dgZ!dgZ"dgZ#dgZ$dgZ%dgZ&dgZ'e�s$ee7 Ze�s2ee 7 Ze�s@ee!7 Ze�sNee"7 Ze�s\ee#7 Ze�sjee$7 Ze�sxee%7 Ze�s†ee&7 Ze�s”ee'7 Zej( )d¡�r®eddg7 ZdS )ax  
Testing
=======

General guidelines for writing good tests:

- doctests always assume ``import networkx as nx`` so don't add that
- prefer pytest fixtures over classes with setup methods.
- use the ``@pytest.mark.parametrize``  decorator
- use ``pytest.importorskip`` for numpy, scipy, pandas, and matplotlib b/c of PyPy.
  and add the module to the relevant entries below.

é    Nc                 C   s   | j ddddd� d S )Nú	--runslowÚ
store_trueFzrun slow tests)ÚactionÚdefaultÚhelp)Z	addoption)Úparser© r   úZ/home/yuhw/wc/wire-cell-python-pr-11/pr11/lib/python3.9/site-packages/networkx/conftest.pyÚpytest_addoption   s    ÿr
   c                 C   s   |   dd¡ d S )NÚmarkerszslow: mark test as slow to run)Zaddinivalue_line)Úconfigr   r   r	   Úpytest_configure   s    r   c                 C   s>   |   d¡rd S tjjdd�}|D ]}d|jv r | |¡ q d S )Nr   zneed --runslow option to run)ÚreasonZslow)Z	getoptionÚpytestÚmarkÚskipÚkeywordsZ
add_marker)r   ÚitemsZ	skip_slowÚitemr   r   r	   Úpytest_collection_modifyitems    s    

r   T)Zautousec                   C   s4  t jdtdd� t jdtdd� t jdtdd� t jdtdd� t jdtdd� t jdtdd� t jdtd	d� t jdtd
d� t jdtdd� t jdtdd� t jdtdd� t jdtdd� t jdtdd� t jdtdd� t jdtdd� t jdtdd� t jdtdd� t jdtdd� t jdtdd� t jdtdd� t jdtdd� t jdtdd� t jdtdd� t jdtdd� t jdtdd� t jdtdd� t jdtdd� t jdtdd� t jdtdd� t jdtd d� t jdtd!d� t jdtd"d� t jdtd#d� t jdtd$d� t jdtd%d� t jdtd&d� t jdtd'd� t jdtd(d� t jdtd)d� t jdtd*d� t jdtd+d� t jdtd,d� t jdtd-d� t jdtd.d� t jdtd/d� t jdtd)d� t jdtd0d� t jdtd1d� t jdtd2d� t jdtd3d� t jdtd4d� t jdtd5d� t jdtd6d� t jdtd7d� t jdtd8d� t jdtd9d� t jdtd:d� t jdtd;d� t jdtd<d� t jdtd=d� t jdtd>d� t jdtd?d� t jdtd@d� t jdtdAd� t jdtdBd� t jdtdCd� t jdtdDd� d S )ENÚignoreZk_nearest_neighbors)ÚcategoryÚmessageZnumeric_mixing_matrixzOrdered.* is deprecatedz literal_stringizer is deprecatedz"literal_destringizer is deprecatedzis_string_like is deprecatedz
authority_matrixz
hub_matrixzdefault_opener is deprecatedzempty_generator is deprecatedzmake_str is deprecatedz"generate_unique_node is deprecatedz&context manager reversed is deprecatedz$This will return a generator in 3.0*Zbetweenness_centrality_sourceZedge_betweenesszthe matrix subclassZto_numpy_matrixZfrom_numpy_matrixznetworkx.pagerank_numpyznetworkx.pagerank_scipyZwrite_gpickleZread_gpickleZ	write_shpZread_shpZedges_from_lineZ
write_yamlZ	read_yamlzFilterAtlas.copyzFilterAdjacency.copyzFilterMultiAdjacency.copyzFilterMultiInner.copyZjit_dataZ	jit_graphÚconsumeziterable is deprecatedz%
The function signature for cytoscapez
The `attrs` keywordZpreserve_random_statez`almost_equal`z`assert_nodes_equal`z`assert_edges_equal`z`assert_graphs_equal`znetworkx.hits_scipyznetworkx.hits_numpyz>google_matrix will return an np.ndarray instead of a np.matrixZbiadjacency_matrixZbethe_hessian_matrixZincidence_matrixZlaplacian_matrixZnormalized_laplacian_matrixZdirected_laplacian_matrixZ'directed_combinatorial_laplacian_matrixZmodularity_matrixZdirected_modularity_matrixZadjacency_matrixz#

The scipy.sparse array containersznetworkx.projectz
find_coresZattr_matrixz\n\nmake_small_.*Zto_numpy_recarrayÚinfoZto_tuplezThe create_using argumentznx.nx_pydot)ÚwarningsÚfilterwarningsÚDeprecationWarningÚPendingDeprecationWarningÚFutureWarningr   r   r   r	   Úset_warnings+   sŽ   ÿÿÿýýÿÿÿÿÿÿýýýÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿýÿÿÿÿÿÿÿÿÿýÿÿÿÿÿÿýÿÿÿýÿÿÿÿÿÿr    c                 C   s   t | d< d S )NZnx)Únetworkx)Zdoctest_namespacer   r   r	   Úadd_nxø   s    r"   F)ú.algorithms/approximation/traveling_salesman.pyz/algorithms/centrality/current_flow_closeness.pyú*algorithms/node_classification/__init__.pyzalgorithms/non_randomness.pyz"algorithms/shortest_paths/dense.pyúlinalg/bethehessianmatrix.pyzlinalg/laplacianmatrix.pyzutils/misc.py)r#   z'algorithms/assortativity/correlation.pyz"algorithms/assortativity/mixing.pyz!algorithms/assortativity/pairs.pyzalgorithms/bipartite/matrix.pyz algorithms/bipartite/spectral.pyz1algorithms/centrality/current_flow_betweenness.pyz8algorithms/centrality/current_flow_betweenness_subset.pyz$algorithms/centrality/eigenvector.pyzalgorithms/centrality/katz.pyz%algorithms/centrality/second_order.pyz%algorithms/centrality/subgraph_alg.pyz!algorithms/communicability_alg.pyz$algorithms/link_analysis/hits_alg.pyz(algorithms/link_analysis/pagerank_alg.pyr$   z%algorithms/node_classification/hmn.pyz%algorithms/node_classification/lgc.pyzalgorithms/similarity.pyúconvert_matrix.pyzdrawing/layout.pyz"generators/spectral_graph_forge.pyzlinalg/algebraicconnectivity.pyzlinalg/attrmatrix.pyr%   zlinalg/graphmatrix.pyzlinalg/modularitymatrix.pyzlinalg/spectrum.pyzutils/rcm.pyzdrawing/nx_pylab.pyr&   zreadwrite/nx_yaml.pyzdrawing/nx_agraph.pyzdrawing/nx_pydot.pyzreadwrite/nx_shp.pyzalgorithms/polynomials.pyÚwinzreadwrite/graph6.pyzreadwrite/sparse6.py)*Ú__doc__Úsysr   r   r!   r
   r   r   Zfixturer    r"   ÚnumpyZ	has_numpyÚImportErrorZscipyZ	has_scipyZ
matplotlibZhas_matplotlibZpandasZ
has_pandasZ
pygraphvizZhas_pygraphvizZyamlZhas_yamlZpydotZ	has_pydotZogrZhas_ogrZsympyZ	has_sympyZcollect_ignoreZneeds_numpyZneeds_scipyZneeds_matplotlibZneeds_pandasZ
needs_yamlZneeds_pygraphvizZneeds_pydotZ	needs_ogrZneeds_sympyÚplatformÚ
startswithr   r   r   r	   Ú<module>   s®   

 M











