okstra 0.130.4 → 0.131.1

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 (365) hide show
  1. package/README.md +0 -1
  2. package/docs/architecture.md +2 -2
  3. package/docs/cli.md +1 -1
  4. package/docs/for-ai/README.md +0 -2
  5. package/docs/for-ai/skills/okstra-run.md +13 -2
  6. package/docs/for-ai/skills/okstra-setup.md +4 -1
  7. package/docs/project-structure-overview.md +5 -4
  8. package/docs/task-process/implementation-planning.md +13 -0
  9. package/docs/task-process/implementation.md +17 -2
  10. package/package.json +1 -1
  11. package/runtime/BUILD.json +2 -2
  12. package/runtime/agents/workers/report-writer-worker.md +7 -0
  13. package/runtime/bin/lib/okstra/usage.sh +4 -4
  14. package/runtime/prompts/lead/okstra-lead-contract.md +2 -2
  15. package/runtime/prompts/lead/plan-body-verification.md +26 -5
  16. package/runtime/prompts/lead/report-writer.md +6 -2
  17. package/runtime/prompts/profiles/_common-contract.md +2 -1
  18. package/runtime/prompts/profiles/_implementation-deliverable.md +6 -1
  19. package/runtime/prompts/profiles/_implementation-executor.md +2 -2
  20. package/runtime/prompts/profiles/_implementation-verifier.md +33 -10
  21. package/runtime/prompts/profiles/final-verification.md +21 -6
  22. package/runtime/prompts/profiles/implementation-planning.md +16 -4
  23. package/runtime/python/okstra_ctl/codex_dispatch.py +31 -0
  24. package/runtime/python/okstra_ctl/conformance.py +49 -11
  25. package/runtime/python/okstra_ctl/report_finalize.py +52 -1
  26. package/runtime/python/okstra_ctl/run.py +15 -3
  27. package/runtime/python/okstra_ctl/worker_prompt_contract.py +14 -6
  28. package/runtime/python/okstra_ctl/worker_prompt_policy.py +19 -1
  29. package/runtime/python/okstra_vendor/__init__.py +0 -44
  30. package/runtime/schemas/final-report-v1.0.schema.json +99 -5
  31. package/runtime/skills/okstra-run/SKILL.md +11 -4
  32. package/runtime/skills/okstra-setup/SKILL.md +3 -2
  33. package/runtime/skills/okstra-setup/references/project-config.md +16 -7
  34. package/runtime/templates/reports/final-report.template.md +15 -9
  35. package/runtime/templates/reports/i18n/en.json +1 -0
  36. package/runtime/templates/reports/i18n/ko.json +1 -0
  37. package/runtime/validators/lib/fixtures.sh +6 -0
  38. package/runtime/validators/validate-run.py +2019 -96
  39. package/src/cli-registry.mjs +0 -7
  40. package/src/commands/lifecycle/doctor.mjs +0 -9
  41. package/src/lib/skill-catalog.mjs +0 -1
  42. package/docs/for-ai/skills/okstra-graphify.md +0 -64
  43. package/runtime/python/okstra_ctl/graphify_cmd.py +0 -225
  44. package/runtime/python/okstra_vendor/graphify/.vendored-version +0 -1
  45. package/runtime/python/okstra_vendor/graphify/__init__.py +0 -28
  46. package/runtime/python/okstra_vendor/graphify/__main__.py +0 -1371
  47. package/runtime/python/okstra_vendor/graphify/analyze.py +0 -540
  48. package/runtime/python/okstra_vendor/graphify/benchmark.py +0 -129
  49. package/runtime/python/okstra_vendor/graphify/build.py +0 -107
  50. package/runtime/python/okstra_vendor/graphify/cache.py +0 -169
  51. package/runtime/python/okstra_vendor/graphify/cluster.py +0 -137
  52. package/runtime/python/okstra_vendor/graphify/detect.py +0 -510
  53. package/runtime/python/okstra_vendor/graphify/export.py +0 -1014
  54. package/runtime/python/okstra_vendor/graphify/extract.py +0 -3277
  55. package/runtime/python/okstra_vendor/graphify/hooks.py +0 -220
  56. package/runtime/python/okstra_vendor/graphify/ingest.py +0 -297
  57. package/runtime/python/okstra_vendor/graphify/manifest.py +0 -4
  58. package/runtime/python/okstra_vendor/graphify/report.py +0 -175
  59. package/runtime/python/okstra_vendor/graphify/security.py +0 -203
  60. package/runtime/python/okstra_vendor/graphify/serve.py +0 -373
  61. package/runtime/python/okstra_vendor/graphify/skill-aider.md +0 -1184
  62. package/runtime/python/okstra_vendor/graphify/skill-claw.md +0 -1184
  63. package/runtime/python/okstra_vendor/graphify/skill-codex.md +0 -1242
  64. package/runtime/python/okstra_vendor/graphify/skill-copilot.md +0 -1268
  65. package/runtime/python/okstra_vendor/graphify/skill-droid.md +0 -1239
  66. package/runtime/python/okstra_vendor/graphify/skill-kiro.md +0 -1183
  67. package/runtime/python/okstra_vendor/graphify/skill-opencode.md +0 -1238
  68. package/runtime/python/okstra_vendor/graphify/skill-trae.md +0 -1208
  69. package/runtime/python/okstra_vendor/graphify/skill-vscode.md +0 -253
  70. package/runtime/python/okstra_vendor/graphify/skill-windows.md +0 -1245
  71. package/runtime/python/okstra_vendor/graphify/skill.md +0 -1319
  72. package/runtime/python/okstra_vendor/graphify/transcribe.py +0 -182
  73. package/runtime/python/okstra_vendor/graphify/validate.py +0 -72
  74. package/runtime/python/okstra_vendor/graphify/watch.py +0 -188
  75. package/runtime/python/okstra_vendor/graphify/wiki.py +0 -214
  76. package/runtime/python/okstra_vendor/networkx/__init__.py +0 -62
  77. package/runtime/python/okstra_vendor/networkx/algorithms/__init__.py +0 -134
  78. package/runtime/python/okstra_vendor/networkx/algorithms/approximation/__init__.py +0 -26
  79. package/runtime/python/okstra_vendor/networkx/algorithms/approximation/clique.py +0 -259
  80. package/runtime/python/okstra_vendor/networkx/algorithms/approximation/clustering_coefficient.py +0 -71
  81. package/runtime/python/okstra_vendor/networkx/algorithms/approximation/connectivity.py +0 -412
  82. package/runtime/python/okstra_vendor/networkx/algorithms/approximation/density.py +0 -396
  83. package/runtime/python/okstra_vendor/networkx/algorithms/approximation/distance_measures.py +0 -150
  84. package/runtime/python/okstra_vendor/networkx/algorithms/approximation/dominating_set.py +0 -149
  85. package/runtime/python/okstra_vendor/networkx/algorithms/approximation/kcomponents.py +0 -369
  86. package/runtime/python/okstra_vendor/networkx/algorithms/approximation/matching.py +0 -44
  87. package/runtime/python/okstra_vendor/networkx/algorithms/approximation/maxcut.py +0 -143
  88. package/runtime/python/okstra_vendor/networkx/algorithms/approximation/ramsey.py +0 -53
  89. package/runtime/python/okstra_vendor/networkx/algorithms/approximation/steinertree.py +0 -265
  90. package/runtime/python/okstra_vendor/networkx/algorithms/approximation/traveling_salesman.py +0 -1508
  91. package/runtime/python/okstra_vendor/networkx/algorithms/approximation/treewidth.py +0 -255
  92. package/runtime/python/okstra_vendor/networkx/algorithms/approximation/vertex_cover.py +0 -83
  93. package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/__init__.py +0 -5
  94. package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/connectivity.py +0 -122
  95. package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/correlation.py +0 -302
  96. package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/mixing.py +0 -255
  97. package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/neighbor_degree.py +0 -160
  98. package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/pairs.py +0 -127
  99. package/runtime/python/okstra_vendor/networkx/algorithms/asteroidal.py +0 -164
  100. package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/__init__.py +0 -88
  101. package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/basic.py +0 -322
  102. package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/centrality.py +0 -290
  103. package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/cluster.py +0 -289
  104. package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/covering.py +0 -57
  105. package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/edgelist.py +0 -360
  106. package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/extendability.py +0 -105
  107. package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/generators.py +0 -603
  108. package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/link_analysis.py +0 -316
  109. package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/matching.py +0 -590
  110. package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/matrix.py +0 -232
  111. package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/projection.py +0 -526
  112. package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/redundancy.py +0 -112
  113. package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/spectral.py +0 -69
  114. package/runtime/python/okstra_vendor/networkx/algorithms/boundary.py +0 -168
  115. package/runtime/python/okstra_vendor/networkx/algorithms/bridges.py +0 -205
  116. package/runtime/python/okstra_vendor/networkx/algorithms/broadcasting.py +0 -164
  117. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/__init__.py +0 -20
  118. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/betweenness.py +0 -591
  119. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/betweenness_subset.py +0 -236
  120. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/closeness.py +0 -282
  121. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/current_flow_betweenness.py +0 -364
  122. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/current_flow_betweenness_subset.py +0 -227
  123. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/current_flow_closeness.py +0 -96
  124. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/degree_alg.py +0 -150
  125. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/dispersion.py +0 -107
  126. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/eigenvector.py +0 -357
  127. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/flow_matrix.py +0 -130
  128. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/group.py +0 -787
  129. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/harmonic.py +0 -88
  130. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/katz.py +0 -331
  131. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/laplacian.py +0 -150
  132. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/load.py +0 -200
  133. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/percolation.py +0 -128
  134. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/reaching.py +0 -209
  135. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/second_order.py +0 -141
  136. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/subgraph_alg.py +0 -361
  137. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/trophic.py +0 -181
  138. package/runtime/python/okstra_vendor/networkx/algorithms/centrality/voterank_alg.py +0 -95
  139. package/runtime/python/okstra_vendor/networkx/algorithms/chains.py +0 -172
  140. package/runtime/python/okstra_vendor/networkx/algorithms/chordal.py +0 -443
  141. package/runtime/python/okstra_vendor/networkx/algorithms/clique.py +0 -818
  142. package/runtime/python/okstra_vendor/networkx/algorithms/cluster.py +0 -732
  143. package/runtime/python/okstra_vendor/networkx/algorithms/coloring/__init__.py +0 -4
  144. package/runtime/python/okstra_vendor/networkx/algorithms/coloring/equitable_coloring.py +0 -505
  145. package/runtime/python/okstra_vendor/networkx/algorithms/coloring/greedy_coloring.py +0 -565
  146. package/runtime/python/okstra_vendor/networkx/algorithms/communicability_alg.py +0 -163
  147. package/runtime/python/okstra_vendor/networkx/algorithms/community/__init__.py +0 -28
  148. package/runtime/python/okstra_vendor/networkx/algorithms/community/asyn_fluid.py +0 -153
  149. package/runtime/python/okstra_vendor/networkx/algorithms/community/bipartitions.py +0 -354
  150. package/runtime/python/okstra_vendor/networkx/algorithms/community/centrality.py +0 -171
  151. package/runtime/python/okstra_vendor/networkx/algorithms/community/community_utils.py +0 -30
  152. package/runtime/python/okstra_vendor/networkx/algorithms/community/divisive.py +0 -216
  153. package/runtime/python/okstra_vendor/networkx/algorithms/community/kclique.py +0 -79
  154. package/runtime/python/okstra_vendor/networkx/algorithms/community/label_propagation.py +0 -338
  155. package/runtime/python/okstra_vendor/networkx/algorithms/community/leiden.py +0 -162
  156. package/runtime/python/okstra_vendor/networkx/algorithms/community/local.py +0 -220
  157. package/runtime/python/okstra_vendor/networkx/algorithms/community/louvain.py +0 -384
  158. package/runtime/python/okstra_vendor/networkx/algorithms/community/lukes.py +0 -227
  159. package/runtime/python/okstra_vendor/networkx/algorithms/community/modularity_max.py +0 -452
  160. package/runtime/python/okstra_vendor/networkx/algorithms/community/quality.py +0 -347
  161. package/runtime/python/okstra_vendor/networkx/algorithms/components/__init__.py +0 -6
  162. package/runtime/python/okstra_vendor/networkx/algorithms/components/attracting.py +0 -115
  163. package/runtime/python/okstra_vendor/networkx/algorithms/components/biconnected.py +0 -394
  164. package/runtime/python/okstra_vendor/networkx/algorithms/components/connected.py +0 -282
  165. package/runtime/python/okstra_vendor/networkx/algorithms/components/semiconnected.py +0 -71
  166. package/runtime/python/okstra_vendor/networkx/algorithms/components/strongly_connected.py +0 -359
  167. package/runtime/python/okstra_vendor/networkx/algorithms/components/weakly_connected.py +0 -196
  168. package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/__init__.py +0 -11
  169. package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/connectivity.py +0 -811
  170. package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/cuts.py +0 -616
  171. package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/disjoint_paths.py +0 -408
  172. package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/edge_augmentation.py +0 -1270
  173. package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/edge_kcomponents.py +0 -592
  174. package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/kcomponents.py +0 -220
  175. package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/kcutsets.py +0 -235
  176. package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/stoerwagner.py +0 -152
  177. package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/utils.py +0 -88
  178. package/runtime/python/okstra_vendor/networkx/algorithms/core.py +0 -588
  179. package/runtime/python/okstra_vendor/networkx/algorithms/covering.py +0 -142
  180. package/runtime/python/okstra_vendor/networkx/algorithms/cuts.py +0 -416
  181. package/runtime/python/okstra_vendor/networkx/algorithms/cycles.py +0 -1234
  182. package/runtime/python/okstra_vendor/networkx/algorithms/d_separation.py +0 -677
  183. package/runtime/python/okstra_vendor/networkx/algorithms/dag.py +0 -1392
  184. package/runtime/python/okstra_vendor/networkx/algorithms/distance_measures.py +0 -1095
  185. package/runtime/python/okstra_vendor/networkx/algorithms/distance_regular.py +0 -272
  186. package/runtime/python/okstra_vendor/networkx/algorithms/dominance.py +0 -142
  187. package/runtime/python/okstra_vendor/networkx/algorithms/dominating.py +0 -268
  188. package/runtime/python/okstra_vendor/networkx/algorithms/efficiency_measures.py +0 -167
  189. package/runtime/python/okstra_vendor/networkx/algorithms/euler.py +0 -470
  190. package/runtime/python/okstra_vendor/networkx/algorithms/flow/__init__.py +0 -11
  191. package/runtime/python/okstra_vendor/networkx/algorithms/flow/boykovkolmogorov.py +0 -370
  192. package/runtime/python/okstra_vendor/networkx/algorithms/flow/capacityscaling.py +0 -407
  193. package/runtime/python/okstra_vendor/networkx/algorithms/flow/dinitz_alg.py +0 -238
  194. package/runtime/python/okstra_vendor/networkx/algorithms/flow/edmondskarp.py +0 -241
  195. package/runtime/python/okstra_vendor/networkx/algorithms/flow/gomory_hu.py +0 -178
  196. package/runtime/python/okstra_vendor/networkx/algorithms/flow/maxflow.py +0 -611
  197. package/runtime/python/okstra_vendor/networkx/algorithms/flow/mincost.py +0 -356
  198. package/runtime/python/okstra_vendor/networkx/algorithms/flow/networksimplex.py +0 -662
  199. package/runtime/python/okstra_vendor/networkx/algorithms/flow/preflowpush.py +0 -425
  200. package/runtime/python/okstra_vendor/networkx/algorithms/flow/shortestaugmentingpath.py +0 -300
  201. package/runtime/python/okstra_vendor/networkx/algorithms/flow/utils.py +0 -194
  202. package/runtime/python/okstra_vendor/networkx/algorithms/graph_hashing.py +0 -435
  203. package/runtime/python/okstra_vendor/networkx/algorithms/graphical.py +0 -483
  204. package/runtime/python/okstra_vendor/networkx/algorithms/hierarchy.py +0 -57
  205. package/runtime/python/okstra_vendor/networkx/algorithms/hybrid.py +0 -196
  206. package/runtime/python/okstra_vendor/networkx/algorithms/isolate.py +0 -107
  207. package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/__init__.py +0 -7
  208. package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/ismags.py +0 -1306
  209. package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/isomorph.py +0 -336
  210. package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/isomorphvf2.py +0 -1262
  211. package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/matchhelpers.py +0 -352
  212. package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/temporalisomorphvf2.py +0 -308
  213. package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tree_isomorphism.py +0 -264
  214. package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/vf2pp.py +0 -1102
  215. package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/vf2userfunc.py +0 -192
  216. package/runtime/python/okstra_vendor/networkx/algorithms/link_analysis/__init__.py +0 -2
  217. package/runtime/python/okstra_vendor/networkx/algorithms/link_analysis/hits_alg.py +0 -337
  218. package/runtime/python/okstra_vendor/networkx/algorithms/link_analysis/pagerank_alg.py +0 -498
  219. package/runtime/python/okstra_vendor/networkx/algorithms/link_prediction.py +0 -687
  220. package/runtime/python/okstra_vendor/networkx/algorithms/lowest_common_ancestors.py +0 -280
  221. package/runtime/python/okstra_vendor/networkx/algorithms/matching.py +0 -1148
  222. package/runtime/python/okstra_vendor/networkx/algorithms/minors/__init__.py +0 -27
  223. package/runtime/python/okstra_vendor/networkx/algorithms/minors/contraction.py +0 -738
  224. package/runtime/python/okstra_vendor/networkx/algorithms/mis.py +0 -78
  225. package/runtime/python/okstra_vendor/networkx/algorithms/moral.py +0 -59
  226. package/runtime/python/okstra_vendor/networkx/algorithms/node_classification.py +0 -219
  227. package/runtime/python/okstra_vendor/networkx/algorithms/non_randomness.py +0 -155
  228. package/runtime/python/okstra_vendor/networkx/algorithms/operators/__init__.py +0 -4
  229. package/runtime/python/okstra_vendor/networkx/algorithms/operators/all.py +0 -324
  230. package/runtime/python/okstra_vendor/networkx/algorithms/operators/binary.py +0 -468
  231. package/runtime/python/okstra_vendor/networkx/algorithms/operators/product.py +0 -633
  232. package/runtime/python/okstra_vendor/networkx/algorithms/operators/unary.py +0 -77
  233. package/runtime/python/okstra_vendor/networkx/algorithms/perfect_graph.py +0 -73
  234. package/runtime/python/okstra_vendor/networkx/algorithms/planar_drawing.py +0 -464
  235. package/runtime/python/okstra_vendor/networkx/algorithms/planarity.py +0 -1463
  236. package/runtime/python/okstra_vendor/networkx/algorithms/polynomials.py +0 -306
  237. package/runtime/python/okstra_vendor/networkx/algorithms/reciprocity.py +0 -98
  238. package/runtime/python/okstra_vendor/networkx/algorithms/regular.py +0 -167
  239. package/runtime/python/okstra_vendor/networkx/algorithms/richclub.py +0 -138
  240. package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/__init__.py +0 -5
  241. package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/astar.py +0 -239
  242. package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/dense.py +0 -264
  243. package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/generic.py +0 -716
  244. package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/unweighted.py +0 -625
  245. package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/weighted.py +0 -2542
  246. package/runtime/python/okstra_vendor/networkx/algorithms/similarity.py +0 -2107
  247. package/runtime/python/okstra_vendor/networkx/algorithms/simple_paths.py +0 -966
  248. package/runtime/python/okstra_vendor/networkx/algorithms/smallworld.py +0 -404
  249. package/runtime/python/okstra_vendor/networkx/algorithms/smetric.py +0 -30
  250. package/runtime/python/okstra_vendor/networkx/algorithms/sparsifiers.py +0 -296
  251. package/runtime/python/okstra_vendor/networkx/algorithms/structuralholes.py +0 -374
  252. package/runtime/python/okstra_vendor/networkx/algorithms/summarization.py +0 -564
  253. package/runtime/python/okstra_vendor/networkx/algorithms/swap.py +0 -406
  254. package/runtime/python/okstra_vendor/networkx/algorithms/threshold.py +0 -981
  255. package/runtime/python/okstra_vendor/networkx/algorithms/time_dependent.py +0 -142
  256. package/runtime/python/okstra_vendor/networkx/algorithms/tournament.py +0 -406
  257. package/runtime/python/okstra_vendor/networkx/algorithms/traversal/__init__.py +0 -5
  258. package/runtime/python/okstra_vendor/networkx/algorithms/traversal/beamsearch.py +0 -90
  259. package/runtime/python/okstra_vendor/networkx/algorithms/traversal/breadth_first_search.py +0 -576
  260. package/runtime/python/okstra_vendor/networkx/algorithms/traversal/depth_first_search.py +0 -529
  261. package/runtime/python/okstra_vendor/networkx/algorithms/traversal/edgebfs.py +0 -185
  262. package/runtime/python/okstra_vendor/networkx/algorithms/traversal/edgedfs.py +0 -182
  263. package/runtime/python/okstra_vendor/networkx/algorithms/tree/__init__.py +0 -7
  264. package/runtime/python/okstra_vendor/networkx/algorithms/tree/branchings.py +0 -1042
  265. package/runtime/python/okstra_vendor/networkx/algorithms/tree/coding.py +0 -413
  266. package/runtime/python/okstra_vendor/networkx/algorithms/tree/decomposition.py +0 -88
  267. package/runtime/python/okstra_vendor/networkx/algorithms/tree/distance_measures.py +0 -219
  268. package/runtime/python/okstra_vendor/networkx/algorithms/tree/mst.py +0 -1281
  269. package/runtime/python/okstra_vendor/networkx/algorithms/tree/operations.py +0 -106
  270. package/runtime/python/okstra_vendor/networkx/algorithms/tree/recognition.py +0 -273
  271. package/runtime/python/okstra_vendor/networkx/algorithms/triads.py +0 -500
  272. package/runtime/python/okstra_vendor/networkx/algorithms/vitality.py +0 -76
  273. package/runtime/python/okstra_vendor/networkx/algorithms/voronoi.py +0 -86
  274. package/runtime/python/okstra_vendor/networkx/algorithms/walks.py +0 -77
  275. package/runtime/python/okstra_vendor/networkx/algorithms/wiener.py +0 -278
  276. package/runtime/python/okstra_vendor/networkx/classes/__init__.py +0 -13
  277. package/runtime/python/okstra_vendor/networkx/classes/coreviews.py +0 -435
  278. package/runtime/python/okstra_vendor/networkx/classes/digraph.py +0 -1363
  279. package/runtime/python/okstra_vendor/networkx/classes/filters.py +0 -95
  280. package/runtime/python/okstra_vendor/networkx/classes/function.py +0 -1549
  281. package/runtime/python/okstra_vendor/networkx/classes/graph.py +0 -2082
  282. package/runtime/python/okstra_vendor/networkx/classes/graphviews.py +0 -269
  283. package/runtime/python/okstra_vendor/networkx/classes/multidigraph.py +0 -977
  284. package/runtime/python/okstra_vendor/networkx/classes/multigraph.py +0 -1294
  285. package/runtime/python/okstra_vendor/networkx/classes/reportviews.py +0 -1447
  286. package/runtime/python/okstra_vendor/networkx/convert.py +0 -502
  287. package/runtime/python/okstra_vendor/networkx/convert_matrix.py +0 -1314
  288. package/runtime/python/okstra_vendor/networkx/drawing/__init__.py +0 -7
  289. package/runtime/python/okstra_vendor/networkx/drawing/layout.py +0 -2036
  290. package/runtime/python/okstra_vendor/networkx/drawing/nx_agraph.py +0 -470
  291. package/runtime/python/okstra_vendor/networkx/drawing/nx_latex.py +0 -570
  292. package/runtime/python/okstra_vendor/networkx/drawing/nx_pydot.py +0 -361
  293. package/runtime/python/okstra_vendor/networkx/drawing/nx_pylab.py +0 -2978
  294. package/runtime/python/okstra_vendor/networkx/exception.py +0 -131
  295. package/runtime/python/okstra_vendor/networkx/generators/__init__.py +0 -34
  296. package/runtime/python/okstra_vendor/networkx/generators/atlas.dat.gz +0 -0
  297. package/runtime/python/okstra_vendor/networkx/generators/atlas.py +0 -227
  298. package/runtime/python/okstra_vendor/networkx/generators/classic.py +0 -1091
  299. package/runtime/python/okstra_vendor/networkx/generators/cographs.py +0 -68
  300. package/runtime/python/okstra_vendor/networkx/generators/community.py +0 -1070
  301. package/runtime/python/okstra_vendor/networkx/generators/degree_seq.py +0 -886
  302. package/runtime/python/okstra_vendor/networkx/generators/directed.py +0 -572
  303. package/runtime/python/okstra_vendor/networkx/generators/duplication.py +0 -174
  304. package/runtime/python/okstra_vendor/networkx/generators/ego.py +0 -66
  305. package/runtime/python/okstra_vendor/networkx/generators/expanders.py +0 -499
  306. package/runtime/python/okstra_vendor/networkx/generators/geometric.py +0 -1037
  307. package/runtime/python/okstra_vendor/networkx/generators/harary_graph.py +0 -163
  308. package/runtime/python/okstra_vendor/networkx/generators/internet_as_graphs.py +0 -443
  309. package/runtime/python/okstra_vendor/networkx/generators/intersection.py +0 -125
  310. package/runtime/python/okstra_vendor/networkx/generators/interval_graph.py +0 -70
  311. package/runtime/python/okstra_vendor/networkx/generators/joint_degree_seq.py +0 -664
  312. package/runtime/python/okstra_vendor/networkx/generators/lattice.py +0 -405
  313. package/runtime/python/okstra_vendor/networkx/generators/line.py +0 -501
  314. package/runtime/python/okstra_vendor/networkx/generators/mycielski.py +0 -110
  315. package/runtime/python/okstra_vendor/networkx/generators/nonisomorphic_trees.py +0 -259
  316. package/runtime/python/okstra_vendor/networkx/generators/random_clustered.py +0 -117
  317. package/runtime/python/okstra_vendor/networkx/generators/random_graphs.py +0 -1416
  318. package/runtime/python/okstra_vendor/networkx/generators/small.py +0 -1070
  319. package/runtime/python/okstra_vendor/networkx/generators/social.py +0 -554
  320. package/runtime/python/okstra_vendor/networkx/generators/spectral_graph_forge.py +0 -120
  321. package/runtime/python/okstra_vendor/networkx/generators/stochastic.py +0 -54
  322. package/runtime/python/okstra_vendor/networkx/generators/sudoku.py +0 -131
  323. package/runtime/python/okstra_vendor/networkx/generators/time_series.py +0 -74
  324. package/runtime/python/okstra_vendor/networkx/generators/trees.py +0 -1070
  325. package/runtime/python/okstra_vendor/networkx/generators/triads.py +0 -94
  326. package/runtime/python/okstra_vendor/networkx/lazy_imports.py +0 -188
  327. package/runtime/python/okstra_vendor/networkx/linalg/__init__.py +0 -13
  328. package/runtime/python/okstra_vendor/networkx/linalg/algebraicconnectivity.py +0 -650
  329. package/runtime/python/okstra_vendor/networkx/linalg/attrmatrix.py +0 -466
  330. package/runtime/python/okstra_vendor/networkx/linalg/bethehessianmatrix.py +0 -77
  331. package/runtime/python/okstra_vendor/networkx/linalg/graphmatrix.py +0 -168
  332. package/runtime/python/okstra_vendor/networkx/linalg/laplacianmatrix.py +0 -512
  333. package/runtime/python/okstra_vendor/networkx/linalg/modularitymatrix.py +0 -166
  334. package/runtime/python/okstra_vendor/networkx/linalg/spectrum.py +0 -186
  335. package/runtime/python/okstra_vendor/networkx/readwrite/__init__.py +0 -17
  336. package/runtime/python/okstra_vendor/networkx/readwrite/adjlist.py +0 -330
  337. package/runtime/python/okstra_vendor/networkx/readwrite/edgelist.py +0 -489
  338. package/runtime/python/okstra_vendor/networkx/readwrite/gexf.py +0 -1084
  339. package/runtime/python/okstra_vendor/networkx/readwrite/gml.py +0 -879
  340. package/runtime/python/okstra_vendor/networkx/readwrite/graph6.py +0 -427
  341. package/runtime/python/okstra_vendor/networkx/readwrite/graphml.py +0 -1053
  342. package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/__init__.py +0 -19
  343. package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/adjacency.py +0 -156
  344. package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/cytoscape.py +0 -190
  345. package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/node_link.py +0 -261
  346. package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/tree.py +0 -137
  347. package/runtime/python/okstra_vendor/networkx/readwrite/leda.py +0 -108
  348. package/runtime/python/okstra_vendor/networkx/readwrite/multiline_adjlist.py +0 -393
  349. package/runtime/python/okstra_vendor/networkx/readwrite/p2g.py +0 -113
  350. package/runtime/python/okstra_vendor/networkx/readwrite/pajek.py +0 -286
  351. package/runtime/python/okstra_vendor/networkx/readwrite/sparse6.py +0 -379
  352. package/runtime/python/okstra_vendor/networkx/readwrite/text.py +0 -851
  353. package/runtime/python/okstra_vendor/networkx/relabel.py +0 -285
  354. package/runtime/python/okstra_vendor/networkx/utils/__init__.py +0 -8
  355. package/runtime/python/okstra_vendor/networkx/utils/backends.py +0 -2171
  356. package/runtime/python/okstra_vendor/networkx/utils/configs.py +0 -396
  357. package/runtime/python/okstra_vendor/networkx/utils/decorators.py +0 -1233
  358. package/runtime/python/okstra_vendor/networkx/utils/heaps.py +0 -338
  359. package/runtime/python/okstra_vendor/networkx/utils/mapped_queue.py +0 -297
  360. package/runtime/python/okstra_vendor/networkx/utils/misc.py +0 -703
  361. package/runtime/python/okstra_vendor/networkx/utils/random_sequence.py +0 -198
  362. package/runtime/python/okstra_vendor/networkx/utils/rcm.py +0 -159
  363. package/runtime/python/okstra_vendor/networkx/utils/union_find.py +0 -106
  364. package/runtime/skills/okstra-graphify/SKILL.md +0 -169
  365. package/src/commands/graphify.mjs +0 -32
@@ -1,468 +0,0 @@
1
- """
2
- Operations on graphs including union, intersection, difference.
3
- """
4
-
5
- import networkx as nx
6
-
7
- __all__ = [
8
- "union",
9
- "compose",
10
- "disjoint_union",
11
- "intersection",
12
- "difference",
13
- "symmetric_difference",
14
- "full_join",
15
- ]
16
- _G_H = {"G": 0, "H": 1}
17
-
18
-
19
- @nx._dispatchable(graphs=_G_H, preserve_all_attrs=True, returns_graph=True)
20
- def union(G, H, rename=()):
21
- """Combine graphs G and H. The names of nodes must be unique.
22
-
23
- A name collision between the graphs will raise an exception.
24
-
25
- A renaming facility is provided to avoid name collisions.
26
-
27
-
28
- Parameters
29
- ----------
30
- G, H : graph
31
- A NetworkX graph
32
-
33
- rename : iterable , optional
34
- Node names of G and H can be changed by specifying the tuple
35
- rename=('G-','H-') (for example). Node "u" in G is then renamed
36
- "G-u" and "v" in H is renamed "H-v".
37
-
38
- Returns
39
- -------
40
- U : A union graph with the same type as G.
41
-
42
- See Also
43
- --------
44
- compose
45
- :func:`~networkx.Graph.update`
46
- disjoint_union
47
-
48
- Notes
49
- -----
50
- To combine graphs that have common nodes, consider compose(G, H)
51
- or the method, Graph.update().
52
-
53
- disjoint_union() is similar to union() except that it avoids name clashes
54
- by relabeling the nodes with sequential integers.
55
-
56
- Edge and node attributes are propagated from G and H to the union graph.
57
- Graph attributes are also propagated, but if they are present in both G and H,
58
- then the value from H is used.
59
-
60
- Examples
61
- --------
62
- >>> from pprint import pprint
63
- >>> G = nx.Graph([(0, 1), (0, 2), (1, 2)])
64
- >>> H = nx.Graph([(0, 1), (0, 3), (1, 3), (1, 2)])
65
- >>> U = nx.union(G, H, rename=("G", "H"))
66
- >>> U.nodes
67
- NodeView(('G0', 'G1', 'G2', 'H0', 'H1', 'H3', 'H2'))
68
- >>> edgelist = list(U.edges)
69
- >>> pprint(edgelist)
70
- [('G0', 'G1'),
71
- ('G0', 'G2'),
72
- ('G1', 'G2'),
73
- ('H0', 'H1'),
74
- ('H0', 'H3'),
75
- ('H1', 'H3'),
76
- ('H1', 'H2')]
77
-
78
-
79
- """
80
- return nx.union_all([G, H], rename)
81
-
82
-
83
- @nx._dispatchable(graphs=_G_H, preserve_all_attrs=True, returns_graph=True)
84
- def disjoint_union(G, H):
85
- """Combine graphs G and H. The nodes are assumed to be unique (disjoint).
86
-
87
- This algorithm automatically relabels nodes to avoid name collisions.
88
-
89
- Parameters
90
- ----------
91
- G,H : graph
92
- A NetworkX graph
93
-
94
- Returns
95
- -------
96
- U : A union graph with the same type as G.
97
-
98
- See Also
99
- --------
100
- union
101
- compose
102
- :func:`~networkx.Graph.update`
103
-
104
- Notes
105
- -----
106
- A new graph is created, of the same class as G. It is recommended
107
- that G and H be either both directed or both undirected.
108
-
109
- The nodes of G are relabeled 0 to len(G)-1, and the nodes of H are
110
- relabeled len(G) to len(G)+len(H)-1.
111
-
112
- Renumbering forces G and H to be disjoint, so no exception is ever raised for a name collision.
113
- To preserve the check for common nodes, use union().
114
-
115
- Edge and node attributes are propagated from G and H to the union graph.
116
- Graph attributes are also propagated, but if they are present in both G and H,
117
- then the value from H is used.
118
-
119
- To combine graphs that have common nodes, consider compose(G, H)
120
- or the method, Graph.update().
121
-
122
- Examples
123
- --------
124
- >>> G = nx.Graph([(0, 1), (0, 2), (1, 2)])
125
- >>> H = nx.Graph([(0, 3), (1, 2), (2, 3)])
126
- >>> G.nodes[0]["key1"] = 5
127
- >>> H.nodes[0]["key2"] = 10
128
- >>> U = nx.disjoint_union(G, H)
129
- >>> U.nodes(data=True)
130
- NodeDataView({0: {'key1': 5}, 1: {}, 2: {}, 3: {'key2': 10}, 4: {}, 5: {}, 6: {}})
131
- >>> U.edges
132
- EdgeView([(0, 1), (0, 2), (1, 2), (3, 4), (4, 6), (5, 6)])
133
- """
134
- return nx.disjoint_union_all([G, H])
135
-
136
-
137
- @nx._dispatchable(graphs=_G_H, returns_graph=True)
138
- def intersection(G, H):
139
- """Returns a new graph that contains only the nodes and the edges that exist in
140
- both G and H.
141
-
142
- Parameters
143
- ----------
144
- G,H : graph
145
- A NetworkX graph. G and H can have different node sets but must be both graphs or both multigraphs.
146
-
147
- Raises
148
- ------
149
- NetworkXError
150
- If one is a MultiGraph and the other one is a graph.
151
-
152
- Returns
153
- -------
154
- GH : A new graph with the same type as G.
155
-
156
- Notes
157
- -----
158
- Attributes from the graph, nodes, and edges are not copied to the new
159
- graph. If you want a new graph of the intersection of G and H
160
- with the attributes (including edge data) from G use remove_nodes_from()
161
- as follows
162
-
163
- >>> G = nx.path_graph(3)
164
- >>> H = nx.path_graph(5)
165
- >>> R = G.copy()
166
- >>> R.remove_nodes_from(n for n in G if n not in H)
167
- >>> R.remove_edges_from(e for e in G.edges if e not in H.edges)
168
-
169
- Examples
170
- --------
171
- >>> G = nx.Graph([(0, 1), (0, 2), (1, 2)])
172
- >>> H = nx.Graph([(0, 3), (1, 2), (2, 3)])
173
- >>> R = nx.intersection(G, H)
174
- >>> R.nodes
175
- NodeView((0, 1, 2))
176
- >>> R.edges
177
- EdgeView([(1, 2)])
178
- """
179
- return nx.intersection_all([G, H])
180
-
181
-
182
- @nx._dispatchable(graphs=_G_H, returns_graph=True)
183
- def difference(G, H):
184
- """Returns a new graph that contains the edges that exist in G but not in H.
185
-
186
- The node sets of H and G must be the same.
187
-
188
- Parameters
189
- ----------
190
- G,H : graph
191
- A NetworkX graph. G and H must have the same node sets.
192
-
193
- Returns
194
- -------
195
- D : A new graph with the same type as G.
196
-
197
- Notes
198
- -----
199
- Attributes from the graph, nodes, and edges are not copied to the new
200
- graph. If you want a new graph of the difference of G and H with
201
- the attributes (including edge data) from G use remove_nodes_from()
202
- as follows:
203
-
204
- >>> G = nx.path_graph(3)
205
- >>> H = nx.path_graph(5)
206
- >>> R = G.copy()
207
- >>> R.remove_nodes_from(n for n in G if n in H)
208
-
209
- Examples
210
- --------
211
- >>> G = nx.Graph([(0, 1), (0, 2), (1, 2), (1, 3)])
212
- >>> H = nx.Graph([(0, 1), (1, 2), (0, 3)])
213
- >>> R = nx.difference(G, H)
214
- >>> R.nodes
215
- NodeView((0, 1, 2, 3))
216
- >>> R.edges
217
- EdgeView([(0, 2), (1, 3)])
218
- """
219
- # create new graph
220
- if not G.is_multigraph() == H.is_multigraph():
221
- raise nx.NetworkXError("G and H must both be graphs or multigraphs.")
222
- R = nx.create_empty_copy(G, with_data=False)
223
-
224
- if set(G) != set(H):
225
- raise nx.NetworkXError("Node sets of graphs not equal")
226
-
227
- if G.is_multigraph():
228
- edges = G.edges(keys=True)
229
- else:
230
- edges = G.edges()
231
- for e in edges:
232
- if not H.has_edge(*e):
233
- R.add_edge(*e)
234
- return R
235
-
236
-
237
- @nx._dispatchable(graphs=_G_H, returns_graph=True)
238
- def symmetric_difference(G, H):
239
- """Returns new graph with edges that exist in either G or H but not both.
240
-
241
- The node sets of H and G must be the same.
242
-
243
- Parameters
244
- ----------
245
- G,H : graph
246
- A NetworkX graph. G and H must have the same node sets.
247
-
248
- Returns
249
- -------
250
- D : A new graph with the same type as G.
251
-
252
- Notes
253
- -----
254
- Attributes from the graph, nodes, and edges are not copied to the new
255
- graph.
256
-
257
- Examples
258
- --------
259
- >>> G = nx.Graph([(0, 1), (0, 2), (1, 2), (1, 3)])
260
- >>> H = nx.Graph([(0, 1), (1, 2), (0, 3)])
261
- >>> R = nx.symmetric_difference(G, H)
262
- >>> R.nodes
263
- NodeView((0, 1, 2, 3))
264
- >>> R.edges
265
- EdgeView([(0, 2), (0, 3), (1, 3)])
266
- """
267
- # create new graph
268
- if not G.is_multigraph() == H.is_multigraph():
269
- raise nx.NetworkXError("G and H must both be graphs or multigraphs.")
270
- R = nx.create_empty_copy(G, with_data=False)
271
-
272
- if set(G) != set(H):
273
- raise nx.NetworkXError("Node sets of graphs not equal")
274
-
275
- gnodes = set(G) # set of nodes in G
276
- hnodes = set(H) # set of nodes in H
277
- nodes = gnodes.symmetric_difference(hnodes)
278
- R.add_nodes_from(nodes)
279
-
280
- if G.is_multigraph():
281
- edges = G.edges(keys=True)
282
- else:
283
- edges = G.edges()
284
- # we could copy the data here but then this function doesn't
285
- # match intersection and difference
286
- for e in edges:
287
- if not H.has_edge(*e):
288
- R.add_edge(*e)
289
-
290
- if H.is_multigraph():
291
- edges = H.edges(keys=True)
292
- else:
293
- edges = H.edges()
294
- for e in edges:
295
- if not G.has_edge(*e):
296
- R.add_edge(*e)
297
- return R
298
-
299
-
300
- @nx._dispatchable(graphs=_G_H, preserve_all_attrs=True, returns_graph=True)
301
- def compose(G, H):
302
- """Compose graph G with H by combining nodes and edges into a single graph.
303
-
304
- The node sets and edges sets do not need to be disjoint.
305
-
306
- Composing preserves the attributes of nodes and edges.
307
- Attribute values from H take precedent over attribute values from G.
308
-
309
- Parameters
310
- ----------
311
- G, H : graph
312
- A NetworkX graph
313
-
314
- Returns
315
- -------
316
- C: A new graph with the same type as G
317
-
318
- See Also
319
- --------
320
- :func:`~networkx.Graph.update`
321
- union
322
- disjoint_union
323
-
324
- Notes
325
- -----
326
- It is recommended that G and H be either both directed or both undirected.
327
-
328
- For MultiGraphs, the edges are identified by incident nodes AND edge-key.
329
- This can cause surprises (i.e., edge `(1, 2)` may or may not be the same
330
- in two graphs) if you use MultiGraph without keeping track of edge keys.
331
-
332
- If combining the attributes of common nodes is not desired, consider union(),
333
- which raises an exception for name collisions.
334
-
335
- Examples
336
- --------
337
- >>> G = nx.Graph([(0, 1), (0, 2)])
338
- >>> H = nx.Graph([(0, 1), (1, 2)])
339
- >>> R = nx.compose(G, H)
340
- >>> R.nodes
341
- NodeView((0, 1, 2))
342
- >>> R.edges
343
- EdgeView([(0, 1), (0, 2), (1, 2)])
344
-
345
- By default, the attributes from `H` take precedent over attributes from `G`.
346
- If you prefer another way of combining attributes, you can update them after the compose operation:
347
-
348
- >>> G = nx.Graph([(0, 1, {"weight": 2.0}), (3, 0, {"weight": 100.0})])
349
- >>> H = nx.Graph([(0, 1, {"weight": 10.0}), (1, 2, {"weight": -1.0})])
350
- >>> nx.set_node_attributes(G, {0: "dark", 1: "light", 3: "black"}, name="color")
351
- >>> nx.set_node_attributes(H, {0: "green", 1: "orange", 2: "yellow"}, name="color")
352
- >>> GcomposeH = nx.compose(G, H)
353
-
354
- Normally, color attribute values of nodes of GcomposeH come from H. We can workaround this as follows:
355
-
356
- >>> node_data = {
357
- ... n: G.nodes[n]["color"] + " " + H.nodes[n]["color"]
358
- ... for n in G.nodes & H.nodes
359
- ... }
360
- >>> nx.set_node_attributes(GcomposeH, node_data, "color")
361
- >>> print(GcomposeH.nodes[0]["color"])
362
- dark green
363
-
364
- >>> print(GcomposeH.nodes[3]["color"])
365
- black
366
-
367
- Similarly, we can update edge attributes after the compose operation in a way we prefer:
368
-
369
- >>> edge_data = {
370
- ... e: G.edges[e]["weight"] * H.edges[e]["weight"] for e in G.edges & H.edges
371
- ... }
372
- >>> nx.set_edge_attributes(GcomposeH, edge_data, "weight")
373
- >>> print(GcomposeH.edges[(0, 1)]["weight"])
374
- 20.0
375
-
376
- >>> print(GcomposeH.edges[(3, 0)]["weight"])
377
- 100.0
378
- """
379
- return nx.compose_all([G, H])
380
-
381
-
382
- @nx._dispatchable(graphs=_G_H, preserve_all_attrs=True, returns_graph=True)
383
- def full_join(G, H, rename=(None, None)):
384
- """Returns the full join of graphs G and H.
385
-
386
- Full join is the union of G and H in which all edges between
387
- G and H are added.
388
- The node sets of G and H must be disjoint,
389
- otherwise an exception is raised.
390
-
391
- Parameters
392
- ----------
393
- G, H : graph
394
- A NetworkX graph
395
-
396
- rename : tuple , default=(None, None)
397
- Node names of G and H can be changed by specifying the tuple
398
- rename=('G-','H-') (for example). Node "u" in G is then renamed
399
- "G-u" and "v" in H is renamed "H-v".
400
-
401
- Returns
402
- -------
403
- U : The full join graph with the same type as G.
404
-
405
- Notes
406
- -----
407
- It is recommended that G and H be either both directed or both undirected.
408
-
409
- If G is directed, then edges from G to H are added as well as from H to G.
410
-
411
- Note that full_join() does not produce parallel edges for MultiGraphs.
412
-
413
- The full join operation of graphs G and H is the same as getting
414
- their complement, performing a disjoint union, and finally getting
415
- the complement of the resulting graph.
416
-
417
- Graph, edge, and node attributes are propagated from G and H
418
- to the union graph. If a graph attribute is present in both
419
- G and H the value from H is used.
420
-
421
- Examples
422
- --------
423
- >>> from pprint import pprint
424
- >>> G = nx.Graph([(0, 1), (0, 2)])
425
- >>> H = nx.Graph([(3, 4)])
426
- >>> R = nx.full_join(G, H, rename=("G", "H"))
427
- >>> R.nodes
428
- NodeView(('G0', 'G1', 'G2', 'H3', 'H4'))
429
- >>> edgelist = list(R.edges)
430
- >>> pprint(edgelist)
431
- [('G0', 'G1'),
432
- ('G0', 'G2'),
433
- ('G0', 'H3'),
434
- ('G0', 'H4'),
435
- ('G1', 'H3'),
436
- ('G1', 'H4'),
437
- ('G2', 'H3'),
438
- ('G2', 'H4'),
439
- ('H3', 'H4')]
440
-
441
- See Also
442
- --------
443
- union
444
- disjoint_union
445
- """
446
- R = union(G, H, rename)
447
-
448
- def add_prefix(graph, prefix):
449
- if prefix is None:
450
- return graph
451
-
452
- def label(x):
453
- return f"{prefix}{x}"
454
-
455
- return nx.relabel_nodes(graph, label)
456
-
457
- G = add_prefix(G, rename[0])
458
- H = add_prefix(H, rename[1])
459
-
460
- for i in G:
461
- for j in H:
462
- R.add_edge(i, j)
463
- if R.is_directed():
464
- for i in H:
465
- for j in G:
466
- R.add_edge(i, j)
467
-
468
- return R