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.
- package/README.kr.md +2 -2
- package/README.md +2 -2
- package/docs/for-ai/README.md +2 -2
- package/docs/for-ai/skills/{okstra-brief.md → okstra-brief-gen.md} +3 -3
- package/docs/for-ai/skills/okstra-inspect.md +1 -1
- package/docs/kr/architecture.md +11 -11
- package/docs/kr/cli.md +1 -1
- package/docs/kr/follow-ups/2026-07-10-final-report-option-3.md +51 -0
- package/docs/project-structure-overview.md +2 -2
- package/package.json +1 -1
- package/runtime/BUILD.json +2 -2
- package/runtime/agents/workers/report-writer-worker.md +1 -0
- package/runtime/prompts/lead/context-loader.md +2 -2
- package/runtime/prompts/lead/okstra-lead-contract.md +1 -1
- package/runtime/prompts/profiles/_common-contract.md +3 -3
- package/runtime/prompts/profiles/implementation-planning.md +1 -1
- package/runtime/prompts/profiles/requirements-discovery.md +2 -2
- package/runtime/python/okstra_ctl/fix_cycles.py +1 -1
- package/runtime/python/okstra_ctl/implementation_stage.py +46 -39
- package/runtime/python/okstra_ctl/report_views.py +151 -12
- package/runtime/python/okstra_ctl/run.py +24 -24
- package/runtime/python/okstra_ctl/wizard.py +3 -3
- package/runtime/python/okstra_ctl/worktree.py +1 -1
- package/runtime/python/okstra_token_usage/claude.py +58 -19
- package/runtime/python/okstra_token_usage/collect.py +3 -1
- package/runtime/python/okstra_vendor/__init__.py +3 -0
- package/runtime/schemas/final-report-v1.0.schema.json +20 -0
- package/runtime/skills/{okstra-brief → okstra-brief-gen}/SKILL.md +6 -6
- package/runtime/skills/{okstra-brief → okstra-brief-gen}/references/reporter-confirmations.md +1 -1
- package/runtime/skills/{okstra-brief → okstra-brief-gen}/references/tracker-recursion.md +1 -1
- package/runtime/skills/okstra-inspect/SKILL.md +2 -2
- package/runtime/templates/reports/brief.template.md +2 -2
- package/runtime/templates/reports/final-report.template.md +14 -0
- package/runtime/templates/reports/i18n/en.json +23 -12
- package/runtime/templates/reports/i18n/ko.json +23 -12
- package/runtime/templates/reports/report.css +55 -0
- package/runtime/templates/reports/report.js +53 -1
- package/runtime/validators/validate-brief.py +5 -5
- package/runtime/validators/validate-brief.sh +1 -1
- package/src/commands/lifecycle/uninstall.mjs +2 -1
- package/src/lib/skill-catalog.mjs +2 -1
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_approx_clust_coeff.py +0 -41
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_clique.py +0 -112
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_connectivity.py +0 -199
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_density.py +0 -146
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_distance_measures.py +0 -59
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_dominating_set.py +0 -78
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_kcomponents.py +0 -303
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_matching.py +0 -8
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_maxcut.py +0 -94
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_ramsey.py +0 -31
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_steinertree.py +0 -306
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_traveling_salesman.py +0 -1014
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_treewidth.py +0 -274
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_vertex_cover.py +0 -68
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/tests/base_test.py +0 -81
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/tests/test_connectivity.py +0 -143
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/tests/test_correlation.py +0 -122
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/tests/test_mixing.py +0 -174
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/tests/test_neighbor_degree.py +0 -107
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/tests/test_pairs.py +0 -87
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_basic.py +0 -125
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_centrality.py +0 -192
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_cluster.py +0 -84
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_covering.py +0 -33
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_edgelist.py +0 -240
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_extendability.py +0 -334
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_generators.py +0 -407
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_link_analysis.py +0 -218
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_matching.py +0 -327
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_matrix.py +0 -138
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_project.py +0 -409
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_redundancy.py +0 -35
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_spectral_bipartivity.py +0 -80
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_betweenness_centrality.py +0 -923
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_betweenness_centrality_subset.py +0 -354
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_closeness_centrality.py +0 -274
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_current_flow_betweenness_centrality.py +0 -259
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_current_flow_betweenness_centrality_subset.py +0 -147
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_current_flow_closeness.py +0 -43
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_degree_centrality.py +0 -144
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_dispersion.py +0 -73
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_eigenvector_centrality.py +0 -186
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_group.py +0 -277
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_harmonic_centrality.py +0 -122
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_katz_centrality.py +0 -345
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_laplacian_centrality.py +0 -220
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_load_centrality.py +0 -344
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_percolation_centrality.py +0 -87
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_reaching.py +0 -140
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_second_order_centrality.py +0 -82
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_subgraph.py +0 -110
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_trophic.py +0 -302
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_voterank.py +0 -64
- package/runtime/python/okstra_vendor/networkx/algorithms/coloring/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/coloring/tests/test_coloring.py +0 -863
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_asyn_fluid.py +0 -147
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_bipartitions.py +0 -157
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_centrality.py +0 -85
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_divisive.py +0 -106
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_kclique.py +0 -91
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_label_propagation.py +0 -241
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_leiden.py +0 -138
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_local.py +0 -76
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_louvain.py +0 -264
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_lukes.py +0 -152
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_modularity_max.py +0 -340
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_quality.py +0 -139
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_utils.py +0 -26
- package/runtime/python/okstra_vendor/networkx/algorithms/components/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/components/tests/test_attracting.py +0 -70
- package/runtime/python/okstra_vendor/networkx/algorithms/components/tests/test_biconnected.py +0 -248
- package/runtime/python/okstra_vendor/networkx/algorithms/components/tests/test_connected.py +0 -138
- package/runtime/python/okstra_vendor/networkx/algorithms/components/tests/test_semiconnected.py +0 -55
- package/runtime/python/okstra_vendor/networkx/algorithms/components/tests/test_strongly_connected.py +0 -193
- package/runtime/python/okstra_vendor/networkx/algorithms/components/tests/test_weakly_connected.py +0 -96
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_connectivity.py +0 -421
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_cuts.py +0 -309
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_disjoint_paths.py +0 -249
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_edge_augmentation.py +0 -502
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_edge_kcomponents.py +0 -488
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_kcomponents.py +0 -323
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_kcutsets.py +0 -280
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_stoer_wagner.py +0 -102
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/gl1.gpickle.bz2 +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/gw1.gpickle.bz2 +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/netgen-2.gpickle.bz2 +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/test_gomory_hu.py +0 -128
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/test_maxflow.py +0 -573
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/test_maxflow_large_graph.py +0 -155
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/test_mincost.py +0 -475
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/test_networksimplex.py +0 -481
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/wlm3.gpickle.bz2 +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/iso_r01_s80.A99 +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/iso_r01_s80.B99 +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/si2_b06_m200.A99 +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/si2_b06_m200.B99 +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_ismags.py +0 -719
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_isomorphism.py +0 -103
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_isomorphvf2.py +0 -490
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_match_helpers.py +0 -64
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_temporalisomorphvf2.py +0 -212
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_tree_isomorphism.py +0 -202
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_vf2pp.py +0 -1655
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_vf2pp_helpers.py +0 -3118
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_vf2userfunc.py +0 -196
- package/runtime/python/okstra_vendor/networkx/algorithms/link_analysis/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/link_analysis/tests/test_hits.py +0 -77
- package/runtime/python/okstra_vendor/networkx/algorithms/link_analysis/tests/test_pagerank.py +0 -213
- package/runtime/python/okstra_vendor/networkx/algorithms/minors/tests/test_contraction.py +0 -544
- package/runtime/python/okstra_vendor/networkx/algorithms/operators/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/operators/tests/test_all.py +0 -328
- package/runtime/python/okstra_vendor/networkx/algorithms/operators/tests/test_binary.py +0 -451
- package/runtime/python/okstra_vendor/networkx/algorithms/operators/tests/test_product.py +0 -491
- package/runtime/python/okstra_vendor/networkx/algorithms/operators/tests/test_unary.py +0 -55
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/tests/test_astar.py +0 -254
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/tests/test_dense.py +0 -212
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/tests/test_dense_numpy.py +0 -88
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/tests/test_generic.py +0 -511
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/tests/test_unweighted.py +0 -149
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/tests/test_weighted.py +0 -983
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_asteroidal.py +0 -23
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_boundary.py +0 -154
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_bridges.py +0 -144
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_broadcasting.py +0 -109
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_chains.py +0 -136
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_chordal.py +0 -129
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_clique.py +0 -300
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_cluster.py +0 -678
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_communicability.py +0 -80
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_core.py +0 -266
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_covering.py +0 -85
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_cuts.py +0 -171
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_cycles.py +0 -984
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_d_separation.py +0 -340
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_dag.py +0 -835
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_distance_measures.py +0 -831
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_distance_regular.py +0 -85
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_dominance.py +0 -299
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_dominating.py +0 -115
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_efficiency.py +0 -58
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_euler.py +0 -314
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_graph_hashing.py +0 -872
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_graphical.py +0 -163
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_hierarchy.py +0 -46
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_hybrid.py +0 -24
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_isolate.py +0 -26
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_link_prediction.py +0 -615
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_lowest_common_ancestors.py +0 -459
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_matching.py +0 -556
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_max_weight_clique.py +0 -179
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_mis.py +0 -62
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_moral.py +0 -15
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_node_classification.py +0 -140
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_non_randomness.py +0 -60
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_perfect_graph.py +0 -27
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_planar_drawing.py +0 -274
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_planarity.py +0 -556
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_polynomials.py +0 -57
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_reciprocity.py +0 -37
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_regular.py +0 -88
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_richclub.py +0 -149
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_similarity.py +0 -1158
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_simple_paths.py +0 -803
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_smallworld.py +0 -76
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_smetric.py +0 -8
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_sparsifiers.py +0 -138
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_structuralholes.py +0 -191
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_summarization.py +0 -642
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_swap.py +0 -179
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_threshold.py +0 -270
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_time_dependent.py +0 -431
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_tournament.py +0 -161
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_triads.py +0 -248
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_vitality.py +0 -41
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_voronoi.py +0 -103
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_walks.py +0 -54
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_wiener.py +0 -157
- package/runtime/python/okstra_vendor/networkx/algorithms/traversal/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/traversal/tests/test_beamsearch.py +0 -25
- package/runtime/python/okstra_vendor/networkx/algorithms/traversal/tests/test_bfs.py +0 -203
- package/runtime/python/okstra_vendor/networkx/algorithms/traversal/tests/test_dfs.py +0 -307
- package/runtime/python/okstra_vendor/networkx/algorithms/traversal/tests/test_edgebfs.py +0 -147
- package/runtime/python/okstra_vendor/networkx/algorithms/traversal/tests/test_edgedfs.py +0 -131
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/test_branchings.py +0 -624
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/test_coding.py +0 -114
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/test_decomposition.py +0 -79
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/test_distance_measures.py +0 -99
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/test_mst.py +0 -934
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/test_operations.py +0 -53
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/test_recognition.py +0 -174
- package/runtime/python/okstra_vendor/networkx/classes/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/classes/tests/dispatch_interface.py +0 -192
- package/runtime/python/okstra_vendor/networkx/classes/tests/historical_tests.py +0 -476
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_coreviews.py +0 -362
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_digraph.py +0 -331
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_digraph_historical.py +0 -110
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_filters.py +0 -177
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_function.py +0 -1045
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_graph.py +0 -950
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_graph_historical.py +0 -12
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_graphviews.py +0 -349
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_multidigraph.py +0 -459
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_multigraph.py +0 -528
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_reportviews.py +0 -1421
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_special.py +0 -131
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_subgraphviews.py +0 -371
- package/runtime/python/okstra_vendor/networkx/conftest.py +0 -261
- package/runtime/python/okstra_vendor/networkx/drawing/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/baseline/test_display_complex.png +0 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/baseline/test_display_empty_graph.png +0 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/baseline/test_display_house_with_colors.png +0 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/baseline/test_display_labels_and_colors.png +0 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/baseline/test_display_shortest_path.png +0 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/baseline/test_house_with_colors.png +0 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/test_agraph.py +0 -237
- package/runtime/python/okstra_vendor/networkx/drawing/tests/test_image_comparison_pylab_mpl.py +0 -229
- package/runtime/python/okstra_vendor/networkx/drawing/tests/test_latex.py +0 -285
- package/runtime/python/okstra_vendor/networkx/drawing/tests/test_layout.py +0 -631
- package/runtime/python/okstra_vendor/networkx/drawing/tests/test_pydot.py +0 -146
- package/runtime/python/okstra_vendor/networkx/drawing/tests/test_pylab.py +0 -1582
- package/runtime/python/okstra_vendor/networkx/generators/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_atlas.py +0 -75
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_classic.py +0 -642
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_cographs.py +0 -20
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_community.py +0 -362
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_degree_seq.py +0 -224
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_directed.py +0 -189
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_duplication.py +0 -103
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_ego.py +0 -39
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_expanders.py +0 -182
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_geometric.py +0 -488
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_harary_graph.py +0 -133
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_internet_as_graphs.py +0 -221
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_intersection.py +0 -28
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_interval_graph.py +0 -144
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_joint_degree_seq.py +0 -125
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_lattice.py +0 -264
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_line.py +0 -316
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_mycielski.py +0 -30
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_nonisomorphic_trees.py +0 -82
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_random_clustered.py +0 -33
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_random_graphs.py +0 -495
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_small.py +0 -220
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_spectral_graph_forge.py +0 -49
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_stochastic.py +0 -72
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_sudoku.py +0 -92
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_time_series.py +0 -64
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_trees.py +0 -195
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_triads.py +0 -15
- package/runtime/python/okstra_vendor/networkx/linalg/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/linalg/tests/test_algebraic_connectivity.py +0 -400
- package/runtime/python/okstra_vendor/networkx/linalg/tests/test_attrmatrix.py +0 -108
- package/runtime/python/okstra_vendor/networkx/linalg/tests/test_bethehessian.py +0 -40
- package/runtime/python/okstra_vendor/networkx/linalg/tests/test_graphmatrix.py +0 -275
- package/runtime/python/okstra_vendor/networkx/linalg/tests/test_laplacian.py +0 -334
- package/runtime/python/okstra_vendor/networkx/linalg/tests/test_modularity.py +0 -86
- package/runtime/python/okstra_vendor/networkx/linalg/tests/test_spectrum.py +0 -70
- package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/tests/test_adjacency.py +0 -78
- package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/tests/test_cytoscape.py +0 -78
- package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/tests/test_node_link.py +0 -109
- package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/tests/test_tree.py +0 -48
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_adjlist.py +0 -354
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_edgelist.py +0 -318
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_gexf.py +0 -612
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_gml.py +0 -744
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_graph6.py +0 -181
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_graphml.py +0 -1531
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_leda.py +0 -30
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_p2g.py +0 -63
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_pajek.py +0 -128
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_sparse6.py +0 -166
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_text.py +0 -1742
- package/runtime/python/okstra_vendor/networkx/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/tests/test_all_random_functions.py +0 -248
- package/runtime/python/okstra_vendor/networkx/tests/test_convert.py +0 -321
- package/runtime/python/okstra_vendor/networkx/tests/test_convert_numpy.py +0 -531
- package/runtime/python/okstra_vendor/networkx/tests/test_convert_pandas.py +0 -349
- package/runtime/python/okstra_vendor/networkx/tests/test_convert_scipy.py +0 -281
- package/runtime/python/okstra_vendor/networkx/tests/test_exceptions.py +0 -40
- package/runtime/python/okstra_vendor/networkx/tests/test_import.py +0 -11
- package/runtime/python/okstra_vendor/networkx/tests/test_lazy_imports.py +0 -96
- package/runtime/python/okstra_vendor/networkx/tests/test_relabel.py +0 -349
- package/runtime/python/okstra_vendor/networkx/tests/test_removed_functions_exception_messages.py +0 -8
- package/runtime/python/okstra_vendor/networkx/utils/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/utils/tests/test__init.py +0 -11
- package/runtime/python/okstra_vendor/networkx/utils/tests/test_backends.py +0 -225
- package/runtime/python/okstra_vendor/networkx/utils/tests/test_config.py +0 -263
- package/runtime/python/okstra_vendor/networkx/utils/tests/test_decorators.py +0 -510
- package/runtime/python/okstra_vendor/networkx/utils/tests/test_heaps.py +0 -131
- package/runtime/python/okstra_vendor/networkx/utils/tests/test_mapped_queue.py +0 -268
- package/runtime/python/okstra_vendor/networkx/utils/tests/test_misc.py +0 -393
- package/runtime/python/okstra_vendor/networkx/utils/tests/test_random_sequence.py +0 -53
- package/runtime/python/okstra_vendor/networkx/utils/tests/test_rcm.py +0 -63
- package/runtime/python/okstra_vendor/networkx/utils/tests/test_unionfind.py +0 -55
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import pytest
|
|
2
|
-
|
|
3
|
-
import networkx as nx
|
|
4
|
-
from networkx.algorithms import bipartite
|
|
5
|
-
from networkx.algorithms.bipartite.cluster import cc_dot, cc_max, cc_min
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
def test_pairwise_bipartite_cc_functions():
|
|
9
|
-
# Test functions for different kinds of bipartite clustering coefficients
|
|
10
|
-
# between pairs of nodes using 3 example graphs from figure 5 p. 40
|
|
11
|
-
# Latapy et al (2008)
|
|
12
|
-
G1 = nx.Graph([(0, 2), (0, 3), (0, 4), (0, 5), (0, 6), (1, 5), (1, 6), (1, 7)])
|
|
13
|
-
G2 = nx.Graph([(0, 2), (0, 3), (0, 4), (1, 3), (1, 4), (1, 5)])
|
|
14
|
-
G3 = nx.Graph(
|
|
15
|
-
[(0, 2), (0, 3), (0, 4), (0, 5), (0, 6), (1, 5), (1, 6), (1, 7), (1, 8), (1, 9)]
|
|
16
|
-
)
|
|
17
|
-
result = {
|
|
18
|
-
0: [1 / 3.0, 2 / 3.0, 2 / 5.0],
|
|
19
|
-
1: [1 / 2.0, 2 / 3.0, 2 / 3.0],
|
|
20
|
-
2: [2 / 8.0, 2 / 5.0, 2 / 5.0],
|
|
21
|
-
}
|
|
22
|
-
for i, G in enumerate([G1, G2, G3]):
|
|
23
|
-
assert bipartite.is_bipartite(G)
|
|
24
|
-
assert cc_dot(set(G[0]), set(G[1])) == result[i][0]
|
|
25
|
-
assert cc_min(set(G[0]), set(G[1])) == result[i][1]
|
|
26
|
-
assert cc_max(set(G[0]), set(G[1])) == result[i][2]
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
def test_star_graph():
|
|
30
|
-
G = nx.star_graph(3)
|
|
31
|
-
# all modes are the same
|
|
32
|
-
answer = {0: 0, 1: 1, 2: 1, 3: 1}
|
|
33
|
-
assert bipartite.clustering(G, mode="dot") == answer
|
|
34
|
-
assert bipartite.clustering(G, mode="min") == answer
|
|
35
|
-
assert bipartite.clustering(G, mode="max") == answer
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
def test_not_bipartite():
|
|
39
|
-
with pytest.raises(nx.NetworkXError):
|
|
40
|
-
bipartite.clustering(nx.complete_graph(4))
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
def test_bad_mode():
|
|
44
|
-
with pytest.raises(nx.NetworkXError):
|
|
45
|
-
bipartite.clustering(nx.path_graph(4), mode="foo")
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
def test_path_graph():
|
|
49
|
-
G = nx.path_graph(4)
|
|
50
|
-
answer = {0: 0.5, 1: 0.5, 2: 0.5, 3: 0.5}
|
|
51
|
-
assert bipartite.clustering(G, mode="dot") == answer
|
|
52
|
-
assert bipartite.clustering(G, mode="max") == answer
|
|
53
|
-
answer = {0: 1, 1: 1, 2: 1, 3: 1}
|
|
54
|
-
assert bipartite.clustering(G, mode="min") == answer
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
def test_average_path_graph():
|
|
58
|
-
G = nx.path_graph(4)
|
|
59
|
-
assert bipartite.average_clustering(G, mode="dot") == 0.5
|
|
60
|
-
assert bipartite.average_clustering(G, mode="max") == 0.5
|
|
61
|
-
assert bipartite.average_clustering(G, mode="min") == 1
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
def test_ra_clustering_davis():
|
|
65
|
-
G = nx.davis_southern_women_graph()
|
|
66
|
-
cc4 = round(bipartite.robins_alexander_clustering(G), 3)
|
|
67
|
-
assert cc4 == 0.468
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
def test_ra_clustering_square():
|
|
71
|
-
G = nx.path_graph(4)
|
|
72
|
-
G.add_edge(0, 3)
|
|
73
|
-
assert bipartite.robins_alexander_clustering(G) == 1.0
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
def test_ra_clustering_zero():
|
|
77
|
-
G = nx.Graph()
|
|
78
|
-
assert bipartite.robins_alexander_clustering(G) == 0
|
|
79
|
-
G.add_nodes_from(range(4))
|
|
80
|
-
assert bipartite.robins_alexander_clustering(G) == 0
|
|
81
|
-
G.add_edges_from([(0, 1), (2, 3), (3, 4)])
|
|
82
|
-
assert bipartite.robins_alexander_clustering(G) == 0
|
|
83
|
-
G.add_edge(1, 2)
|
|
84
|
-
assert bipartite.robins_alexander_clustering(G) == 0
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import networkx as nx
|
|
2
|
-
from networkx.algorithms import bipartite
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
class TestMinEdgeCover:
|
|
6
|
-
"""Tests for :func:`networkx.algorithms.bipartite.min_edge_cover`"""
|
|
7
|
-
|
|
8
|
-
def test_empty_graph(self):
|
|
9
|
-
G = nx.Graph()
|
|
10
|
-
assert bipartite.min_edge_cover(G) == set()
|
|
11
|
-
|
|
12
|
-
def test_graph_single_edge(self):
|
|
13
|
-
G = nx.Graph()
|
|
14
|
-
G.add_edge(0, 1)
|
|
15
|
-
assert bipartite.min_edge_cover(G) == {(0, 1), (1, 0)}
|
|
16
|
-
|
|
17
|
-
def test_bipartite_default(self):
|
|
18
|
-
G = nx.Graph()
|
|
19
|
-
G.add_nodes_from([1, 2, 3, 4], bipartite=0)
|
|
20
|
-
G.add_nodes_from(["a", "b", "c"], bipartite=1)
|
|
21
|
-
G.add_edges_from([(1, "a"), (1, "b"), (2, "b"), (2, "c"), (3, "c"), (4, "a")])
|
|
22
|
-
min_cover = bipartite.min_edge_cover(G)
|
|
23
|
-
assert nx.is_edge_cover(G, min_cover)
|
|
24
|
-
assert len(min_cover) == 8
|
|
25
|
-
|
|
26
|
-
def test_bipartite_explicit(self):
|
|
27
|
-
G = nx.Graph()
|
|
28
|
-
G.add_nodes_from([1, 2, 3, 4], bipartite=0)
|
|
29
|
-
G.add_nodes_from(["a", "b", "c"], bipartite=1)
|
|
30
|
-
G.add_edges_from([(1, "a"), (1, "b"), (2, "b"), (2, "c"), (3, "c"), (4, "a")])
|
|
31
|
-
min_cover = bipartite.min_edge_cover(G, bipartite.eppstein_matching)
|
|
32
|
-
assert nx.is_edge_cover(G, min_cover)
|
|
33
|
-
assert len(min_cover) == 8
|
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Unit tests for bipartite edgelists.
|
|
3
|
-
"""
|
|
4
|
-
|
|
5
|
-
import io
|
|
6
|
-
|
|
7
|
-
import pytest
|
|
8
|
-
|
|
9
|
-
import networkx as nx
|
|
10
|
-
from networkx.algorithms import bipartite
|
|
11
|
-
from networkx.utils import edges_equal, graphs_equal, nodes_equal
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class TestEdgelist:
|
|
15
|
-
@classmethod
|
|
16
|
-
def setup_class(cls):
|
|
17
|
-
cls.G = nx.Graph(name="test")
|
|
18
|
-
e = [("a", "b"), ("b", "c"), ("c", "d"), ("d", "e"), ("e", "f"), ("a", "f")]
|
|
19
|
-
cls.G.add_edges_from(e)
|
|
20
|
-
cls.G.add_nodes_from(["a", "c", "e"], bipartite=0)
|
|
21
|
-
cls.G.add_nodes_from(["b", "d", "f"], bipartite=1)
|
|
22
|
-
cls.G.add_node("g", bipartite=0)
|
|
23
|
-
cls.DG = nx.DiGraph(cls.G)
|
|
24
|
-
cls.MG = nx.MultiGraph()
|
|
25
|
-
cls.MG.add_edges_from([(1, 2), (1, 2), (1, 2)])
|
|
26
|
-
cls.MG.add_node(1, bipartite=0)
|
|
27
|
-
cls.MG.add_node(2, bipartite=1)
|
|
28
|
-
|
|
29
|
-
def test_read_edgelist_1(self):
|
|
30
|
-
s = b"""\
|
|
31
|
-
# comment line
|
|
32
|
-
1 2
|
|
33
|
-
# comment line
|
|
34
|
-
2 3
|
|
35
|
-
"""
|
|
36
|
-
bytesIO = io.BytesIO(s)
|
|
37
|
-
G = bipartite.read_edgelist(bytesIO, nodetype=int)
|
|
38
|
-
assert edges_equal(G.edges(), [(1, 2), (2, 3)])
|
|
39
|
-
|
|
40
|
-
def test_read_edgelist_3(self):
|
|
41
|
-
s = b"""\
|
|
42
|
-
# comment line
|
|
43
|
-
1 2 {'weight':2.0}
|
|
44
|
-
# comment line
|
|
45
|
-
2 3 {'weight':3.0}
|
|
46
|
-
"""
|
|
47
|
-
bytesIO = io.BytesIO(s)
|
|
48
|
-
G = bipartite.read_edgelist(bytesIO, nodetype=int, data=False)
|
|
49
|
-
assert edges_equal(G.edges(), [(1, 2), (2, 3)])
|
|
50
|
-
|
|
51
|
-
bytesIO = io.BytesIO(s)
|
|
52
|
-
G = bipartite.read_edgelist(bytesIO, nodetype=int, data=True)
|
|
53
|
-
assert edges_equal(
|
|
54
|
-
G.edges(data=True), [(1, 2, {"weight": 2.0}), (2, 3, {"weight": 3.0})]
|
|
55
|
-
)
|
|
56
|
-
|
|
57
|
-
def test_write_edgelist_1(self):
|
|
58
|
-
fh = io.BytesIO()
|
|
59
|
-
G = nx.Graph()
|
|
60
|
-
G.add_edges_from([(1, 2), (2, 3)])
|
|
61
|
-
G.add_node(1, bipartite=0)
|
|
62
|
-
G.add_node(2, bipartite=1)
|
|
63
|
-
G.add_node(3, bipartite=0)
|
|
64
|
-
bipartite.write_edgelist(G, fh, data=False)
|
|
65
|
-
fh.seek(0)
|
|
66
|
-
assert fh.read() == b"1 2\n3 2\n"
|
|
67
|
-
|
|
68
|
-
def test_write_edgelist_2(self):
|
|
69
|
-
fh = io.BytesIO()
|
|
70
|
-
G = nx.Graph()
|
|
71
|
-
G.add_edges_from([(1, 2), (2, 3)])
|
|
72
|
-
G.add_node(1, bipartite=0)
|
|
73
|
-
G.add_node(2, bipartite=1)
|
|
74
|
-
G.add_node(3, bipartite=0)
|
|
75
|
-
bipartite.write_edgelist(G, fh, data=True)
|
|
76
|
-
fh.seek(0)
|
|
77
|
-
assert fh.read() == b"1 2 {}\n3 2 {}\n"
|
|
78
|
-
|
|
79
|
-
def test_write_edgelist_3(self):
|
|
80
|
-
fh = io.BytesIO()
|
|
81
|
-
G = nx.Graph()
|
|
82
|
-
G.add_edge(1, 2, weight=2.0)
|
|
83
|
-
G.add_edge(2, 3, weight=3.0)
|
|
84
|
-
G.add_node(1, bipartite=0)
|
|
85
|
-
G.add_node(2, bipartite=1)
|
|
86
|
-
G.add_node(3, bipartite=0)
|
|
87
|
-
bipartite.write_edgelist(G, fh, data=True)
|
|
88
|
-
fh.seek(0)
|
|
89
|
-
assert fh.read() == b"1 2 {'weight': 2.0}\n3 2 {'weight': 3.0}\n"
|
|
90
|
-
|
|
91
|
-
def test_write_edgelist_4(self):
|
|
92
|
-
fh = io.BytesIO()
|
|
93
|
-
G = nx.Graph()
|
|
94
|
-
G.add_edge(1, 2, weight=2.0)
|
|
95
|
-
G.add_edge(2, 3, weight=3.0)
|
|
96
|
-
G.add_node(1, bipartite=0)
|
|
97
|
-
G.add_node(2, bipartite=1)
|
|
98
|
-
G.add_node(3, bipartite=0)
|
|
99
|
-
bipartite.write_edgelist(G, fh, data=[("weight")])
|
|
100
|
-
fh.seek(0)
|
|
101
|
-
assert fh.read() == b"1 2 2.0\n3 2 3.0\n"
|
|
102
|
-
|
|
103
|
-
def test_unicode(self, tmp_path):
|
|
104
|
-
G = nx.Graph()
|
|
105
|
-
name1 = chr(2344) + chr(123) + chr(6543)
|
|
106
|
-
name2 = chr(5543) + chr(1543) + chr(324)
|
|
107
|
-
G.add_edge(name1, "Radiohead", **{name2: 3})
|
|
108
|
-
G.add_node(name1, bipartite=0)
|
|
109
|
-
G.add_node("Radiohead", bipartite=1)
|
|
110
|
-
|
|
111
|
-
fname = tmp_path / "edgelist.txt"
|
|
112
|
-
bipartite.write_edgelist(G, fname)
|
|
113
|
-
H = bipartite.read_edgelist(fname)
|
|
114
|
-
assert graphs_equal(G, H)
|
|
115
|
-
|
|
116
|
-
def test_latin1_issue(self, tmp_path):
|
|
117
|
-
G = nx.Graph()
|
|
118
|
-
name1 = chr(2344) + chr(123) + chr(6543)
|
|
119
|
-
name2 = chr(5543) + chr(1543) + chr(324)
|
|
120
|
-
G.add_edge(name1, "Radiohead", **{name2: 3})
|
|
121
|
-
G.add_node(name1, bipartite=0)
|
|
122
|
-
G.add_node("Radiohead", bipartite=1)
|
|
123
|
-
|
|
124
|
-
fname = tmp_path / "edgelist.txt"
|
|
125
|
-
with pytest.raises(UnicodeEncodeError):
|
|
126
|
-
bipartite.write_edgelist(G, fname, encoding="latin-1")
|
|
127
|
-
|
|
128
|
-
def test_latin1(self, tmp_path):
|
|
129
|
-
G = nx.Graph()
|
|
130
|
-
name1 = "Bj" + chr(246) + "rk"
|
|
131
|
-
name2 = chr(220) + "ber"
|
|
132
|
-
G.add_edge(name1, "Radiohead", **{name2: 3})
|
|
133
|
-
G.add_node(name1, bipartite=0)
|
|
134
|
-
G.add_node("Radiohead", bipartite=1)
|
|
135
|
-
|
|
136
|
-
fname = tmp_path / "edgelist.txt"
|
|
137
|
-
bipartite.write_edgelist(G, fname, encoding="latin-1")
|
|
138
|
-
H = bipartite.read_edgelist(fname, encoding="latin-1")
|
|
139
|
-
assert graphs_equal(G, H)
|
|
140
|
-
|
|
141
|
-
def test_edgelist_graph(self, tmp_path):
|
|
142
|
-
G = self.G
|
|
143
|
-
fname = tmp_path / "edgelist.txt"
|
|
144
|
-
bipartite.write_edgelist(G, fname)
|
|
145
|
-
H = bipartite.read_edgelist(fname)
|
|
146
|
-
H2 = bipartite.read_edgelist(fname)
|
|
147
|
-
assert H is not H2 # they should be different graphs
|
|
148
|
-
G.remove_node("g") # isolated nodes are not written in edgelist
|
|
149
|
-
assert nodes_equal(list(H), list(G))
|
|
150
|
-
assert edges_equal(list(H.edges()), list(G.edges()))
|
|
151
|
-
|
|
152
|
-
def test_edgelist_integers(self, tmp_path):
|
|
153
|
-
G = nx.convert_node_labels_to_integers(self.G)
|
|
154
|
-
fname = tmp_path / "edgelist.txt"
|
|
155
|
-
bipartite.write_edgelist(G, fname)
|
|
156
|
-
H = bipartite.read_edgelist(fname, nodetype=int)
|
|
157
|
-
# isolated nodes are not written in edgelist
|
|
158
|
-
G.remove_nodes_from(list(nx.isolates(G)))
|
|
159
|
-
assert nodes_equal(list(H), list(G))
|
|
160
|
-
assert edges_equal(list(H.edges()), list(G.edges()))
|
|
161
|
-
|
|
162
|
-
def test_edgelist_multigraph(self, tmp_path):
|
|
163
|
-
G = self.MG
|
|
164
|
-
fname = tmp_path / "edgelist.txt"
|
|
165
|
-
bipartite.write_edgelist(G, fname)
|
|
166
|
-
H = bipartite.read_edgelist(fname, nodetype=int, create_using=nx.MultiGraph())
|
|
167
|
-
H2 = bipartite.read_edgelist(fname, nodetype=int, create_using=nx.MultiGraph())
|
|
168
|
-
assert H is not H2 # they should be different graphs
|
|
169
|
-
assert nodes_equal(list(H), list(G))
|
|
170
|
-
assert edges_equal(list(H.edges()), list(G.edges()))
|
|
171
|
-
|
|
172
|
-
def test_empty_digraph(self):
|
|
173
|
-
with pytest.raises(nx.NetworkXNotImplemented):
|
|
174
|
-
bytesIO = io.BytesIO()
|
|
175
|
-
bipartite.write_edgelist(nx.DiGraph(), bytesIO)
|
|
176
|
-
|
|
177
|
-
def test_raise_attribute(self):
|
|
178
|
-
with pytest.raises(AttributeError):
|
|
179
|
-
G = nx.path_graph(4)
|
|
180
|
-
bytesIO = io.BytesIO()
|
|
181
|
-
bipartite.write_edgelist(G, bytesIO)
|
|
182
|
-
|
|
183
|
-
def test_parse_edgelist(self):
|
|
184
|
-
"""Tests for conditions specific to
|
|
185
|
-
parse_edge_list method"""
|
|
186
|
-
|
|
187
|
-
# ignore strings of length less than 2
|
|
188
|
-
lines = ["1 2", "2 3", "3 1", "4", " "]
|
|
189
|
-
G = bipartite.parse_edgelist(lines, nodetype=int)
|
|
190
|
-
assert list(G.nodes) == [1, 2, 3]
|
|
191
|
-
|
|
192
|
-
# Exception raised when node is not convertible
|
|
193
|
-
# to specified data type
|
|
194
|
-
with pytest.raises(TypeError, match=".*Failed to convert nodes"):
|
|
195
|
-
lines = ["a b", "b c", "c a"]
|
|
196
|
-
G = bipartite.parse_edgelist(lines, nodetype=int)
|
|
197
|
-
|
|
198
|
-
# Exception raised when format of data is not
|
|
199
|
-
# convertible to dictionary object
|
|
200
|
-
with pytest.raises(TypeError, match=".*Failed to convert edge data"):
|
|
201
|
-
lines = ["1 2 3", "2 3 4", "3 1 2"]
|
|
202
|
-
G = bipartite.parse_edgelist(lines, nodetype=int)
|
|
203
|
-
|
|
204
|
-
# Exception raised when edge data and data
|
|
205
|
-
# keys are not of same length
|
|
206
|
-
with pytest.raises(IndexError):
|
|
207
|
-
lines = ["1 2 3 4", "2 3 4"]
|
|
208
|
-
G = bipartite.parse_edgelist(
|
|
209
|
-
lines, nodetype=int, data=[("weight", int), ("key", int)]
|
|
210
|
-
)
|
|
211
|
-
|
|
212
|
-
# Exception raised when edge data is not
|
|
213
|
-
# convertible to specified data type
|
|
214
|
-
with pytest.raises(TypeError, match=".*Failed to convert key data"):
|
|
215
|
-
lines = ["1 2 3 a", "2 3 4 b"]
|
|
216
|
-
G = bipartite.parse_edgelist(
|
|
217
|
-
lines, nodetype=int, data=[("weight", int), ("key", int)]
|
|
218
|
-
)
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
def test_bipartite_edgelist_consistent_strip_handling():
|
|
222
|
-
"""See gh-7462
|
|
223
|
-
|
|
224
|
-
Input when printed looks like:
|
|
225
|
-
|
|
226
|
-
A B interaction 2
|
|
227
|
-
B C interaction 4
|
|
228
|
-
C A interaction
|
|
229
|
-
|
|
230
|
-
Note the trailing \\t in the last line, which indicates the existence of
|
|
231
|
-
an empty data field.
|
|
232
|
-
"""
|
|
233
|
-
lines = io.StringIO(
|
|
234
|
-
"A\tB\tinteraction\t2\nB\tC\tinteraction\t4\nC\tA\tinteraction\t"
|
|
235
|
-
)
|
|
236
|
-
descr = [("type", str), ("weight", str)]
|
|
237
|
-
# Should not raise
|
|
238
|
-
G = nx.bipartite.parse_edgelist(lines, delimiter="\t", data=descr)
|
|
239
|
-
expected = [("A", "B", "2"), ("A", "C", ""), ("B", "C", "4")]
|
|
240
|
-
assert sorted(G.edges(data="weight")) == expected
|
package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_extendability.py
DELETED
|
@@ -1,334 +0,0 @@
|
|
|
1
|
-
import pytest
|
|
2
|
-
|
|
3
|
-
import networkx as nx
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
def test_selfloops_raises():
|
|
7
|
-
G = nx.ladder_graph(3)
|
|
8
|
-
G.add_edge(0, 0)
|
|
9
|
-
with pytest.raises(nx.NetworkXError, match=".*not bipartite"):
|
|
10
|
-
nx.bipartite.maximal_extendability(G)
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
def test_disconnected_raises():
|
|
14
|
-
G = nx.ladder_graph(3)
|
|
15
|
-
G.add_node("a")
|
|
16
|
-
with pytest.raises(nx.NetworkXError, match=".*not connected"):
|
|
17
|
-
nx.bipartite.maximal_extendability(G)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
def test_not_bipartite_raises():
|
|
21
|
-
G = nx.complete_graph(5)
|
|
22
|
-
with pytest.raises(nx.NetworkXError, match=".*not bipartite"):
|
|
23
|
-
nx.bipartite.maximal_extendability(G)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
def test_no_perfect_matching_raises():
|
|
27
|
-
G = nx.Graph([(0, 1), (0, 2)])
|
|
28
|
-
with pytest.raises(nx.NetworkXError, match=".*not contain a perfect matching"):
|
|
29
|
-
nx.bipartite.maximal_extendability(G)
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
def test_residual_graph_not_strongly_connected_raises():
|
|
33
|
-
G = nx.Graph([(1, 2), (2, 3), (3, 4)])
|
|
34
|
-
with pytest.raises(
|
|
35
|
-
nx.NetworkXError, match="The residual graph of G is not strongly connected"
|
|
36
|
-
):
|
|
37
|
-
nx.bipartite.maximal_extendability(G)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
def test_ladder_graph_is_1():
|
|
41
|
-
G = nx.ladder_graph(3)
|
|
42
|
-
assert nx.bipartite.maximal_extendability(G) == 1
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
def test_cubical_graph_is_2():
|
|
46
|
-
G = nx.cubical_graph()
|
|
47
|
-
assert nx.bipartite.maximal_extendability(G) == 2
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
def test_k_is_3():
|
|
51
|
-
G = nx.Graph(
|
|
52
|
-
[
|
|
53
|
-
(1, 6),
|
|
54
|
-
(1, 7),
|
|
55
|
-
(1, 8),
|
|
56
|
-
(1, 9),
|
|
57
|
-
(2, 6),
|
|
58
|
-
(2, 7),
|
|
59
|
-
(2, 8),
|
|
60
|
-
(2, 10),
|
|
61
|
-
(3, 6),
|
|
62
|
-
(3, 8),
|
|
63
|
-
(3, 9),
|
|
64
|
-
(3, 10),
|
|
65
|
-
(4, 7),
|
|
66
|
-
(4, 8),
|
|
67
|
-
(4, 9),
|
|
68
|
-
(4, 10),
|
|
69
|
-
(5, 6),
|
|
70
|
-
(5, 7),
|
|
71
|
-
(5, 9),
|
|
72
|
-
(5, 10),
|
|
73
|
-
]
|
|
74
|
-
)
|
|
75
|
-
assert nx.bipartite.maximal_extendability(G) == 3
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
def test_k_is_4():
|
|
79
|
-
G = nx.Graph(
|
|
80
|
-
[
|
|
81
|
-
(8, 1),
|
|
82
|
-
(8, 2),
|
|
83
|
-
(8, 3),
|
|
84
|
-
(8, 4),
|
|
85
|
-
(8, 5),
|
|
86
|
-
(9, 1),
|
|
87
|
-
(9, 2),
|
|
88
|
-
(9, 3),
|
|
89
|
-
(9, 4),
|
|
90
|
-
(9, 7),
|
|
91
|
-
(10, 1),
|
|
92
|
-
(10, 2),
|
|
93
|
-
(10, 3),
|
|
94
|
-
(10, 4),
|
|
95
|
-
(10, 6),
|
|
96
|
-
(11, 1),
|
|
97
|
-
(11, 2),
|
|
98
|
-
(11, 5),
|
|
99
|
-
(11, 6),
|
|
100
|
-
(11, 7),
|
|
101
|
-
(12, 1),
|
|
102
|
-
(12, 3),
|
|
103
|
-
(12, 5),
|
|
104
|
-
(12, 6),
|
|
105
|
-
(12, 7),
|
|
106
|
-
(13, 2),
|
|
107
|
-
(13, 4),
|
|
108
|
-
(13, 5),
|
|
109
|
-
(13, 6),
|
|
110
|
-
(13, 7),
|
|
111
|
-
(14, 3),
|
|
112
|
-
(14, 4),
|
|
113
|
-
(14, 5),
|
|
114
|
-
(14, 6),
|
|
115
|
-
(14, 7),
|
|
116
|
-
]
|
|
117
|
-
)
|
|
118
|
-
assert nx.bipartite.maximal_extendability(G) == 4
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
def test_k_is_5():
|
|
122
|
-
G = nx.Graph(
|
|
123
|
-
[
|
|
124
|
-
(8, 1),
|
|
125
|
-
(8, 2),
|
|
126
|
-
(8, 3),
|
|
127
|
-
(8, 4),
|
|
128
|
-
(8, 5),
|
|
129
|
-
(8, 6),
|
|
130
|
-
(9, 1),
|
|
131
|
-
(9, 2),
|
|
132
|
-
(9, 3),
|
|
133
|
-
(9, 4),
|
|
134
|
-
(9, 5),
|
|
135
|
-
(9, 7),
|
|
136
|
-
(10, 1),
|
|
137
|
-
(10, 2),
|
|
138
|
-
(10, 3),
|
|
139
|
-
(10, 4),
|
|
140
|
-
(10, 6),
|
|
141
|
-
(10, 7),
|
|
142
|
-
(11, 1),
|
|
143
|
-
(11, 2),
|
|
144
|
-
(11, 3),
|
|
145
|
-
(11, 5),
|
|
146
|
-
(11, 6),
|
|
147
|
-
(11, 7),
|
|
148
|
-
(12, 1),
|
|
149
|
-
(12, 2),
|
|
150
|
-
(12, 4),
|
|
151
|
-
(12, 5),
|
|
152
|
-
(12, 6),
|
|
153
|
-
(12, 7),
|
|
154
|
-
(13, 1),
|
|
155
|
-
(13, 3),
|
|
156
|
-
(13, 4),
|
|
157
|
-
(13, 5),
|
|
158
|
-
(13, 6),
|
|
159
|
-
(13, 7),
|
|
160
|
-
(14, 2),
|
|
161
|
-
(14, 3),
|
|
162
|
-
(14, 4),
|
|
163
|
-
(14, 5),
|
|
164
|
-
(14, 6),
|
|
165
|
-
(14, 7),
|
|
166
|
-
]
|
|
167
|
-
)
|
|
168
|
-
assert nx.bipartite.maximal_extendability(G) == 5
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
def test_k_is_6():
|
|
172
|
-
G = nx.Graph(
|
|
173
|
-
[
|
|
174
|
-
(9, 1),
|
|
175
|
-
(9, 2),
|
|
176
|
-
(9, 3),
|
|
177
|
-
(9, 4),
|
|
178
|
-
(9, 5),
|
|
179
|
-
(9, 6),
|
|
180
|
-
(9, 7),
|
|
181
|
-
(10, 1),
|
|
182
|
-
(10, 2),
|
|
183
|
-
(10, 3),
|
|
184
|
-
(10, 4),
|
|
185
|
-
(10, 5),
|
|
186
|
-
(10, 6),
|
|
187
|
-
(10, 8),
|
|
188
|
-
(11, 1),
|
|
189
|
-
(11, 2),
|
|
190
|
-
(11, 3),
|
|
191
|
-
(11, 4),
|
|
192
|
-
(11, 5),
|
|
193
|
-
(11, 7),
|
|
194
|
-
(11, 8),
|
|
195
|
-
(12, 1),
|
|
196
|
-
(12, 2),
|
|
197
|
-
(12, 3),
|
|
198
|
-
(12, 4),
|
|
199
|
-
(12, 6),
|
|
200
|
-
(12, 7),
|
|
201
|
-
(12, 8),
|
|
202
|
-
(13, 1),
|
|
203
|
-
(13, 2),
|
|
204
|
-
(13, 3),
|
|
205
|
-
(13, 5),
|
|
206
|
-
(13, 6),
|
|
207
|
-
(13, 7),
|
|
208
|
-
(13, 8),
|
|
209
|
-
(14, 1),
|
|
210
|
-
(14, 2),
|
|
211
|
-
(14, 4),
|
|
212
|
-
(14, 5),
|
|
213
|
-
(14, 6),
|
|
214
|
-
(14, 7),
|
|
215
|
-
(14, 8),
|
|
216
|
-
(15, 1),
|
|
217
|
-
(15, 3),
|
|
218
|
-
(15, 4),
|
|
219
|
-
(15, 5),
|
|
220
|
-
(15, 6),
|
|
221
|
-
(15, 7),
|
|
222
|
-
(15, 8),
|
|
223
|
-
(16, 2),
|
|
224
|
-
(16, 3),
|
|
225
|
-
(16, 4),
|
|
226
|
-
(16, 5),
|
|
227
|
-
(16, 6),
|
|
228
|
-
(16, 7),
|
|
229
|
-
(16, 8),
|
|
230
|
-
]
|
|
231
|
-
)
|
|
232
|
-
assert nx.bipartite.maximal_extendability(G) == 6
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
def test_k_is_7():
|
|
236
|
-
G = nx.Graph(
|
|
237
|
-
[
|
|
238
|
-
(1, 11),
|
|
239
|
-
(1, 12),
|
|
240
|
-
(1, 13),
|
|
241
|
-
(1, 14),
|
|
242
|
-
(1, 15),
|
|
243
|
-
(1, 16),
|
|
244
|
-
(1, 17),
|
|
245
|
-
(1, 18),
|
|
246
|
-
(2, 11),
|
|
247
|
-
(2, 12),
|
|
248
|
-
(2, 13),
|
|
249
|
-
(2, 14),
|
|
250
|
-
(2, 15),
|
|
251
|
-
(2, 16),
|
|
252
|
-
(2, 17),
|
|
253
|
-
(2, 19),
|
|
254
|
-
(3, 11),
|
|
255
|
-
(3, 12),
|
|
256
|
-
(3, 13),
|
|
257
|
-
(3, 14),
|
|
258
|
-
(3, 15),
|
|
259
|
-
(3, 16),
|
|
260
|
-
(3, 17),
|
|
261
|
-
(3, 20),
|
|
262
|
-
(4, 11),
|
|
263
|
-
(4, 12),
|
|
264
|
-
(4, 13),
|
|
265
|
-
(4, 14),
|
|
266
|
-
(4, 15),
|
|
267
|
-
(4, 16),
|
|
268
|
-
(4, 17),
|
|
269
|
-
(4, 18),
|
|
270
|
-
(4, 19),
|
|
271
|
-
(4, 20),
|
|
272
|
-
(5, 11),
|
|
273
|
-
(5, 12),
|
|
274
|
-
(5, 13),
|
|
275
|
-
(5, 14),
|
|
276
|
-
(5, 15),
|
|
277
|
-
(5, 16),
|
|
278
|
-
(5, 17),
|
|
279
|
-
(5, 18),
|
|
280
|
-
(5, 19),
|
|
281
|
-
(5, 20),
|
|
282
|
-
(6, 11),
|
|
283
|
-
(6, 12),
|
|
284
|
-
(6, 13),
|
|
285
|
-
(6, 14),
|
|
286
|
-
(6, 15),
|
|
287
|
-
(6, 16),
|
|
288
|
-
(6, 17),
|
|
289
|
-
(6, 18),
|
|
290
|
-
(6, 19),
|
|
291
|
-
(6, 20),
|
|
292
|
-
(7, 11),
|
|
293
|
-
(7, 12),
|
|
294
|
-
(7, 13),
|
|
295
|
-
(7, 14),
|
|
296
|
-
(7, 15),
|
|
297
|
-
(7, 16),
|
|
298
|
-
(7, 17),
|
|
299
|
-
(7, 18),
|
|
300
|
-
(7, 19),
|
|
301
|
-
(7, 20),
|
|
302
|
-
(8, 11),
|
|
303
|
-
(8, 12),
|
|
304
|
-
(8, 13),
|
|
305
|
-
(8, 14),
|
|
306
|
-
(8, 15),
|
|
307
|
-
(8, 16),
|
|
308
|
-
(8, 17),
|
|
309
|
-
(8, 18),
|
|
310
|
-
(8, 19),
|
|
311
|
-
(8, 20),
|
|
312
|
-
(9, 11),
|
|
313
|
-
(9, 12),
|
|
314
|
-
(9, 13),
|
|
315
|
-
(9, 14),
|
|
316
|
-
(9, 15),
|
|
317
|
-
(9, 16),
|
|
318
|
-
(9, 17),
|
|
319
|
-
(9, 18),
|
|
320
|
-
(9, 19),
|
|
321
|
-
(9, 20),
|
|
322
|
-
(10, 11),
|
|
323
|
-
(10, 12),
|
|
324
|
-
(10, 13),
|
|
325
|
-
(10, 14),
|
|
326
|
-
(10, 15),
|
|
327
|
-
(10, 16),
|
|
328
|
-
(10, 17),
|
|
329
|
-
(10, 18),
|
|
330
|
-
(10, 19),
|
|
331
|
-
(10, 20),
|
|
332
|
-
]
|
|
333
|
-
)
|
|
334
|
-
assert nx.bipartite.maximal_extendability(G) == 7
|