
    h	                     x    S SK Jr  S SKrS SKrS SKJrJr  S SKJr  S SK	J
r
JrJr   " S S5      r " S S	5      rg)
    )groupbyN)graph_atlasgraph_atlas_g)
NUM_GRAPHS)edges_equalnodes_equalpairwisec                   *    \ rS rSrSrS rS rS rSrg)TestAtlasGraph   z:Unit tests for the :func:`~networkx.graph_atlas` function.c                     [         R                  " [        5         [        S5        S S S 5        g ! , (       d  f       g = f)N)pytestraises
ValueErrorr   selfs    V/var/www/html/env/lib/python3.13/site-packages/networkx/generators/tests/test_atlas.pytest_index_too_small#TestAtlasGraph.test_index_too_small   s!    ]]:&O '&&s   0
>c                     [         R                  " [        5         [        [        5        S S S 5        g ! , (       d  f       g = fN)r   r   r   r   r   r   s    r   test_index_too_large#TestAtlasGraph.test_index_too_large   s"    ]]:&
# '&&s	   4
Ac                     [        S5      n[        UR                  5       [        S5      5      (       d   e[	        UR                  5       SS/5      (       d   eg )N      )r      )r      )r   r   nodesranger   edgesr   Gs     r   
test_graphTestAtlasGraph.test_graph   sF    N1779eAh////1779vv&67777     N)	__name__
__module____qualname____firstlineno____doc__r   r   r%   __static_attributes__r(   r'   r   r   r      s    D$8r'   r   c                   F    \ rS rSrSr\S 5       rS rS rS r	S r
S rS	rg
)TestAtlasGraphG   z<Unit tests for the :func:`~networkx.graph_atlas_g` function.c                 "    [        5       U l        g r   )r   GAG)clss    r   setup_classTestAtlasGraphG.setup_class   s    /r'   c                     U R                   S   nUR                  5       S:X  d   eUR                  5       S:X  d   eU R                   S   nUR                  5       S:X  d   eUR                  5       S:X  d   eg )Nr      r   )r3   number_of_nodesnumber_of_edgesr#   s     r   
test_sizesTestAtlasGraphG.test_sizes#   sx    HHQK  "a'''  "a'''HHQK  "a'''  "a'''r'   c                 |    [        U R                  5       H#  u  p[        UR                  SS  5      U:X  a  M#   e   g Nr   )	enumerater3   intname)r   ir$   s      r   
test_namesTestAtlasGraphG.test_names,   s3    dhh'DAqvvabz?a''' (r'   c                 p    [        [        [        U R                  5      5       H  u  pX!S-   ::  a  M   e   g r>   )r	   maplenr3   )r   n1n2s      r   test_nondecreasing_nodes(TestAtlasGraphG.test_nondecreasing_nodes0   s,    s312FBa<< 3r'   c                     [        U R                  [        R                  S9 H;  u  p[	        [        [        R                  U5      5       H  u  p4XCS-   ::  a  M   e   M=     g )Nkeyr   )r   r3   nxr9   r	   rF   r:   )r   ngroupm1m2s        r   test_nondecreasing_edges(TestAtlasGraphG.test_nondecreasing_edges5   sO      b.@.@AHA"3r'9'95#AB!V|#| C Br'   c                    / SQn[        U R                  [        R                  S9 H  u  p#[        U[        R                  S9 H~  u  pC[        U5       Hj  u  pVUR                  UR                  4U;   a  M#  [        S UR                  5        5       5      n[        S UR                  5        5       5      nXx::  a  Mj   e   M     M     g )N))G55G56)G1007G1008)G1012G1013rM   c              3   *   #    U  H	  u  pUv   M     g 7fr   r(   .0vds      r   	<genexpr>ETestAtlasGraphG.test_nondecreasing_degree_sequence.<locals>.<genexpr>I        :kdak   c              3   *   #    U  H	  u  pUv   M     g 7fr   r(   r^   s      r   rb   rc   J   rd   re   )	r   r3   rO   r9   r:   r	   rA   sorteddegree)	r   
exceptionsrP   rQ   mG1G2d1d2s	            r   "test_nondecreasing_degree_sequence2TestAtlasGraphG.test_nondecreasing_degree_sequence<   s     N
b.@.@AHA#Er/A/AB&uoFB)Z7 :biik::B:biik::B8O8 . C Br'   r(   N)r)   r*   r+   r,   r-   classmethodr5   r;   rC   rJ   rT   ro   r.   r(   r'   r   r0   r0      s0    F" "(( 
$$r'   r0   )	itertoolsr   r   networkxrO   r   r   networkx.generators.atlasr   networkx.utilsr   r   r	   r   r0   r(   r'   r   <module>rv      s.       / 0 = =8 8"/$ /$r'   