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,642 +0,0 @@
1
- """
2
- Unit tests for dedensification and graph summarization
3
- """
4
-
5
- import pytest
6
-
7
- import networkx as nx
8
-
9
-
10
- class TestDirectedDedensification:
11
- def build_original_graph(self):
12
- original_matrix = [
13
- ("1", "BC"),
14
- ("2", "ABC"),
15
- ("3", ["A", "B", "6"]),
16
- ("4", "ABC"),
17
- ("5", "AB"),
18
- ("6", ["5"]),
19
- ("A", ["6"]),
20
- ]
21
- graph = nx.DiGraph()
22
- for source, targets in original_matrix:
23
- for target in targets:
24
- graph.add_edge(source, target)
25
- return graph
26
-
27
- def build_compressed_graph(self):
28
- compressed_matrix = [
29
- ("1", "BC"),
30
- ("2", ["ABC"]),
31
- ("3", ["A", "B", "6"]),
32
- ("4", ["ABC"]),
33
- ("5", "AB"),
34
- ("6", ["5"]),
35
- ("A", ["6"]),
36
- ("ABC", "ABC"),
37
- ]
38
- compressed_graph = nx.DiGraph()
39
- for source, targets in compressed_matrix:
40
- for target in targets:
41
- compressed_graph.add_edge(source, target)
42
- return compressed_graph
43
-
44
- def test_empty(self):
45
- """
46
- Verify that an empty directed graph results in no compressor nodes
47
- """
48
- G = nx.DiGraph()
49
- compressed_graph, c_nodes = nx.dedensify(G, threshold=2)
50
- assert c_nodes == set()
51
-
52
- @staticmethod
53
- def densify(G, compressor_nodes, copy=True):
54
- """
55
- Reconstructs the original graph from a dedensified, directed graph
56
-
57
- Parameters
58
- ----------
59
- G: dedensified graph
60
- A networkx graph
61
- compressor_nodes: iterable
62
- Iterable of compressor nodes in the dedensified graph
63
- inplace: bool, optional (default: False)
64
- Indicates if densification should be done inplace
65
-
66
- Returns
67
- -------
68
- G: graph
69
- A densified networkx graph
70
- """
71
- if copy:
72
- G = G.copy()
73
- for compressor_node in compressor_nodes:
74
- all_neighbors = set(nx.all_neighbors(G, compressor_node))
75
- out_neighbors = set(G.neighbors(compressor_node))
76
- for out_neighbor in out_neighbors:
77
- G.remove_edge(compressor_node, out_neighbor)
78
- in_neighbors = all_neighbors - out_neighbors
79
- for in_neighbor in in_neighbors:
80
- G.remove_edge(in_neighbor, compressor_node)
81
- for out_neighbor in out_neighbors:
82
- G.add_edge(in_neighbor, out_neighbor)
83
- G.remove_node(compressor_node)
84
- return G
85
-
86
- def setup_method(self):
87
- self.c_nodes = ("ABC",)
88
-
89
- def test_dedensify_edges(self):
90
- """
91
- Verifies that dedensify produced the correct edges to/from compressor
92
- nodes in a directed graph
93
- """
94
- G = self.build_original_graph()
95
- compressed_G = self.build_compressed_graph()
96
- compressed_graph, c_nodes = nx.dedensify(G, threshold=2)
97
- for s, t in compressed_graph.edges():
98
- o_s = "".join(sorted(s))
99
- o_t = "".join(sorted(t))
100
- compressed_graph_exists = compressed_graph.has_edge(s, t)
101
- verified_compressed_exists = compressed_G.has_edge(o_s, o_t)
102
- assert compressed_graph_exists == verified_compressed_exists
103
- assert len(c_nodes) == len(self.c_nodes)
104
-
105
- def test_dedensify_edge_count(self):
106
- """
107
- Verifies that dedensify produced the correct number of compressor nodes
108
- in a directed graph
109
- """
110
- G = self.build_original_graph()
111
- original_edge_count = len(G.edges())
112
- c_G, c_nodes = nx.dedensify(G, threshold=2)
113
- compressed_edge_count = len(c_G.edges())
114
- assert compressed_edge_count <= original_edge_count
115
- compressed_G = self.build_compressed_graph()
116
- assert compressed_edge_count == len(compressed_G.edges())
117
-
118
- def test_densify_edges(self):
119
- """
120
- Verifies that densification produces the correct edges from the
121
- original directed graph
122
- """
123
- compressed_G = self.build_compressed_graph()
124
- original_graph = self.densify(compressed_G, self.c_nodes, copy=True)
125
- G = self.build_original_graph()
126
- for s, t in G.edges():
127
- assert G.has_edge(s, t) == original_graph.has_edge(s, t)
128
-
129
- def test_densify_edge_count(self):
130
- """
131
- Verifies that densification produces the correct number of edges in the
132
- original directed graph
133
- """
134
- compressed_G = self.build_compressed_graph()
135
- compressed_edge_count = len(compressed_G.edges())
136
- original_graph = self.densify(compressed_G, self.c_nodes)
137
- original_edge_count = len(original_graph.edges())
138
- assert compressed_edge_count <= original_edge_count
139
- G = self.build_original_graph()
140
- assert original_edge_count == len(G.edges())
141
-
142
-
143
- class TestUnDirectedDedensification:
144
- def build_original_graph(self):
145
- """
146
- Builds graph shown in the original research paper
147
- """
148
- original_matrix = [
149
- ("1", "CB"),
150
- ("2", "ABC"),
151
- ("3", ["A", "B", "6"]),
152
- ("4", "ABC"),
153
- ("5", "AB"),
154
- ("6", ["5"]),
155
- ("A", ["6"]),
156
- ]
157
- graph = nx.Graph()
158
- for source, targets in original_matrix:
159
- for target in targets:
160
- graph.add_edge(source, target)
161
- return graph
162
-
163
- def test_empty(self):
164
- """
165
- Verify that an empty undirected graph results in no compressor nodes
166
- """
167
- G = nx.Graph()
168
- compressed_G, c_nodes = nx.dedensify(G, threshold=2)
169
- assert c_nodes == set()
170
-
171
- def setup_method(self):
172
- self.c_nodes = ("6AB", "ABC")
173
-
174
- def build_compressed_graph(self):
175
- compressed_matrix = [
176
- ("1", ["B", "C"]),
177
- ("2", ["ABC"]),
178
- ("3", ["6AB"]),
179
- ("4", ["ABC"]),
180
- ("5", ["6AB"]),
181
- ("6", ["6AB", "A"]),
182
- ("A", ["6AB", "ABC"]),
183
- ("B", ["ABC", "6AB"]),
184
- ("C", ["ABC"]),
185
- ]
186
- compressed_graph = nx.Graph()
187
- for source, targets in compressed_matrix:
188
- for target in targets:
189
- compressed_graph.add_edge(source, target)
190
- return compressed_graph
191
-
192
- def test_dedensify_edges(self):
193
- """
194
- Verifies that dedensify produced correct compressor nodes and the
195
- correct edges to/from the compressor nodes in an undirected graph
196
- """
197
- G = self.build_original_graph()
198
- c_G, c_nodes = nx.dedensify(G, threshold=2)
199
- v_compressed_G = self.build_compressed_graph()
200
- for s, t in c_G.edges():
201
- o_s = "".join(sorted(s))
202
- o_t = "".join(sorted(t))
203
- has_compressed_edge = c_G.has_edge(s, t)
204
- verified_has_compressed_edge = v_compressed_G.has_edge(o_s, o_t)
205
- assert has_compressed_edge == verified_has_compressed_edge
206
- assert len(c_nodes) == len(self.c_nodes)
207
-
208
- def test_dedensify_edge_count(self):
209
- """
210
- Verifies that dedensify produced the correct number of edges in an
211
- undirected graph
212
- """
213
- G = self.build_original_graph()
214
- c_G, c_nodes = nx.dedensify(G, threshold=2, copy=True)
215
- compressed_edge_count = len(c_G.edges())
216
- verified_original_edge_count = len(G.edges())
217
- assert compressed_edge_count <= verified_original_edge_count
218
- verified_compressed_G = self.build_compressed_graph()
219
- verified_compressed_edge_count = len(verified_compressed_G.edges())
220
- assert compressed_edge_count == verified_compressed_edge_count
221
-
222
-
223
- @pytest.mark.parametrize(
224
- "graph_type", [nx.Graph, nx.DiGraph, nx.MultiGraph, nx.MultiDiGraph]
225
- )
226
- def test_summarization_empty(graph_type):
227
- G = graph_type()
228
- summary_graph = nx.snap_aggregation(G, node_attributes=("color",))
229
- assert nx.is_isomorphic(summary_graph, G)
230
-
231
-
232
- class AbstractSNAP:
233
- node_attributes = ("color",)
234
-
235
- def build_original_graph(self):
236
- pass
237
-
238
- def build_summary_graph(self):
239
- pass
240
-
241
- def test_summary_graph(self):
242
- original_graph = self.build_original_graph()
243
- summary_graph = self.build_summary_graph()
244
-
245
- relationship_attributes = ("type",)
246
- generated_summary_graph = nx.snap_aggregation(
247
- original_graph, self.node_attributes, relationship_attributes
248
- )
249
- relabeled_summary_graph = self.deterministic_labels(generated_summary_graph)
250
- assert nx.is_isomorphic(summary_graph, relabeled_summary_graph)
251
-
252
- def deterministic_labels(self, G):
253
- node_labels = list(G.nodes)
254
- node_labels = sorted(node_labels, key=lambda n: sorted(G.nodes[n]["group"])[0])
255
- node_labels.sort()
256
-
257
- label_mapping = {}
258
- for index, node in enumerate(node_labels):
259
- label = f"Supernode-{index}"
260
- label_mapping[node] = label
261
-
262
- return nx.relabel_nodes(G, label_mapping)
263
-
264
-
265
- class TestSNAPNoEdgeTypes(AbstractSNAP):
266
- relationship_attributes = ()
267
-
268
- def test_summary_graph(self):
269
- original_graph = self.build_original_graph()
270
- summary_graph = self.build_summary_graph()
271
-
272
- relationship_attributes = ("type",)
273
- generated_summary_graph = nx.snap_aggregation(
274
- original_graph, self.node_attributes
275
- )
276
- relabeled_summary_graph = self.deterministic_labels(generated_summary_graph)
277
- assert nx.is_isomorphic(summary_graph, relabeled_summary_graph)
278
-
279
- def build_original_graph(self):
280
- nodes = {
281
- "A": {"color": "Red"},
282
- "B": {"color": "Red"},
283
- "C": {"color": "Red"},
284
- "D": {"color": "Red"},
285
- "E": {"color": "Blue"},
286
- "F": {"color": "Blue"},
287
- "G": {"color": "Blue"},
288
- "H": {"color": "Blue"},
289
- "I": {"color": "Yellow"},
290
- "J": {"color": "Yellow"},
291
- "K": {"color": "Yellow"},
292
- "L": {"color": "Yellow"},
293
- }
294
- edges = [
295
- ("A", "B"),
296
- ("A", "C"),
297
- ("A", "E"),
298
- ("A", "I"),
299
- ("B", "D"),
300
- ("B", "J"),
301
- ("B", "F"),
302
- ("C", "G"),
303
- ("D", "H"),
304
- ("I", "J"),
305
- ("J", "K"),
306
- ("I", "L"),
307
- ]
308
- G = nx.Graph()
309
- for node in nodes:
310
- attributes = nodes[node]
311
- G.add_node(node, **attributes)
312
-
313
- for source, target in edges:
314
- G.add_edge(source, target)
315
-
316
- return G
317
-
318
- def build_summary_graph(self):
319
- nodes = {
320
- "Supernode-0": {"color": "Red"},
321
- "Supernode-1": {"color": "Red"},
322
- "Supernode-2": {"color": "Blue"},
323
- "Supernode-3": {"color": "Blue"},
324
- "Supernode-4": {"color": "Yellow"},
325
- "Supernode-5": {"color": "Yellow"},
326
- }
327
- edges = [
328
- ("Supernode-0", "Supernode-0"),
329
- ("Supernode-0", "Supernode-1"),
330
- ("Supernode-0", "Supernode-2"),
331
- ("Supernode-0", "Supernode-4"),
332
- ("Supernode-1", "Supernode-3"),
333
- ("Supernode-4", "Supernode-4"),
334
- ("Supernode-4", "Supernode-5"),
335
- ]
336
- G = nx.Graph()
337
- for node in nodes:
338
- attributes = nodes[node]
339
- G.add_node(node, **attributes)
340
-
341
- for source, target in edges:
342
- G.add_edge(source, target)
343
-
344
- supernodes = {
345
- "Supernode-0": {"A", "B"},
346
- "Supernode-1": {"C", "D"},
347
- "Supernode-2": {"E", "F"},
348
- "Supernode-3": {"G", "H"},
349
- "Supernode-4": {"I", "J"},
350
- "Supernode-5": {"K", "L"},
351
- }
352
- nx.set_node_attributes(G, supernodes, "group")
353
- return G
354
-
355
-
356
- class TestSNAPUndirected(AbstractSNAP):
357
- def build_original_graph(self):
358
- nodes = {
359
- "A": {"color": "Red"},
360
- "B": {"color": "Red"},
361
- "C": {"color": "Red"},
362
- "D": {"color": "Red"},
363
- "E": {"color": "Blue"},
364
- "F": {"color": "Blue"},
365
- "G": {"color": "Blue"},
366
- "H": {"color": "Blue"},
367
- "I": {"color": "Yellow"},
368
- "J": {"color": "Yellow"},
369
- "K": {"color": "Yellow"},
370
- "L": {"color": "Yellow"},
371
- }
372
- edges = [
373
- ("A", "B", "Strong"),
374
- ("A", "C", "Weak"),
375
- ("A", "E", "Strong"),
376
- ("A", "I", "Weak"),
377
- ("B", "D", "Weak"),
378
- ("B", "J", "Weak"),
379
- ("B", "F", "Strong"),
380
- ("C", "G", "Weak"),
381
- ("D", "H", "Weak"),
382
- ("I", "J", "Strong"),
383
- ("J", "K", "Strong"),
384
- ("I", "L", "Strong"),
385
- ]
386
- G = nx.Graph()
387
- for node in nodes:
388
- attributes = nodes[node]
389
- G.add_node(node, **attributes)
390
-
391
- for source, target, type in edges:
392
- G.add_edge(source, target, type=type)
393
-
394
- return G
395
-
396
- def build_summary_graph(self):
397
- nodes = {
398
- "Supernode-0": {"color": "Red"},
399
- "Supernode-1": {"color": "Red"},
400
- "Supernode-2": {"color": "Blue"},
401
- "Supernode-3": {"color": "Blue"},
402
- "Supernode-4": {"color": "Yellow"},
403
- "Supernode-5": {"color": "Yellow"},
404
- }
405
- edges = [
406
- ("Supernode-0", "Supernode-0", "Strong"),
407
- ("Supernode-0", "Supernode-1", "Weak"),
408
- ("Supernode-0", "Supernode-2", "Strong"),
409
- ("Supernode-0", "Supernode-4", "Weak"),
410
- ("Supernode-1", "Supernode-3", "Weak"),
411
- ("Supernode-4", "Supernode-4", "Strong"),
412
- ("Supernode-4", "Supernode-5", "Strong"),
413
- ]
414
- G = nx.Graph()
415
- for node in nodes:
416
- attributes = nodes[node]
417
- G.add_node(node, **attributes)
418
-
419
- for source, target, type in edges:
420
- G.add_edge(source, target, types=[{"type": type}])
421
-
422
- supernodes = {
423
- "Supernode-0": {"A", "B"},
424
- "Supernode-1": {"C", "D"},
425
- "Supernode-2": {"E", "F"},
426
- "Supernode-3": {"G", "H"},
427
- "Supernode-4": {"I", "J"},
428
- "Supernode-5": {"K", "L"},
429
- }
430
- nx.set_node_attributes(G, supernodes, "group")
431
- return G
432
-
433
-
434
- class TestSNAPDirected(AbstractSNAP):
435
- def build_original_graph(self):
436
- nodes = {
437
- "A": {"color": "Red"},
438
- "B": {"color": "Red"},
439
- "C": {"color": "Green"},
440
- "D": {"color": "Green"},
441
- "E": {"color": "Blue"},
442
- "F": {"color": "Blue"},
443
- "G": {"color": "Yellow"},
444
- "H": {"color": "Yellow"},
445
- }
446
- edges = [
447
- ("A", "C", "Strong"),
448
- ("A", "E", "Strong"),
449
- ("A", "F", "Weak"),
450
- ("B", "D", "Strong"),
451
- ("B", "E", "Weak"),
452
- ("B", "F", "Strong"),
453
- ("C", "G", "Strong"),
454
- ("C", "F", "Strong"),
455
- ("D", "E", "Strong"),
456
- ("D", "H", "Strong"),
457
- ("G", "E", "Strong"),
458
- ("H", "F", "Strong"),
459
- ]
460
- G = nx.DiGraph()
461
- for node in nodes:
462
- attributes = nodes[node]
463
- G.add_node(node, **attributes)
464
-
465
- for source, target, type in edges:
466
- G.add_edge(source, target, type=type)
467
-
468
- return G
469
-
470
- def build_summary_graph(self):
471
- nodes = {
472
- "Supernode-0": {"color": "Red"},
473
- "Supernode-1": {"color": "Green"},
474
- "Supernode-2": {"color": "Blue"},
475
- "Supernode-3": {"color": "Yellow"},
476
- }
477
- edges = [
478
- ("Supernode-0", "Supernode-1", [{"type": "Strong"}]),
479
- ("Supernode-0", "Supernode-2", [{"type": "Weak"}, {"type": "Strong"}]),
480
- ("Supernode-1", "Supernode-2", [{"type": "Strong"}]),
481
- ("Supernode-1", "Supernode-3", [{"type": "Strong"}]),
482
- ("Supernode-3", "Supernode-2", [{"type": "Strong"}]),
483
- ]
484
- G = nx.DiGraph()
485
- for node in nodes:
486
- attributes = nodes[node]
487
- G.add_node(node, **attributes)
488
-
489
- for source, target, types in edges:
490
- G.add_edge(source, target, types=types)
491
-
492
- supernodes = {
493
- "Supernode-0": {"A", "B"},
494
- "Supernode-1": {"C", "D"},
495
- "Supernode-2": {"E", "F"},
496
- "Supernode-3": {"G", "H"},
497
- "Supernode-4": {"I", "J"},
498
- "Supernode-5": {"K", "L"},
499
- }
500
- nx.set_node_attributes(G, supernodes, "group")
501
- return G
502
-
503
-
504
- class TestSNAPUndirectedMulti(AbstractSNAP):
505
- def build_original_graph(self):
506
- nodes = {
507
- "A": {"color": "Red"},
508
- "B": {"color": "Red"},
509
- "C": {"color": "Red"},
510
- "D": {"color": "Blue"},
511
- "E": {"color": "Blue"},
512
- "F": {"color": "Blue"},
513
- "G": {"color": "Yellow"},
514
- "H": {"color": "Yellow"},
515
- "I": {"color": "Yellow"},
516
- }
517
- edges = [
518
- ("A", "D", ["Weak", "Strong"]),
519
- ("B", "E", ["Weak", "Strong"]),
520
- ("D", "I", ["Strong"]),
521
- ("E", "H", ["Strong"]),
522
- ("F", "G", ["Weak"]),
523
- ("I", "G", ["Weak", "Strong"]),
524
- ("I", "H", ["Weak", "Strong"]),
525
- ("G", "H", ["Weak", "Strong"]),
526
- ]
527
- G = nx.MultiGraph()
528
- for node in nodes:
529
- attributes = nodes[node]
530
- G.add_node(node, **attributes)
531
-
532
- for source, target, types in edges:
533
- for type in types:
534
- G.add_edge(source, target, type=type)
535
-
536
- return G
537
-
538
- def build_summary_graph(self):
539
- nodes = {
540
- "Supernode-0": {"color": "Red"},
541
- "Supernode-1": {"color": "Blue"},
542
- "Supernode-2": {"color": "Yellow"},
543
- "Supernode-3": {"color": "Blue"},
544
- "Supernode-4": {"color": "Yellow"},
545
- "Supernode-5": {"color": "Red"},
546
- }
547
- edges = [
548
- ("Supernode-1", "Supernode-2", [{"type": "Weak"}]),
549
- ("Supernode-2", "Supernode-4", [{"type": "Weak"}, {"type": "Strong"}]),
550
- ("Supernode-3", "Supernode-4", [{"type": "Strong"}]),
551
- ("Supernode-3", "Supernode-5", [{"type": "Weak"}, {"type": "Strong"}]),
552
- ("Supernode-4", "Supernode-4", [{"type": "Weak"}, {"type": "Strong"}]),
553
- ]
554
- G = nx.MultiGraph()
555
- for node in nodes:
556
- attributes = nodes[node]
557
- G.add_node(node, **attributes)
558
-
559
- for source, target, types in edges:
560
- for type in types:
561
- G.add_edge(source, target, type=type)
562
-
563
- supernodes = {
564
- "Supernode-0": {"A", "B"},
565
- "Supernode-1": {"C", "D"},
566
- "Supernode-2": {"E", "F"},
567
- "Supernode-3": {"G", "H"},
568
- "Supernode-4": {"I", "J"},
569
- "Supernode-5": {"K", "L"},
570
- }
571
- nx.set_node_attributes(G, supernodes, "group")
572
- return G
573
-
574
-
575
- class TestSNAPDirectedMulti(AbstractSNAP):
576
- def build_original_graph(self):
577
- nodes = {
578
- "A": {"color": "Red"},
579
- "B": {"color": "Red"},
580
- "C": {"color": "Green"},
581
- "D": {"color": "Green"},
582
- "E": {"color": "Blue"},
583
- "F": {"color": "Blue"},
584
- "G": {"color": "Yellow"},
585
- "H": {"color": "Yellow"},
586
- }
587
- edges = [
588
- ("A", "C", ["Weak", "Strong"]),
589
- ("A", "E", ["Strong"]),
590
- ("A", "F", ["Weak"]),
591
- ("B", "D", ["Weak", "Strong"]),
592
- ("B", "E", ["Weak"]),
593
- ("B", "F", ["Strong"]),
594
- ("C", "G", ["Weak", "Strong"]),
595
- ("C", "F", ["Strong"]),
596
- ("D", "E", ["Strong"]),
597
- ("D", "H", ["Weak", "Strong"]),
598
- ("G", "E", ["Strong"]),
599
- ("H", "F", ["Strong"]),
600
- ]
601
- G = nx.MultiDiGraph()
602
- for node in nodes:
603
- attributes = nodes[node]
604
- G.add_node(node, **attributes)
605
-
606
- for source, target, types in edges:
607
- for type in types:
608
- G.add_edge(source, target, type=type)
609
-
610
- return G
611
-
612
- def build_summary_graph(self):
613
- nodes = {
614
- "Supernode-0": {"color": "Red"},
615
- "Supernode-1": {"color": "Blue"},
616
- "Supernode-2": {"color": "Yellow"},
617
- "Supernode-3": {"color": "Blue"},
618
- }
619
- edges = [
620
- ("Supernode-0", "Supernode-1", ["Weak", "Strong"]),
621
- ("Supernode-0", "Supernode-2", ["Weak", "Strong"]),
622
- ("Supernode-1", "Supernode-2", ["Strong"]),
623
- ("Supernode-1", "Supernode-3", ["Weak", "Strong"]),
624
- ("Supernode-3", "Supernode-2", ["Strong"]),
625
- ]
626
- G = nx.MultiDiGraph()
627
- for node in nodes:
628
- attributes = nodes[node]
629
- G.add_node(node, **attributes)
630
-
631
- for source, target, types in edges:
632
- for type in types:
633
- G.add_edge(source, target, type=type)
634
-
635
- supernodes = {
636
- "Supernode-0": {"A", "B"},
637
- "Supernode-1": {"C", "D"},
638
- "Supernode-2": {"E", "F"},
639
- "Supernode-3": {"G", "H"},
640
- }
641
- nx.set_node_attributes(G, supernodes, "group")
642
- return G