okstra 0.113.0 → 0.115.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (348) hide show
  1. package/README.kr.md +2 -2
  2. package/README.md +2 -2
  3. package/docs/for-ai/README.md +2 -2
  4. package/docs/for-ai/skills/{okstra-brief.md → okstra-brief-gen.md} +3 -3
  5. package/docs/for-ai/skills/okstra-inspect.md +1 -1
  6. package/docs/kr/architecture.md +11 -11
  7. package/docs/kr/cli.md +1 -1
  8. package/docs/kr/follow-ups/2026-07-10-final-report-option-3.md +51 -0
  9. package/docs/project-structure-overview.md +2 -2
  10. package/package.json +1 -1
  11. package/runtime/BUILD.json +2 -2
  12. package/runtime/agents/workers/report-writer-worker.md +1 -0
  13. package/runtime/prompts/lead/context-loader.md +2 -2
  14. package/runtime/prompts/lead/okstra-lead-contract.md +1 -1
  15. package/runtime/prompts/profiles/_common-contract.md +3 -3
  16. package/runtime/prompts/profiles/implementation-planning.md +1 -1
  17. package/runtime/prompts/profiles/requirements-discovery.md +2 -2
  18. package/runtime/python/okstra_ctl/fix_cycles.py +1 -1
  19. package/runtime/python/okstra_ctl/implementation_stage.py +46 -39
  20. package/runtime/python/okstra_ctl/report_views.py +151 -12
  21. package/runtime/python/okstra_ctl/run.py +24 -24
  22. package/runtime/python/okstra_ctl/wizard.py +3 -3
  23. package/runtime/python/okstra_ctl/worktree.py +1 -1
  24. package/runtime/python/okstra_token_usage/claude.py +58 -19
  25. package/runtime/python/okstra_token_usage/collect.py +3 -1
  26. package/runtime/python/okstra_vendor/__init__.py +3 -0
  27. package/runtime/schemas/final-report-v1.0.schema.json +20 -0
  28. package/runtime/skills/{okstra-brief → okstra-brief-gen}/SKILL.md +6 -6
  29. package/runtime/skills/{okstra-brief → okstra-brief-gen}/references/reporter-confirmations.md +1 -1
  30. package/runtime/skills/{okstra-brief → okstra-brief-gen}/references/tracker-recursion.md +1 -1
  31. package/runtime/skills/okstra-inspect/SKILL.md +2 -2
  32. package/runtime/templates/reports/brief.template.md +2 -2
  33. package/runtime/templates/reports/final-report.template.md +14 -0
  34. package/runtime/templates/reports/i18n/en.json +23 -12
  35. package/runtime/templates/reports/i18n/ko.json +23 -12
  36. package/runtime/templates/reports/report.css +55 -0
  37. package/runtime/templates/reports/report.js +53 -1
  38. package/runtime/validators/validate-brief.py +5 -5
  39. package/runtime/validators/validate-brief.sh +1 -1
  40. package/src/commands/lifecycle/uninstall.mjs +2 -1
  41. package/src/lib/skill-catalog.mjs +2 -1
  42. package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/__init__.py +0 -0
  43. package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_approx_clust_coeff.py +0 -41
  44. package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_clique.py +0 -112
  45. package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_connectivity.py +0 -199
  46. package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_density.py +0 -146
  47. package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_distance_measures.py +0 -59
  48. package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_dominating_set.py +0 -78
  49. package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_kcomponents.py +0 -303
  50. package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_matching.py +0 -8
  51. package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_maxcut.py +0 -94
  52. package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_ramsey.py +0 -31
  53. package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_steinertree.py +0 -306
  54. package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_traveling_salesman.py +0 -1014
  55. package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_treewidth.py +0 -274
  56. package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_vertex_cover.py +0 -68
  57. package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/tests/__init__.py +0 -0
  58. package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/tests/base_test.py +0 -81
  59. package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/tests/test_connectivity.py +0 -143
  60. package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/tests/test_correlation.py +0 -122
  61. package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/tests/test_mixing.py +0 -174
  62. package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/tests/test_neighbor_degree.py +0 -107
  63. package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/tests/test_pairs.py +0 -87
  64. package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/__init__.py +0 -0
  65. package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_basic.py +0 -125
  66. package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_centrality.py +0 -192
  67. package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_cluster.py +0 -84
  68. package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_covering.py +0 -33
  69. package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_edgelist.py +0 -240
  70. package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_extendability.py +0 -334
  71. package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_generators.py +0 -407
  72. package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_link_analysis.py +0 -218
  73. package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_matching.py +0 -327
  74. package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_matrix.py +0 -138
  75. package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_project.py +0 -409
  76. package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_redundancy.py +0 -35
  77. package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_spectral_bipartivity.py +0 -80
  78. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/__init__.py +0 -0
  79. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_betweenness_centrality.py +0 -923
  80. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_betweenness_centrality_subset.py +0 -354
  81. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_closeness_centrality.py +0 -274
  82. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_current_flow_betweenness_centrality.py +0 -259
  83. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_current_flow_betweenness_centrality_subset.py +0 -147
  84. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_current_flow_closeness.py +0 -43
  85. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_degree_centrality.py +0 -144
  86. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_dispersion.py +0 -73
  87. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_eigenvector_centrality.py +0 -186
  88. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_group.py +0 -277
  89. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_harmonic_centrality.py +0 -122
  90. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_katz_centrality.py +0 -345
  91. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_laplacian_centrality.py +0 -220
  92. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_load_centrality.py +0 -344
  93. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_percolation_centrality.py +0 -87
  94. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_reaching.py +0 -140
  95. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_second_order_centrality.py +0 -82
  96. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_subgraph.py +0 -110
  97. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_trophic.py +0 -302
  98. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_voterank.py +0 -64
  99. package/runtime/python/okstra_vendor/networkx/algorithms/coloring/tests/__init__.py +0 -0
  100. package/runtime/python/okstra_vendor/networkx/algorithms/coloring/tests/test_coloring.py +0 -863
  101. package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/__init__.py +0 -0
  102. package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_asyn_fluid.py +0 -147
  103. package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_bipartitions.py +0 -157
  104. package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_centrality.py +0 -85
  105. package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_divisive.py +0 -106
  106. package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_kclique.py +0 -91
  107. package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_label_propagation.py +0 -241
  108. package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_leiden.py +0 -138
  109. package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_local.py +0 -76
  110. package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_louvain.py +0 -264
  111. package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_lukes.py +0 -152
  112. package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_modularity_max.py +0 -340
  113. package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_quality.py +0 -139
  114. package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_utils.py +0 -26
  115. package/runtime/python/okstra_vendor/networkx/algorithms/components/tests/__init__.py +0 -0
  116. package/runtime/python/okstra_vendor/networkx/algorithms/components/tests/test_attracting.py +0 -70
  117. package/runtime/python/okstra_vendor/networkx/algorithms/components/tests/test_biconnected.py +0 -248
  118. package/runtime/python/okstra_vendor/networkx/algorithms/components/tests/test_connected.py +0 -138
  119. package/runtime/python/okstra_vendor/networkx/algorithms/components/tests/test_semiconnected.py +0 -55
  120. package/runtime/python/okstra_vendor/networkx/algorithms/components/tests/test_strongly_connected.py +0 -193
  121. package/runtime/python/okstra_vendor/networkx/algorithms/components/tests/test_weakly_connected.py +0 -96
  122. package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/__init__.py +0 -0
  123. package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_connectivity.py +0 -421
  124. package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_cuts.py +0 -309
  125. package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_disjoint_paths.py +0 -249
  126. package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_edge_augmentation.py +0 -502
  127. package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_edge_kcomponents.py +0 -488
  128. package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_kcomponents.py +0 -323
  129. package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_kcutsets.py +0 -280
  130. package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_stoer_wagner.py +0 -102
  131. package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/__init__.py +0 -0
  132. package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/gl1.gpickle.bz2 +0 -0
  133. package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/gw1.gpickle.bz2 +0 -0
  134. package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/netgen-2.gpickle.bz2 +0 -0
  135. package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/test_gomory_hu.py +0 -128
  136. package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/test_maxflow.py +0 -573
  137. package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/test_maxflow_large_graph.py +0 -155
  138. package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/test_mincost.py +0 -475
  139. package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/test_networksimplex.py +0 -481
  140. package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/wlm3.gpickle.bz2 +0 -0
  141. package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/__init__.py +0 -0
  142. package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/iso_r01_s80.A99 +0 -0
  143. package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/iso_r01_s80.B99 +0 -0
  144. package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/si2_b06_m200.A99 +0 -0
  145. package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/si2_b06_m200.B99 +0 -0
  146. package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_ismags.py +0 -719
  147. package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_isomorphism.py +0 -103
  148. package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_isomorphvf2.py +0 -490
  149. package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_match_helpers.py +0 -64
  150. package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_temporalisomorphvf2.py +0 -212
  151. package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_tree_isomorphism.py +0 -202
  152. package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_vf2pp.py +0 -1655
  153. package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_vf2pp_helpers.py +0 -3118
  154. package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_vf2userfunc.py +0 -196
  155. package/runtime/python/okstra_vendor/networkx/algorithms/link_analysis/tests/__init__.py +0 -0
  156. package/runtime/python/okstra_vendor/networkx/algorithms/link_analysis/tests/test_hits.py +0 -77
  157. package/runtime/python/okstra_vendor/networkx/algorithms/link_analysis/tests/test_pagerank.py +0 -213
  158. package/runtime/python/okstra_vendor/networkx/algorithms/minors/tests/test_contraction.py +0 -544
  159. package/runtime/python/okstra_vendor/networkx/algorithms/operators/tests/__init__.py +0 -0
  160. package/runtime/python/okstra_vendor/networkx/algorithms/operators/tests/test_all.py +0 -328
  161. package/runtime/python/okstra_vendor/networkx/algorithms/operators/tests/test_binary.py +0 -451
  162. package/runtime/python/okstra_vendor/networkx/algorithms/operators/tests/test_product.py +0 -491
  163. package/runtime/python/okstra_vendor/networkx/algorithms/operators/tests/test_unary.py +0 -55
  164. package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/tests/__init__.py +0 -0
  165. package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/tests/test_astar.py +0 -254
  166. package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/tests/test_dense.py +0 -212
  167. package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/tests/test_dense_numpy.py +0 -88
  168. package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/tests/test_generic.py +0 -511
  169. package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/tests/test_unweighted.py +0 -149
  170. package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/tests/test_weighted.py +0 -983
  171. package/runtime/python/okstra_vendor/networkx/algorithms/tests/__init__.py +0 -0
  172. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_asteroidal.py +0 -23
  173. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_boundary.py +0 -154
  174. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_bridges.py +0 -144
  175. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_broadcasting.py +0 -109
  176. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_chains.py +0 -136
  177. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_chordal.py +0 -129
  178. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_clique.py +0 -300
  179. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_cluster.py +0 -678
  180. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_communicability.py +0 -80
  181. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_core.py +0 -266
  182. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_covering.py +0 -85
  183. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_cuts.py +0 -171
  184. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_cycles.py +0 -984
  185. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_d_separation.py +0 -340
  186. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_dag.py +0 -835
  187. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_distance_measures.py +0 -831
  188. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_distance_regular.py +0 -85
  189. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_dominance.py +0 -299
  190. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_dominating.py +0 -115
  191. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_efficiency.py +0 -58
  192. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_euler.py +0 -314
  193. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_graph_hashing.py +0 -872
  194. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_graphical.py +0 -163
  195. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_hierarchy.py +0 -46
  196. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_hybrid.py +0 -24
  197. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_isolate.py +0 -26
  198. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_link_prediction.py +0 -615
  199. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_lowest_common_ancestors.py +0 -459
  200. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_matching.py +0 -556
  201. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_max_weight_clique.py +0 -179
  202. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_mis.py +0 -62
  203. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_moral.py +0 -15
  204. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_node_classification.py +0 -140
  205. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_non_randomness.py +0 -60
  206. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_perfect_graph.py +0 -27
  207. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_planar_drawing.py +0 -274
  208. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_planarity.py +0 -556
  209. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_polynomials.py +0 -57
  210. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_reciprocity.py +0 -37
  211. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_regular.py +0 -88
  212. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_richclub.py +0 -149
  213. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_similarity.py +0 -1158
  214. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_simple_paths.py +0 -803
  215. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_smallworld.py +0 -76
  216. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_smetric.py +0 -8
  217. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_sparsifiers.py +0 -138
  218. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_structuralholes.py +0 -191
  219. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_summarization.py +0 -642
  220. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_swap.py +0 -179
  221. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_threshold.py +0 -270
  222. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_time_dependent.py +0 -431
  223. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_tournament.py +0 -161
  224. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_triads.py +0 -248
  225. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_vitality.py +0 -41
  226. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_voronoi.py +0 -103
  227. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_walks.py +0 -54
  228. package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_wiener.py +0 -157
  229. package/runtime/python/okstra_vendor/networkx/algorithms/traversal/tests/__init__.py +0 -0
  230. package/runtime/python/okstra_vendor/networkx/algorithms/traversal/tests/test_beamsearch.py +0 -25
  231. package/runtime/python/okstra_vendor/networkx/algorithms/traversal/tests/test_bfs.py +0 -203
  232. package/runtime/python/okstra_vendor/networkx/algorithms/traversal/tests/test_dfs.py +0 -307
  233. package/runtime/python/okstra_vendor/networkx/algorithms/traversal/tests/test_edgebfs.py +0 -147
  234. package/runtime/python/okstra_vendor/networkx/algorithms/traversal/tests/test_edgedfs.py +0 -131
  235. package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/__init__.py +0 -0
  236. package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/test_branchings.py +0 -624
  237. package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/test_coding.py +0 -114
  238. package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/test_decomposition.py +0 -79
  239. package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/test_distance_measures.py +0 -99
  240. package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/test_mst.py +0 -934
  241. package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/test_operations.py +0 -53
  242. package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/test_recognition.py +0 -174
  243. package/runtime/python/okstra_vendor/networkx/classes/tests/__init__.py +0 -0
  244. package/runtime/python/okstra_vendor/networkx/classes/tests/dispatch_interface.py +0 -192
  245. package/runtime/python/okstra_vendor/networkx/classes/tests/historical_tests.py +0 -476
  246. package/runtime/python/okstra_vendor/networkx/classes/tests/test_coreviews.py +0 -362
  247. package/runtime/python/okstra_vendor/networkx/classes/tests/test_digraph.py +0 -331
  248. package/runtime/python/okstra_vendor/networkx/classes/tests/test_digraph_historical.py +0 -110
  249. package/runtime/python/okstra_vendor/networkx/classes/tests/test_filters.py +0 -177
  250. package/runtime/python/okstra_vendor/networkx/classes/tests/test_function.py +0 -1045
  251. package/runtime/python/okstra_vendor/networkx/classes/tests/test_graph.py +0 -950
  252. package/runtime/python/okstra_vendor/networkx/classes/tests/test_graph_historical.py +0 -12
  253. package/runtime/python/okstra_vendor/networkx/classes/tests/test_graphviews.py +0 -349
  254. package/runtime/python/okstra_vendor/networkx/classes/tests/test_multidigraph.py +0 -459
  255. package/runtime/python/okstra_vendor/networkx/classes/tests/test_multigraph.py +0 -528
  256. package/runtime/python/okstra_vendor/networkx/classes/tests/test_reportviews.py +0 -1421
  257. package/runtime/python/okstra_vendor/networkx/classes/tests/test_special.py +0 -131
  258. package/runtime/python/okstra_vendor/networkx/classes/tests/test_subgraphviews.py +0 -371
  259. package/runtime/python/okstra_vendor/networkx/conftest.py +0 -261
  260. package/runtime/python/okstra_vendor/networkx/drawing/tests/__init__.py +0 -0
  261. package/runtime/python/okstra_vendor/networkx/drawing/tests/baseline/test_display_complex.png +0 -0
  262. package/runtime/python/okstra_vendor/networkx/drawing/tests/baseline/test_display_empty_graph.png +0 -0
  263. package/runtime/python/okstra_vendor/networkx/drawing/tests/baseline/test_display_house_with_colors.png +0 -0
  264. package/runtime/python/okstra_vendor/networkx/drawing/tests/baseline/test_display_labels_and_colors.png +0 -0
  265. package/runtime/python/okstra_vendor/networkx/drawing/tests/baseline/test_display_shortest_path.png +0 -0
  266. package/runtime/python/okstra_vendor/networkx/drawing/tests/baseline/test_house_with_colors.png +0 -0
  267. package/runtime/python/okstra_vendor/networkx/drawing/tests/test_agraph.py +0 -237
  268. package/runtime/python/okstra_vendor/networkx/drawing/tests/test_image_comparison_pylab_mpl.py +0 -229
  269. package/runtime/python/okstra_vendor/networkx/drawing/tests/test_latex.py +0 -285
  270. package/runtime/python/okstra_vendor/networkx/drawing/tests/test_layout.py +0 -631
  271. package/runtime/python/okstra_vendor/networkx/drawing/tests/test_pydot.py +0 -146
  272. package/runtime/python/okstra_vendor/networkx/drawing/tests/test_pylab.py +0 -1582
  273. package/runtime/python/okstra_vendor/networkx/generators/tests/__init__.py +0 -0
  274. package/runtime/python/okstra_vendor/networkx/generators/tests/test_atlas.py +0 -75
  275. package/runtime/python/okstra_vendor/networkx/generators/tests/test_classic.py +0 -642
  276. package/runtime/python/okstra_vendor/networkx/generators/tests/test_cographs.py +0 -20
  277. package/runtime/python/okstra_vendor/networkx/generators/tests/test_community.py +0 -362
  278. package/runtime/python/okstra_vendor/networkx/generators/tests/test_degree_seq.py +0 -224
  279. package/runtime/python/okstra_vendor/networkx/generators/tests/test_directed.py +0 -189
  280. package/runtime/python/okstra_vendor/networkx/generators/tests/test_duplication.py +0 -103
  281. package/runtime/python/okstra_vendor/networkx/generators/tests/test_ego.py +0 -39
  282. package/runtime/python/okstra_vendor/networkx/generators/tests/test_expanders.py +0 -182
  283. package/runtime/python/okstra_vendor/networkx/generators/tests/test_geometric.py +0 -488
  284. package/runtime/python/okstra_vendor/networkx/generators/tests/test_harary_graph.py +0 -133
  285. package/runtime/python/okstra_vendor/networkx/generators/tests/test_internet_as_graphs.py +0 -221
  286. package/runtime/python/okstra_vendor/networkx/generators/tests/test_intersection.py +0 -28
  287. package/runtime/python/okstra_vendor/networkx/generators/tests/test_interval_graph.py +0 -144
  288. package/runtime/python/okstra_vendor/networkx/generators/tests/test_joint_degree_seq.py +0 -125
  289. package/runtime/python/okstra_vendor/networkx/generators/tests/test_lattice.py +0 -264
  290. package/runtime/python/okstra_vendor/networkx/generators/tests/test_line.py +0 -316
  291. package/runtime/python/okstra_vendor/networkx/generators/tests/test_mycielski.py +0 -30
  292. package/runtime/python/okstra_vendor/networkx/generators/tests/test_nonisomorphic_trees.py +0 -82
  293. package/runtime/python/okstra_vendor/networkx/generators/tests/test_random_clustered.py +0 -33
  294. package/runtime/python/okstra_vendor/networkx/generators/tests/test_random_graphs.py +0 -495
  295. package/runtime/python/okstra_vendor/networkx/generators/tests/test_small.py +0 -220
  296. package/runtime/python/okstra_vendor/networkx/generators/tests/test_spectral_graph_forge.py +0 -49
  297. package/runtime/python/okstra_vendor/networkx/generators/tests/test_stochastic.py +0 -72
  298. package/runtime/python/okstra_vendor/networkx/generators/tests/test_sudoku.py +0 -92
  299. package/runtime/python/okstra_vendor/networkx/generators/tests/test_time_series.py +0 -64
  300. package/runtime/python/okstra_vendor/networkx/generators/tests/test_trees.py +0 -195
  301. package/runtime/python/okstra_vendor/networkx/generators/tests/test_triads.py +0 -15
  302. package/runtime/python/okstra_vendor/networkx/linalg/tests/__init__.py +0 -0
  303. package/runtime/python/okstra_vendor/networkx/linalg/tests/test_algebraic_connectivity.py +0 -400
  304. package/runtime/python/okstra_vendor/networkx/linalg/tests/test_attrmatrix.py +0 -108
  305. package/runtime/python/okstra_vendor/networkx/linalg/tests/test_bethehessian.py +0 -40
  306. package/runtime/python/okstra_vendor/networkx/linalg/tests/test_graphmatrix.py +0 -275
  307. package/runtime/python/okstra_vendor/networkx/linalg/tests/test_laplacian.py +0 -334
  308. package/runtime/python/okstra_vendor/networkx/linalg/tests/test_modularity.py +0 -86
  309. package/runtime/python/okstra_vendor/networkx/linalg/tests/test_spectrum.py +0 -70
  310. package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/tests/__init__.py +0 -0
  311. package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/tests/test_adjacency.py +0 -78
  312. package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/tests/test_cytoscape.py +0 -78
  313. package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/tests/test_node_link.py +0 -109
  314. package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/tests/test_tree.py +0 -48
  315. package/runtime/python/okstra_vendor/networkx/readwrite/tests/__init__.py +0 -0
  316. package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_adjlist.py +0 -354
  317. package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_edgelist.py +0 -318
  318. package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_gexf.py +0 -612
  319. package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_gml.py +0 -744
  320. package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_graph6.py +0 -181
  321. package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_graphml.py +0 -1531
  322. package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_leda.py +0 -30
  323. package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_p2g.py +0 -63
  324. package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_pajek.py +0 -128
  325. package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_sparse6.py +0 -166
  326. package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_text.py +0 -1742
  327. package/runtime/python/okstra_vendor/networkx/tests/__init__.py +0 -0
  328. package/runtime/python/okstra_vendor/networkx/tests/test_all_random_functions.py +0 -248
  329. package/runtime/python/okstra_vendor/networkx/tests/test_convert.py +0 -321
  330. package/runtime/python/okstra_vendor/networkx/tests/test_convert_numpy.py +0 -531
  331. package/runtime/python/okstra_vendor/networkx/tests/test_convert_pandas.py +0 -349
  332. package/runtime/python/okstra_vendor/networkx/tests/test_convert_scipy.py +0 -281
  333. package/runtime/python/okstra_vendor/networkx/tests/test_exceptions.py +0 -40
  334. package/runtime/python/okstra_vendor/networkx/tests/test_import.py +0 -11
  335. package/runtime/python/okstra_vendor/networkx/tests/test_lazy_imports.py +0 -96
  336. package/runtime/python/okstra_vendor/networkx/tests/test_relabel.py +0 -349
  337. package/runtime/python/okstra_vendor/networkx/tests/test_removed_functions_exception_messages.py +0 -8
  338. package/runtime/python/okstra_vendor/networkx/utils/tests/__init__.py +0 -0
  339. package/runtime/python/okstra_vendor/networkx/utils/tests/test__init.py +0 -11
  340. package/runtime/python/okstra_vendor/networkx/utils/tests/test_backends.py +0 -225
  341. package/runtime/python/okstra_vendor/networkx/utils/tests/test_config.py +0 -263
  342. package/runtime/python/okstra_vendor/networkx/utils/tests/test_decorators.py +0 -510
  343. package/runtime/python/okstra_vendor/networkx/utils/tests/test_heaps.py +0 -131
  344. package/runtime/python/okstra_vendor/networkx/utils/tests/test_mapped_queue.py +0 -268
  345. package/runtime/python/okstra_vendor/networkx/utils/tests/test_misc.py +0 -393
  346. package/runtime/python/okstra_vendor/networkx/utils/tests/test_random_sequence.py +0 -53
  347. package/runtime/python/okstra_vendor/networkx/utils/tests/test_rcm.py +0 -63
  348. package/runtime/python/okstra_vendor/networkx/utils/tests/test_unionfind.py +0 -55
@@ -1,362 +0,0 @@
1
- import pytest
2
-
3
- import networkx as nx
4
-
5
-
6
- def test_random_partition_graph():
7
- G = nx.random_partition_graph([3, 3, 3], 1, 0, seed=42)
8
- C = G.graph["partition"]
9
- assert C == [{0, 1, 2}, {3, 4, 5}, {6, 7, 8}]
10
- assert len(G) == 9
11
- assert len(list(G.edges())) == 9
12
-
13
- G = nx.random_partition_graph([3, 3, 3], 0, 1)
14
- C = G.graph["partition"]
15
- assert C == [{0, 1, 2}, {3, 4, 5}, {6, 7, 8}]
16
- assert len(G) == 9
17
- assert len(list(G.edges())) == 27
18
-
19
- G = nx.random_partition_graph([3, 3, 3], 1, 0, directed=True)
20
- C = G.graph["partition"]
21
- assert C == [{0, 1, 2}, {3, 4, 5}, {6, 7, 8}]
22
- assert len(G) == 9
23
- assert len(list(G.edges())) == 18
24
-
25
- G = nx.random_partition_graph([3, 3, 3], 0, 1, directed=True)
26
- C = G.graph["partition"]
27
- assert C == [{0, 1, 2}, {3, 4, 5}, {6, 7, 8}]
28
- assert len(G) == 9
29
- assert len(list(G.edges())) == 54
30
-
31
- G = nx.random_partition_graph([1, 2, 3, 4, 5], 0.5, 0.1)
32
- C = G.graph["partition"]
33
- assert C == [{0}, {1, 2}, {3, 4, 5}, {6, 7, 8, 9}, {10, 11, 12, 13, 14}]
34
- assert len(G) == 15
35
-
36
- rpg = nx.random_partition_graph
37
- pytest.raises(nx.NetworkXError, rpg, [1, 2, 3], 1.1, 0.1)
38
- pytest.raises(nx.NetworkXError, rpg, [1, 2, 3], -0.1, 0.1)
39
- pytest.raises(nx.NetworkXError, rpg, [1, 2, 3], 0.1, 1.1)
40
- pytest.raises(nx.NetworkXError, rpg, [1, 2, 3], 0.1, -0.1)
41
-
42
-
43
- def test_planted_partition_graph():
44
- G = nx.planted_partition_graph(4, 3, 1, 0, seed=42)
45
- C = G.graph["partition"]
46
- assert len(C) == 4
47
- assert len(G) == 12
48
- assert len(list(G.edges())) == 12
49
-
50
- G = nx.planted_partition_graph(4, 3, 0, 1)
51
- C = G.graph["partition"]
52
- assert len(C) == 4
53
- assert len(G) == 12
54
- assert len(list(G.edges())) == 54
55
-
56
- G = nx.planted_partition_graph(10, 4, 0.5, 0.1, seed=42)
57
- C = G.graph["partition"]
58
- assert len(C) == 10
59
- assert len(G) == 40
60
-
61
- G = nx.planted_partition_graph(4, 3, 1, 0, directed=True)
62
- C = G.graph["partition"]
63
- assert len(C) == 4
64
- assert len(G) == 12
65
- assert len(list(G.edges())) == 24
66
-
67
- G = nx.planted_partition_graph(4, 3, 0, 1, directed=True)
68
- C = G.graph["partition"]
69
- assert len(C) == 4
70
- assert len(G) == 12
71
- assert len(list(G.edges())) == 108
72
-
73
- G = nx.planted_partition_graph(10, 4, 0.5, 0.1, seed=42, directed=True)
74
- C = G.graph["partition"]
75
- assert len(C) == 10
76
- assert len(G) == 40
77
-
78
- ppg = nx.planted_partition_graph
79
- pytest.raises(nx.NetworkXError, ppg, 3, 3, 1.1, 0.1)
80
- pytest.raises(nx.NetworkXError, ppg, 3, 3, -0.1, 0.1)
81
- pytest.raises(nx.NetworkXError, ppg, 3, 3, 0.1, 1.1)
82
- pytest.raises(nx.NetworkXError, ppg, 3, 3, 0.1, -0.1)
83
-
84
-
85
- def test_relaxed_caveman_graph():
86
- G = nx.relaxed_caveman_graph(4, 3, 0)
87
- assert len(G) == 12
88
- G = nx.relaxed_caveman_graph(4, 3, 1)
89
- assert len(G) == 12
90
- G = nx.relaxed_caveman_graph(4, 3, 0.5)
91
- assert len(G) == 12
92
- G = nx.relaxed_caveman_graph(4, 3, 0.5, seed=42)
93
- assert len(G) == 12
94
-
95
-
96
- def test_connected_caveman_graph():
97
- G = nx.connected_caveman_graph(4, 3)
98
- assert len(G) == 12
99
-
100
- G = nx.connected_caveman_graph(1, 5)
101
- K5 = nx.complete_graph(5)
102
- K5.remove_edge(3, 4)
103
- assert nx.is_isomorphic(G, K5)
104
-
105
- # need at least 2 nodes in each clique
106
- pytest.raises(nx.NetworkXError, nx.connected_caveman_graph, 4, 1)
107
-
108
-
109
- def test_caveman_graph():
110
- G = nx.caveman_graph(4, 3)
111
- assert len(G) == 12
112
-
113
- G = nx.caveman_graph(5, 1)
114
- E5 = nx.empty_graph(5)
115
- assert nx.is_isomorphic(G, E5)
116
-
117
- G = nx.caveman_graph(1, 5)
118
- K5 = nx.complete_graph(5)
119
- assert nx.is_isomorphic(G, K5)
120
-
121
-
122
- def test_gaussian_random_partition_graph():
123
- G = nx.gaussian_random_partition_graph(100, 10, 10, 0.3, 0.01)
124
- assert len(G) == 100
125
- G = nx.gaussian_random_partition_graph(100, 10, 10, 0.3, 0.01, directed=True)
126
- assert len(G) == 100
127
- G = nx.gaussian_random_partition_graph(
128
- 100, 10, 10, 0.3, 0.01, directed=False, seed=42
129
- )
130
- assert len(G) == 100
131
- assert not isinstance(G, nx.DiGraph)
132
- G = nx.gaussian_random_partition_graph(
133
- 100, 10, 10, 0.3, 0.01, directed=True, seed=42
134
- )
135
- assert len(G) == 100
136
- assert isinstance(G, nx.DiGraph)
137
- pytest.raises(
138
- nx.NetworkXError, nx.gaussian_random_partition_graph, 100, 101, 10, 1, 0
139
- )
140
- # Test when clusters are likely less than 1
141
- G = nx.gaussian_random_partition_graph(10, 0.5, 0.5, 0.5, 0.5, seed=1)
142
- assert len(G) == 10
143
-
144
-
145
- def test_ring_of_cliques():
146
- for i in range(2, 20, 3):
147
- for j in range(2, 20, 3):
148
- G = nx.ring_of_cliques(i, j)
149
- assert G.number_of_nodes() == i * j
150
- if i != 2 or j != 1:
151
- expected_num_edges = i * (((j * (j - 1)) // 2) + 1)
152
- else:
153
- # the edge that already exists cannot be duplicated
154
- expected_num_edges = i * (((j * (j - 1)) // 2) + 1) - 1
155
- assert G.number_of_edges() == expected_num_edges
156
- with pytest.raises(
157
- nx.NetworkXError, match="A ring of cliques must have at least two cliques"
158
- ):
159
- nx.ring_of_cliques(1, 5)
160
- with pytest.raises(
161
- nx.NetworkXError, match="The cliques must have at least two nodes"
162
- ):
163
- nx.ring_of_cliques(3, 0)
164
-
165
-
166
- def test_windmill_graph():
167
- for n in range(2, 20, 3):
168
- for k in range(2, 20, 3):
169
- G = nx.windmill_graph(n, k)
170
- assert G.number_of_nodes() == (k - 1) * n + 1
171
- assert G.number_of_edges() == n * k * (k - 1) / 2
172
- assert G.degree(0) == G.number_of_nodes() - 1
173
- for i in range(1, G.number_of_nodes()):
174
- assert G.degree(i) == k - 1
175
- with pytest.raises(
176
- nx.NetworkXError, match="A windmill graph must have at least two cliques"
177
- ):
178
- nx.windmill_graph(1, 3)
179
- with pytest.raises(
180
- nx.NetworkXError, match="The cliques must have at least two nodes"
181
- ):
182
- nx.windmill_graph(3, 0)
183
-
184
-
185
- def test_stochastic_block_model():
186
- sizes = [75, 75, 300]
187
- probs = [[0.25, 0.05, 0.02], [0.05, 0.35, 0.07], [0.02, 0.07, 0.40]]
188
- G = nx.stochastic_block_model(sizes, probs, seed=0)
189
- C = G.graph["partition"]
190
- assert len(C) == 3
191
- assert len(G) == 450
192
- assert G.size() == 22160
193
-
194
- GG = nx.stochastic_block_model(sizes, probs, range(450), seed=0)
195
- assert G.nodes == GG.nodes
196
-
197
- # Test Exceptions
198
- sbm = nx.stochastic_block_model
199
- badnodelist = list(range(400)) # not enough nodes to match sizes
200
- badprobs1 = [[0.25, 0.05, 1.02], [0.05, 0.35, 0.07], [0.02, 0.07, 0.40]]
201
- badprobs2 = [[0.25, 0.05, 0.02], [0.05, -0.35, 0.07], [0.02, 0.07, 0.40]]
202
- probs_rect1 = [[0.25, 0.05, 0.02], [0.05, -0.35, 0.07]]
203
- probs_rect2 = [[0.25, 0.05], [0.05, -0.35], [0.02, 0.07]]
204
- asymprobs = [[0.25, 0.05, 0.01], [0.05, -0.35, 0.07], [0.02, 0.07, 0.40]]
205
- pytest.raises(nx.NetworkXException, sbm, sizes, badprobs1)
206
- pytest.raises(nx.NetworkXException, sbm, sizes, badprobs2)
207
- pytest.raises(nx.NetworkXException, sbm, sizes, probs_rect1, directed=True)
208
- pytest.raises(nx.NetworkXException, sbm, sizes, probs_rect2, directed=True)
209
- pytest.raises(nx.NetworkXException, sbm, sizes, asymprobs, directed=False)
210
- pytest.raises(nx.NetworkXException, sbm, sizes, probs, badnodelist)
211
- nodelist = [0] + list(range(449)) # repeated node name in nodelist
212
- pytest.raises(nx.NetworkXException, sbm, sizes, probs, nodelist)
213
-
214
- # Extra keyword arguments test
215
- GG = nx.stochastic_block_model(sizes, probs, seed=0, selfloops=True)
216
- assert G.nodes == GG.nodes
217
- GG = nx.stochastic_block_model(sizes, probs, selfloops=True, directed=True)
218
- assert G.nodes == GG.nodes
219
- GG = nx.stochastic_block_model(sizes, probs, seed=0, sparse=False)
220
- assert G.nodes == GG.nodes
221
-
222
-
223
- def test_generator():
224
- n = 250
225
- tau1 = 3
226
- tau2 = 1.5
227
- mu = 0.1
228
- G = nx.LFR_benchmark_graph(
229
- n, tau1, tau2, mu, average_degree=5, min_community=20, seed=10
230
- )
231
- assert len(G) == 250
232
- C = {frozenset(G.nodes[v]["community"]) for v in G}
233
- assert nx.community.is_partition(G.nodes(), C)
234
-
235
-
236
- def test_invalid_tau1():
237
- with pytest.raises(nx.NetworkXError, match="tau2 must be greater than one"):
238
- n = 100
239
- tau1 = 2
240
- tau2 = 1
241
- mu = 0.1
242
- nx.LFR_benchmark_graph(n, tau1, tau2, mu, min_degree=2)
243
-
244
-
245
- def test_invalid_tau2():
246
- with pytest.raises(nx.NetworkXError, match="tau1 must be greater than one"):
247
- n = 100
248
- tau1 = 1
249
- tau2 = 2
250
- mu = 0.1
251
- nx.LFR_benchmark_graph(n, tau1, tau2, mu, min_degree=2)
252
-
253
-
254
- def test_mu_too_large():
255
- with pytest.raises(nx.NetworkXError, match="mu must be in the interval \\[0, 1\\]"):
256
- n = 100
257
- tau1 = 2
258
- tau2 = 2
259
- mu = 1.1
260
- nx.LFR_benchmark_graph(n, tau1, tau2, mu, min_degree=2)
261
-
262
-
263
- def test_mu_too_small():
264
- with pytest.raises(nx.NetworkXError, match="mu must be in the interval \\[0, 1\\]"):
265
- n = 100
266
- tau1 = 2
267
- tau2 = 2
268
- mu = -1
269
- nx.LFR_benchmark_graph(n, tau1, tau2, mu, min_degree=2)
270
-
271
-
272
- def test_both_degrees_none():
273
- with pytest.raises(
274
- nx.NetworkXError,
275
- match="Must assign exactly one of min_degree and average_degree",
276
- ):
277
- n = 100
278
- tau1 = 2
279
- tau2 = 2
280
- mu = 1
281
- nx.LFR_benchmark_graph(n, tau1, tau2, mu)
282
-
283
-
284
- def test_neither_degrees_none():
285
- with pytest.raises(
286
- nx.NetworkXError,
287
- match="Must assign exactly one of min_degree and average_degree",
288
- ):
289
- n = 100
290
- tau1 = 2
291
- tau2 = 2
292
- mu = 1
293
- nx.LFR_benchmark_graph(n, tau1, tau2, mu, min_degree=2, average_degree=5)
294
-
295
-
296
- def test_max_iters_exceeded():
297
- with pytest.raises(
298
- nx.ExceededMaxIterations,
299
- match="Could not assign communities; try increasing min_community",
300
- ):
301
- n = 10
302
- tau1 = 2
303
- tau2 = 2
304
- mu = 0.1
305
- nx.LFR_benchmark_graph(n, tau1, tau2, mu, min_degree=2, max_iters=10, seed=1)
306
-
307
-
308
- def test_max_deg_out_of_range():
309
- with pytest.raises(
310
- nx.NetworkXError, match="max_degree must be in the interval \\(0, n\\]"
311
- ):
312
- n = 10
313
- tau1 = 2
314
- tau2 = 2
315
- mu = 0.1
316
- nx.LFR_benchmark_graph(
317
- n, tau1, tau2, mu, max_degree=n + 1, max_iters=10, seed=1
318
- )
319
-
320
-
321
- def test_max_community():
322
- n = 250
323
- tau1 = 3
324
- tau2 = 1.5
325
- mu = 0.1
326
- G = nx.LFR_benchmark_graph(
327
- n,
328
- tau1,
329
- tau2,
330
- mu,
331
- average_degree=5,
332
- max_degree=100,
333
- min_community=50,
334
- max_community=200,
335
- seed=10,
336
- )
337
- assert len(G) == 250
338
- C = {frozenset(G.nodes[v]["community"]) for v in G}
339
- assert nx.community.is_partition(G.nodes(), C)
340
-
341
-
342
- def test_powerlaw_iterations_exceeded():
343
- with pytest.raises(
344
- nx.ExceededMaxIterations, match="Could not create power law sequence"
345
- ):
346
- n = 100
347
- tau1 = 2
348
- tau2 = 2
349
- mu = 1
350
- nx.LFR_benchmark_graph(n, tau1, tau2, mu, min_degree=2, max_iters=0)
351
-
352
-
353
- def test_no_scipy_zeta():
354
- zeta2 = 1.6449340668482264
355
- assert abs(zeta2 - nx.generators.community._hurwitz_zeta(2, 1, 0.0001)) < 0.01
356
-
357
-
358
- def test_generate_min_degree_itr():
359
- with pytest.raises(
360
- nx.ExceededMaxIterations, match="Could not match average_degree"
361
- ):
362
- nx.generators.community._generate_min_degree(2, 2, 1, 0.01, 0)
@@ -1,224 +0,0 @@
1
- import pytest
2
-
3
- import networkx as nx
4
-
5
-
6
- class TestConfigurationModel:
7
- """Unit tests for the :func:`~networkx.configuration_model`
8
- function.
9
-
10
- """
11
-
12
- def test_empty_degree_sequence(self):
13
- """Tests that an empty degree sequence yields the null graph."""
14
- G = nx.configuration_model([])
15
- assert len(G) == 0
16
-
17
- def test_degree_zero(self):
18
- """Tests that a degree sequence of all zeros yields the empty
19
- graph.
20
-
21
- """
22
- G = nx.configuration_model([0, 0, 0])
23
- assert len(G) == 3
24
- assert G.number_of_edges() == 0
25
-
26
- def test_degree_sequence(self):
27
- """Tests that the degree sequence of the generated graph matches
28
- the input degree sequence.
29
-
30
- """
31
- deg_seq = [5, 3, 3, 3, 3, 2, 2, 2, 1, 1, 1]
32
- G = nx.configuration_model(deg_seq, seed=12345678)
33
- assert sorted(dict(G.degree).values()) == sorted(deg_seq)
34
- assert sorted(dict(G.degree(range(len(deg_seq)))).values()) == sorted(deg_seq)
35
-
36
- @pytest.mark.parametrize("seed", [10, 1000])
37
- def test_random_seed(self, seed):
38
- """Tests that each call with the same random seed generates the
39
- same graph.
40
-
41
- """
42
- deg_seq = [3] * 12
43
- G1 = nx.configuration_model(deg_seq, seed=seed)
44
- G2 = nx.configuration_model(deg_seq, seed=seed)
45
- assert nx.is_isomorphic(G1, G2)
46
-
47
- def test_directed_disallowed(self):
48
- """Tests that attempting to create a configuration model graph
49
- using a directed graph yields an exception.
50
-
51
- """
52
- with pytest.raises(nx.NetworkXNotImplemented):
53
- nx.configuration_model([], create_using=nx.DiGraph())
54
-
55
- def test_odd_degree_sum(self):
56
- """Tests that a degree sequence whose sum is odd yields an
57
- exception.
58
-
59
- """
60
- with pytest.raises(nx.NetworkXError):
61
- nx.configuration_model([1, 2])
62
-
63
-
64
- def test_directed_configuration_raise_unequal():
65
- with pytest.raises(nx.NetworkXError):
66
- zin = [5, 3, 3, 3, 3, 2, 2, 2, 1, 1]
67
- zout = [5, 3, 3, 3, 3, 2, 2, 2, 1, 2]
68
- nx.directed_configuration_model(zin, zout)
69
-
70
-
71
- def test_directed_configuration_model():
72
- G = nx.directed_configuration_model([], [], seed=0)
73
- assert len(G) == 0
74
-
75
-
76
- def test_simple_directed_configuration_model():
77
- G = nx.directed_configuration_model([1, 1], [1, 1], seed=0)
78
- assert len(G) == 2
79
-
80
-
81
- def test_expected_degree_graph_empty():
82
- # empty graph has empty degree sequence
83
- deg_seq = []
84
- G = nx.expected_degree_graph(deg_seq)
85
- assert dict(G.degree()) == {}
86
-
87
-
88
- @pytest.mark.parametrize("seed", [10, 42, 1000])
89
- @pytest.mark.parametrize("deg_seq", [[3] * 12, [2, 0], [10, 2, 2, 2, 2]])
90
- def test_expected_degree_graph(seed, deg_seq):
91
- G1 = nx.expected_degree_graph(deg_seq, seed=seed)
92
- G2 = nx.expected_degree_graph(deg_seq, seed=seed)
93
- assert len(G1) == len(G2) == len(deg_seq)
94
- assert nx.is_isomorphic(G1, G2)
95
-
96
-
97
- def test_expected_degree_graph_selfloops():
98
- deg_seq = [3] * 12
99
- G1 = nx.expected_degree_graph(deg_seq, seed=1000, selfloops=False)
100
- G2 = nx.expected_degree_graph(deg_seq, seed=1000, selfloops=False)
101
- assert len(G1) == len(G2) == len(deg_seq)
102
- assert nx.is_isomorphic(G1, G2)
103
- assert nx.number_of_selfloops(G1) == nx.number_of_selfloops(G2) == 0
104
-
105
-
106
- def test_havel_hakimi_construction():
107
- G = nx.havel_hakimi_graph([])
108
- assert len(G) == 0
109
-
110
- z = [1000, 3, 3, 3, 3, 2, 2, 2, 1, 1, 1]
111
- pytest.raises(nx.NetworkXError, nx.havel_hakimi_graph, z)
112
- z = ["A", 3, 3, 3, 3, 2, 2, 2, 1, 1, 1]
113
- pytest.raises(nx.NetworkXError, nx.havel_hakimi_graph, z)
114
-
115
- z = [5, 4, 3, 3, 3, 2, 2, 2]
116
- G = nx.havel_hakimi_graph(z)
117
- G = nx.configuration_model(z)
118
- z = [6, 5, 4, 4, 2, 1, 1, 1]
119
- pytest.raises(nx.NetworkXError, nx.havel_hakimi_graph, z)
120
-
121
- z = [10, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2]
122
-
123
- G = nx.havel_hakimi_graph(z)
124
-
125
- pytest.raises(nx.NetworkXError, nx.havel_hakimi_graph, z, create_using=nx.DiGraph())
126
-
127
-
128
- def test_directed_havel_hakimi():
129
- # Test range of valid directed degree sequences
130
- n, r = 100, 10
131
- p = 1.0 / r
132
- for i in range(r):
133
- G1 = nx.erdos_renyi_graph(n, p * (i + 1), None, True)
134
- din1 = [d for n, d in G1.in_degree()]
135
- dout1 = [d for n, d in G1.out_degree()]
136
- G2 = nx.directed_havel_hakimi_graph(din1, dout1)
137
- din2 = [d for n, d in G2.in_degree()]
138
- dout2 = [d for n, d in G2.out_degree()]
139
- assert sorted(din1) == sorted(din2)
140
- assert sorted(dout1) == sorted(dout2)
141
-
142
- # Test non-graphical sequence
143
- dout = [1000, 3, 3, 3, 3, 2, 2, 2, 1, 1, 1]
144
- din = [103, 102, 102, 102, 102, 102, 102, 102, 102, 102]
145
- pytest.raises(nx.exception.NetworkXError, nx.directed_havel_hakimi_graph, din, dout)
146
- # Test valid sequences
147
- dout = [1, 1, 1, 1, 1, 2, 2, 2, 3, 4]
148
- din = [2, 2, 2, 2, 2, 2, 2, 2, 0, 2]
149
- G2 = nx.directed_havel_hakimi_graph(din, dout)
150
- dout2 = (d for n, d in G2.out_degree())
151
- din2 = (d for n, d in G2.in_degree())
152
- assert sorted(dout) == sorted(dout2)
153
- assert sorted(din) == sorted(din2)
154
- # Test unequal sums
155
- din = [2, 2, 2, 2, 2, 2, 2, 2, 2, 2]
156
- pytest.raises(nx.exception.NetworkXError, nx.directed_havel_hakimi_graph, din, dout)
157
- # Test for negative values
158
- din = [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -2]
159
- pytest.raises(nx.exception.NetworkXError, nx.directed_havel_hakimi_graph, din, dout)
160
-
161
-
162
- @pytest.mark.parametrize(
163
- "deg_seq",
164
- [
165
- [0],
166
- [1, 1],
167
- [2, 2, 2, 1, 1],
168
- [3, 1, 1, 1],
169
- [4, 1, 1, 1, 1],
170
- [1, 1, 1, 1, 1, 2, 2, 2, 3, 4],
171
- ],
172
- )
173
- def test_degree_sequence_tree(deg_seq):
174
- G = nx.degree_sequence_tree(deg_seq)
175
- assert sorted(dict(G.degree).values()) == sorted(deg_seq)
176
- assert nx.is_tree(G)
177
-
178
-
179
- @pytest.mark.parametrize("graph_type", [nx.DiGraph, nx.MultiDiGraph])
180
- def test_degree_sequence_tree_directed(graph_type):
181
- with pytest.raises(nx.NetworkXError, match="Directed Graph not supported"):
182
- nx.degree_sequence_tree([1, 1], create_using=graph_type())
183
-
184
-
185
- @pytest.mark.parametrize(
186
- "deg_seq",
187
- [
188
- [1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 4],
189
- [],
190
- [2, 0],
191
- [-1, 3],
192
- [1, 16, 1, 4, 0, 0, 1, 1, 0, 1, 2, 0, 1, 0, 1, 5, 1, 2, 1, 0],
193
- ],
194
- )
195
- def test_degree_sequence_tree_invalid_degree_sequence(deg_seq):
196
- """Test invalid degree sequences raise an error."""
197
- with pytest.raises(nx.NetworkXError, match="tree must have"):
198
- nx.degree_sequence_tree(deg_seq)
199
-
200
-
201
- def test_random_degree_sequence_graph():
202
- d = [1, 2, 2, 3]
203
- G = nx.random_degree_sequence_graph(d, seed=42)
204
- assert d == sorted(d for n, d in G.degree())
205
-
206
-
207
- def test_random_degree_sequence_graph_raise():
208
- z = [1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 4]
209
- pytest.raises(nx.NetworkXUnfeasible, nx.random_degree_sequence_graph, z)
210
-
211
-
212
- def test_random_degree_sequence_large():
213
- G1 = nx.fast_gnp_random_graph(100, 0.1, seed=42)
214
- d1 = [d for n, d in G1.degree()]
215
- G2 = nx.random_degree_sequence_graph(d1, seed=42)
216
- d2 = [d for n, d in G2.degree()]
217
- assert sorted(d1) == sorted(d2)
218
-
219
-
220
- def test_random_degree_sequence_iterator():
221
- G1 = nx.fast_gnp_random_graph(100, 0.1, seed=42)
222
- d1 = (d for n, d in G1.degree())
223
- G2 = nx.random_degree_sequence_graph(d1, seed=42)
224
- assert len(G2) > 0