okstra 0.114.0 → 0.116.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/docs/kr/architecture.md +2 -2
- package/docs/kr/follow-ups/2026-07-10-final-report-option-3.md +51 -0
- package/package.json +1 -1
- package/runtime/BUILD.json +2 -2
- package/runtime/agents/workers/report-writer-worker.md +1 -0
- package/runtime/prompts/launch.template.md +34 -0
- package/runtime/prompts/lead/convergence.md +2 -0
- package/runtime/prompts/lead/okstra-lead-contract.md +1 -1
- package/runtime/prompts/lead/report-writer.md +1 -1
- package/runtime/prompts/profiles/implementation-planning.md +1 -0
- package/runtime/python/okstra_ctl/implementation_stage.py +46 -39
- package/runtime/python/okstra_ctl/incremental_carry.py +70 -0
- package/runtime/python/okstra_ctl/incremental_scope.py +89 -0
- package/runtime/python/okstra_ctl/report_views.py +151 -12
- package/runtime/python/okstra_ctl/run.py +24 -24
- package/runtime/python/okstra_ctl/stage_targets.py +26 -0
- 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 +39 -0
- package/runtime/templates/reports/final-report.template.md +27 -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-run.py +50 -0
- package/src/cli-registry.mjs +14 -0
- package/src/commands/execute/incremental-carry.mjs +20 -0
- package/src/commands/execute/incremental-scope.mjs +20 -0
- 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,131 +0,0 @@
|
|
|
1
|
-
import networkx as nx
|
|
2
|
-
|
|
3
|
-
from .test_digraph import BaseDiGraphTester
|
|
4
|
-
from .test_digraph import TestDiGraph as _TestDiGraph
|
|
5
|
-
from .test_graph import BaseGraphTester
|
|
6
|
-
from .test_graph import TestGraph as _TestGraph
|
|
7
|
-
from .test_multidigraph import TestMultiDiGraph as _TestMultiDiGraph
|
|
8
|
-
from .test_multigraph import TestMultiGraph as _TestMultiGraph
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
def test_factories():
|
|
12
|
-
class mydict1(dict):
|
|
13
|
-
pass
|
|
14
|
-
|
|
15
|
-
class mydict2(dict):
|
|
16
|
-
pass
|
|
17
|
-
|
|
18
|
-
class mydict3(dict):
|
|
19
|
-
pass
|
|
20
|
-
|
|
21
|
-
class mydict4(dict):
|
|
22
|
-
pass
|
|
23
|
-
|
|
24
|
-
class mydict5(dict):
|
|
25
|
-
pass
|
|
26
|
-
|
|
27
|
-
for Graph in (nx.Graph, nx.DiGraph, nx.MultiGraph, nx.MultiDiGraph):
|
|
28
|
-
|
|
29
|
-
class MyGraph(Graph):
|
|
30
|
-
node_dict_factory = mydict1
|
|
31
|
-
adjlist_outer_dict_factory = mydict2
|
|
32
|
-
adjlist_inner_dict_factory = mydict3
|
|
33
|
-
edge_key_dict_factory = mydict4
|
|
34
|
-
edge_attr_dict_factory = mydict5
|
|
35
|
-
|
|
36
|
-
G = MyGraph()
|
|
37
|
-
assert isinstance(G._node, mydict1)
|
|
38
|
-
assert isinstance(G._adj, mydict2)
|
|
39
|
-
G.add_node(1)
|
|
40
|
-
assert isinstance(G._adj[1], mydict3)
|
|
41
|
-
if G.is_directed():
|
|
42
|
-
assert isinstance(G._pred, mydict2)
|
|
43
|
-
assert isinstance(G._succ, mydict2)
|
|
44
|
-
assert isinstance(G._pred[1], mydict3)
|
|
45
|
-
G.add_edge(1, 2)
|
|
46
|
-
if G.is_multigraph():
|
|
47
|
-
assert isinstance(G._adj[1][2], mydict4)
|
|
48
|
-
assert isinstance(G._adj[1][2][0], mydict5)
|
|
49
|
-
else:
|
|
50
|
-
assert isinstance(G._adj[1][2], mydict5)
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
class TestSpecialGraph(_TestGraph):
|
|
54
|
-
def setup_method(self):
|
|
55
|
-
_TestGraph.setup_method(self)
|
|
56
|
-
self.Graph = nx.Graph
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
class TestThinGraph(BaseGraphTester):
|
|
60
|
-
def setup_method(self):
|
|
61
|
-
all_edge_dict = {"weight": 1}
|
|
62
|
-
|
|
63
|
-
class MyGraph(nx.Graph):
|
|
64
|
-
def edge_attr_dict_factory(self):
|
|
65
|
-
return all_edge_dict
|
|
66
|
-
|
|
67
|
-
self.Graph = MyGraph
|
|
68
|
-
# build dict-of-dict-of-dict K3
|
|
69
|
-
ed1, ed2, ed3 = (all_edge_dict, all_edge_dict, all_edge_dict)
|
|
70
|
-
self.k3adj = {0: {1: ed1, 2: ed2}, 1: {0: ed1, 2: ed3}, 2: {0: ed2, 1: ed3}}
|
|
71
|
-
self.k3edges = [(0, 1), (0, 2), (1, 2)]
|
|
72
|
-
self.k3nodes = [0, 1, 2]
|
|
73
|
-
self.K3 = self.Graph()
|
|
74
|
-
self.K3._adj = self.k3adj
|
|
75
|
-
self.K3._node = {}
|
|
76
|
-
self.K3._node[0] = {}
|
|
77
|
-
self.K3._node[1] = {}
|
|
78
|
-
self.K3._node[2] = {}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
class TestSpecialDiGraph(_TestDiGraph):
|
|
82
|
-
def setup_method(self):
|
|
83
|
-
_TestDiGraph.setup_method(self)
|
|
84
|
-
self.Graph = nx.DiGraph
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
class TestThinDiGraph(BaseDiGraphTester):
|
|
88
|
-
def setup_method(self):
|
|
89
|
-
all_edge_dict = {"weight": 1}
|
|
90
|
-
|
|
91
|
-
class MyGraph(nx.DiGraph):
|
|
92
|
-
def edge_attr_dict_factory(self):
|
|
93
|
-
return all_edge_dict
|
|
94
|
-
|
|
95
|
-
self.Graph = MyGraph
|
|
96
|
-
# build dict-of-dict-of-dict K3
|
|
97
|
-
ed1, ed2, ed3 = (all_edge_dict, all_edge_dict, all_edge_dict)
|
|
98
|
-
ed4, ed5, ed6 = (all_edge_dict, all_edge_dict, all_edge_dict)
|
|
99
|
-
self.k3adj = {0: {1: ed1, 2: ed2}, 1: {0: ed3, 2: ed4}, 2: {0: ed5, 1: ed6}}
|
|
100
|
-
self.k3edges = [(0, 1), (0, 2), (1, 2)]
|
|
101
|
-
self.k3nodes = [0, 1, 2]
|
|
102
|
-
self.K3 = self.Graph()
|
|
103
|
-
self.K3._succ = self.k3adj
|
|
104
|
-
# K3._adj is synced with K3._succ
|
|
105
|
-
self.K3._pred = {0: {1: ed3, 2: ed5}, 1: {0: ed1, 2: ed6}, 2: {0: ed2, 1: ed4}}
|
|
106
|
-
self.K3._node = {}
|
|
107
|
-
self.K3._node[0] = {}
|
|
108
|
-
self.K3._node[1] = {}
|
|
109
|
-
self.K3._node[2] = {}
|
|
110
|
-
|
|
111
|
-
ed1, ed2 = (all_edge_dict, all_edge_dict)
|
|
112
|
-
self.P3 = self.Graph()
|
|
113
|
-
self.P3._succ = {0: {1: ed1}, 1: {2: ed2}, 2: {}}
|
|
114
|
-
# P3._adj is synced with P3._succ
|
|
115
|
-
self.P3._pred = {0: {}, 1: {0: ed1}, 2: {1: ed2}}
|
|
116
|
-
self.P3._node = {}
|
|
117
|
-
self.P3._node[0] = {}
|
|
118
|
-
self.P3._node[1] = {}
|
|
119
|
-
self.P3._node[2] = {}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
class TestSpecialMultiGraph(_TestMultiGraph):
|
|
123
|
-
def setup_method(self):
|
|
124
|
-
_TestMultiGraph.setup_method(self)
|
|
125
|
-
self.Graph = nx.MultiGraph
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
class TestSpecialMultiDiGraph(_TestMultiDiGraph):
|
|
129
|
-
def setup_method(self):
|
|
130
|
-
_TestMultiDiGraph.setup_method(self)
|
|
131
|
-
self.Graph = nx.MultiDiGraph
|
|
@@ -1,371 +0,0 @@
|
|
|
1
|
-
import pytest
|
|
2
|
-
|
|
3
|
-
import networkx as nx
|
|
4
|
-
from networkx.utils import edges_equal
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class TestSubGraphView:
|
|
8
|
-
gview = staticmethod(nx.subgraph_view)
|
|
9
|
-
graph = nx.Graph
|
|
10
|
-
hide_edges_filter = staticmethod(nx.filters.hide_edges)
|
|
11
|
-
show_edges_filter = staticmethod(nx.filters.show_edges)
|
|
12
|
-
|
|
13
|
-
@classmethod
|
|
14
|
-
def setup_class(cls):
|
|
15
|
-
cls.G = nx.path_graph(9, create_using=cls.graph())
|
|
16
|
-
cls.hide_edges_w_hide_nodes = {(3, 4), (4, 5), (5, 6)}
|
|
17
|
-
|
|
18
|
-
def test_hidden_nodes(self):
|
|
19
|
-
hide_nodes = [4, 5, 111]
|
|
20
|
-
nodes_gone = nx.filters.hide_nodes(hide_nodes)
|
|
21
|
-
gview = self.gview
|
|
22
|
-
G = gview(self.G, filter_node=nodes_gone)
|
|
23
|
-
assert self.G.nodes - G.nodes == {4, 5}
|
|
24
|
-
assert self.G.edges - G.edges == self.hide_edges_w_hide_nodes
|
|
25
|
-
if G.is_directed():
|
|
26
|
-
assert list(G[3]) == []
|
|
27
|
-
assert list(G[2]) == [3]
|
|
28
|
-
else:
|
|
29
|
-
assert list(G[3]) == [2]
|
|
30
|
-
assert set(G[2]) == {1, 3}
|
|
31
|
-
pytest.raises(KeyError, G.__getitem__, 4)
|
|
32
|
-
pytest.raises(KeyError, G.__getitem__, 112)
|
|
33
|
-
pytest.raises(KeyError, G.__getitem__, 111)
|
|
34
|
-
assert G.degree(3) == (3 if G.is_multigraph() else 1)
|
|
35
|
-
assert G.size() == (7 if G.is_multigraph() else 5)
|
|
36
|
-
|
|
37
|
-
def test_hidden_edges(self):
|
|
38
|
-
hide_edges = [(2, 3), (8, 7), (222, 223)]
|
|
39
|
-
edges_gone = self.hide_edges_filter(hide_edges)
|
|
40
|
-
gview = self.gview
|
|
41
|
-
G = gview(self.G, filter_edge=edges_gone)
|
|
42
|
-
assert self.G.nodes == G.nodes
|
|
43
|
-
if G.is_directed():
|
|
44
|
-
assert self.G.edges - G.edges == {(2, 3)}
|
|
45
|
-
assert list(G[2]) == []
|
|
46
|
-
assert list(G.pred[3]) == []
|
|
47
|
-
assert list(G.pred[2]) == [1]
|
|
48
|
-
assert G.size() == 7
|
|
49
|
-
else:
|
|
50
|
-
assert self.G.edges - G.edges == {(2, 3), (7, 8)}
|
|
51
|
-
assert list(G[2]) == [1]
|
|
52
|
-
assert G.size() == 6
|
|
53
|
-
assert list(G[3]) == [4]
|
|
54
|
-
pytest.raises(KeyError, G.__getitem__, 221)
|
|
55
|
-
pytest.raises(KeyError, G.__getitem__, 222)
|
|
56
|
-
assert G.degree(3) == 1
|
|
57
|
-
|
|
58
|
-
def test_shown_node(self):
|
|
59
|
-
induced_subgraph = nx.filters.show_nodes([2, 3, 111])
|
|
60
|
-
gview = self.gview
|
|
61
|
-
G = gview(self.G, filter_node=induced_subgraph)
|
|
62
|
-
assert set(G.nodes) == {2, 3}
|
|
63
|
-
if G.is_directed():
|
|
64
|
-
assert list(G[3]) == []
|
|
65
|
-
else:
|
|
66
|
-
assert list(G[3]) == [2]
|
|
67
|
-
assert list(G[2]) == [3]
|
|
68
|
-
pytest.raises(KeyError, G.__getitem__, 4)
|
|
69
|
-
pytest.raises(KeyError, G.__getitem__, 112)
|
|
70
|
-
pytest.raises(KeyError, G.__getitem__, 111)
|
|
71
|
-
assert G.degree(3) == (3 if G.is_multigraph() else 1)
|
|
72
|
-
assert G.size() == (3 if G.is_multigraph() else 1)
|
|
73
|
-
|
|
74
|
-
def test_shown_edges(self):
|
|
75
|
-
show_edges = [(2, 3), (8, 7), (222, 223)]
|
|
76
|
-
edge_subgraph = self.show_edges_filter(show_edges)
|
|
77
|
-
G = self.gview(self.G, filter_edge=edge_subgraph)
|
|
78
|
-
assert self.G.nodes == G.nodes
|
|
79
|
-
if G.is_directed():
|
|
80
|
-
assert G.edges == {(2, 3)}
|
|
81
|
-
assert list(G[3]) == []
|
|
82
|
-
assert list(G[2]) == [3]
|
|
83
|
-
assert list(G.pred[3]) == [2]
|
|
84
|
-
assert list(G.pred[2]) == []
|
|
85
|
-
assert G.size() == 1
|
|
86
|
-
else:
|
|
87
|
-
assert G.edges == {(2, 3), (7, 8)}
|
|
88
|
-
assert list(G[3]) == [2]
|
|
89
|
-
assert list(G[2]) == [3]
|
|
90
|
-
assert G.size() == 2
|
|
91
|
-
pytest.raises(KeyError, G.__getitem__, 221)
|
|
92
|
-
pytest.raises(KeyError, G.__getitem__, 222)
|
|
93
|
-
assert G.degree(3) == 1
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
class TestSubDiGraphView(TestSubGraphView):
|
|
97
|
-
gview = staticmethod(nx.subgraph_view)
|
|
98
|
-
graph = nx.DiGraph
|
|
99
|
-
hide_edges_filter = staticmethod(nx.filters.hide_diedges)
|
|
100
|
-
show_edges_filter = staticmethod(nx.filters.show_diedges)
|
|
101
|
-
hide_edges = [(2, 3), (8, 7), (222, 223)]
|
|
102
|
-
excluded = {(2, 3), (3, 4), (4, 5), (5, 6)}
|
|
103
|
-
|
|
104
|
-
def test_inoutedges(self):
|
|
105
|
-
edges_gone = self.hide_edges_filter(self.hide_edges)
|
|
106
|
-
hide_nodes = [4, 5, 111]
|
|
107
|
-
nodes_gone = nx.filters.hide_nodes(hide_nodes)
|
|
108
|
-
G = self.gview(self.G, filter_node=nodes_gone, filter_edge=edges_gone)
|
|
109
|
-
|
|
110
|
-
assert self.G.in_edges - G.in_edges == self.excluded
|
|
111
|
-
assert self.G.out_edges - G.out_edges == self.excluded
|
|
112
|
-
|
|
113
|
-
def test_pred(self):
|
|
114
|
-
edges_gone = self.hide_edges_filter(self.hide_edges)
|
|
115
|
-
hide_nodes = [4, 5, 111]
|
|
116
|
-
nodes_gone = nx.filters.hide_nodes(hide_nodes)
|
|
117
|
-
G = self.gview(self.G, filter_node=nodes_gone, filter_edge=edges_gone)
|
|
118
|
-
|
|
119
|
-
assert list(G.pred[2]) == [1]
|
|
120
|
-
assert list(G.pred[6]) == []
|
|
121
|
-
|
|
122
|
-
def test_inout_degree(self):
|
|
123
|
-
edges_gone = self.hide_edges_filter(self.hide_edges)
|
|
124
|
-
hide_nodes = [4, 5, 111]
|
|
125
|
-
nodes_gone = nx.filters.hide_nodes(hide_nodes)
|
|
126
|
-
G = self.gview(self.G, filter_node=nodes_gone, filter_edge=edges_gone)
|
|
127
|
-
|
|
128
|
-
assert G.degree(2) == 1
|
|
129
|
-
assert G.out_degree(2) == 0
|
|
130
|
-
assert G.in_degree(2) == 1
|
|
131
|
-
assert G.size() == 4
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
# multigraph
|
|
135
|
-
class TestMultiGraphView(TestSubGraphView):
|
|
136
|
-
gview = staticmethod(nx.subgraph_view)
|
|
137
|
-
graph = nx.MultiGraph
|
|
138
|
-
hide_edges_filter = staticmethod(nx.filters.hide_multiedges)
|
|
139
|
-
show_edges_filter = staticmethod(nx.filters.show_multiedges)
|
|
140
|
-
|
|
141
|
-
@classmethod
|
|
142
|
-
def setup_class(cls):
|
|
143
|
-
cls.G = nx.path_graph(9, create_using=cls.graph())
|
|
144
|
-
multiedges = {(2, 3, 4), (2, 3, 5)}
|
|
145
|
-
cls.G.add_edges_from(multiedges)
|
|
146
|
-
cls.hide_edges_w_hide_nodes = {(3, 4, 0), (4, 5, 0), (5, 6, 0)}
|
|
147
|
-
|
|
148
|
-
def test_hidden_edges(self):
|
|
149
|
-
hide_edges = [(2, 3, 4), (2, 3, 3), (8, 7, 0), (222, 223, 0)]
|
|
150
|
-
edges_gone = self.hide_edges_filter(hide_edges)
|
|
151
|
-
G = self.gview(self.G, filter_edge=edges_gone)
|
|
152
|
-
assert self.G.nodes == G.nodes
|
|
153
|
-
if G.is_directed():
|
|
154
|
-
assert self.G.edges - G.edges == {(2, 3, 4)}
|
|
155
|
-
assert list(G[3]) == [4]
|
|
156
|
-
assert list(G[2]) == [3]
|
|
157
|
-
assert list(G.pred[3]) == [2] # only one 2 but two edges
|
|
158
|
-
assert list(G.pred[2]) == [1]
|
|
159
|
-
assert G.size() == 9
|
|
160
|
-
else:
|
|
161
|
-
assert self.G.edges - G.edges == {(2, 3, 4), (7, 8, 0)}
|
|
162
|
-
assert list(G[3]) == [2, 4]
|
|
163
|
-
assert list(G[2]) == [1, 3]
|
|
164
|
-
assert G.size() == 8
|
|
165
|
-
assert G.degree(3) == 3
|
|
166
|
-
pytest.raises(KeyError, G.__getitem__, 221)
|
|
167
|
-
pytest.raises(KeyError, G.__getitem__, 222)
|
|
168
|
-
|
|
169
|
-
def test_shown_edges(self):
|
|
170
|
-
show_edges = [(2, 3, 4), (2, 3, 3), (8, 7, 0), (222, 223, 0)]
|
|
171
|
-
edge_subgraph = self.show_edges_filter(show_edges)
|
|
172
|
-
G = self.gview(self.G, filter_edge=edge_subgraph)
|
|
173
|
-
assert self.G.nodes == G.nodes
|
|
174
|
-
if G.is_directed():
|
|
175
|
-
assert G.edges == {(2, 3, 4)}
|
|
176
|
-
assert list(G[3]) == []
|
|
177
|
-
assert list(G.pred[3]) == [2]
|
|
178
|
-
assert list(G.pred[2]) == []
|
|
179
|
-
assert G.size() == 1
|
|
180
|
-
else:
|
|
181
|
-
assert G.edges == {(2, 3, 4), (7, 8, 0)}
|
|
182
|
-
assert G.size() == 2
|
|
183
|
-
assert list(G[3]) == [2]
|
|
184
|
-
assert G.degree(3) == 1
|
|
185
|
-
assert list(G[2]) == [3]
|
|
186
|
-
pytest.raises(KeyError, G.__getitem__, 221)
|
|
187
|
-
pytest.raises(KeyError, G.__getitem__, 222)
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
# multidigraph
|
|
191
|
-
class TestMultiDiGraphView(TestMultiGraphView, TestSubDiGraphView):
|
|
192
|
-
gview = staticmethod(nx.subgraph_view)
|
|
193
|
-
graph = nx.MultiDiGraph
|
|
194
|
-
hide_edges_filter = staticmethod(nx.filters.hide_multidiedges)
|
|
195
|
-
show_edges_filter = staticmethod(nx.filters.show_multidiedges)
|
|
196
|
-
hide_edges = [(2, 3, 0), (8, 7, 0), (222, 223, 0)]
|
|
197
|
-
excluded = {(2, 3, 0), (3, 4, 0), (4, 5, 0), (5, 6, 0)}
|
|
198
|
-
|
|
199
|
-
def test_inout_degree(self):
|
|
200
|
-
edges_gone = self.hide_edges_filter(self.hide_edges)
|
|
201
|
-
hide_nodes = [4, 5, 111]
|
|
202
|
-
nodes_gone = nx.filters.hide_nodes(hide_nodes)
|
|
203
|
-
G = self.gview(self.G, filter_node=nodes_gone, filter_edge=edges_gone)
|
|
204
|
-
|
|
205
|
-
assert G.degree(2) == 3
|
|
206
|
-
assert G.out_degree(2) == 2
|
|
207
|
-
assert G.in_degree(2) == 1
|
|
208
|
-
assert G.size() == 6
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
# induced_subgraph
|
|
212
|
-
class TestInducedSubGraph:
|
|
213
|
-
@classmethod
|
|
214
|
-
def setup_class(cls):
|
|
215
|
-
cls.K3 = G = nx.complete_graph(3)
|
|
216
|
-
G.graph["foo"] = []
|
|
217
|
-
G.nodes[0]["foo"] = []
|
|
218
|
-
G.remove_edge(1, 2)
|
|
219
|
-
ll = []
|
|
220
|
-
G.add_edge(1, 2, foo=ll)
|
|
221
|
-
G.add_edge(2, 1, foo=ll)
|
|
222
|
-
|
|
223
|
-
def test_full_graph(self):
|
|
224
|
-
G = self.K3
|
|
225
|
-
H = nx.induced_subgraph(G, [0, 1, 2, 5])
|
|
226
|
-
assert H.name == G.name
|
|
227
|
-
self.graphs_equal(H, G)
|
|
228
|
-
self.same_attrdict(H, G)
|
|
229
|
-
|
|
230
|
-
def test_partial_subgraph(self):
|
|
231
|
-
G = self.K3
|
|
232
|
-
H = nx.induced_subgraph(G, 0)
|
|
233
|
-
assert dict(H.adj) == {0: {}}
|
|
234
|
-
assert dict(G.adj) != {0: {}}
|
|
235
|
-
|
|
236
|
-
H = nx.induced_subgraph(G, [0, 1])
|
|
237
|
-
assert dict(H.adj) == {0: {1: {}}, 1: {0: {}}}
|
|
238
|
-
|
|
239
|
-
def same_attrdict(self, H, G):
|
|
240
|
-
old_foo = H[1][2]["foo"]
|
|
241
|
-
H.edges[1, 2]["foo"] = "baz"
|
|
242
|
-
assert G.edges == H.edges
|
|
243
|
-
H.edges[1, 2]["foo"] = old_foo
|
|
244
|
-
assert G.edges == H.edges
|
|
245
|
-
old_foo = H.nodes[0]["foo"]
|
|
246
|
-
H.nodes[0]["foo"] = "baz"
|
|
247
|
-
assert G.nodes == H.nodes
|
|
248
|
-
H.nodes[0]["foo"] = old_foo
|
|
249
|
-
assert G.nodes == H.nodes
|
|
250
|
-
|
|
251
|
-
def graphs_equal(self, H, G):
|
|
252
|
-
assert G._adj == H._adj
|
|
253
|
-
assert G._node == H._node
|
|
254
|
-
assert G.graph == H.graph
|
|
255
|
-
assert G.name == H.name
|
|
256
|
-
if not G.is_directed() and not H.is_directed():
|
|
257
|
-
assert H._adj[1][2] is H._adj[2][1]
|
|
258
|
-
assert G._adj[1][2] is G._adj[2][1]
|
|
259
|
-
else: # at least one is directed
|
|
260
|
-
if not G.is_directed():
|
|
261
|
-
G._pred = G._adj
|
|
262
|
-
G._succ = G._adj
|
|
263
|
-
if not H.is_directed():
|
|
264
|
-
H._pred = H._adj
|
|
265
|
-
H._succ = H._adj
|
|
266
|
-
assert G._pred == H._pred
|
|
267
|
-
assert G._succ == H._succ
|
|
268
|
-
assert H._succ[1][2] is H._pred[2][1]
|
|
269
|
-
assert G._succ[1][2] is G._pred[2][1]
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
# edge_subgraph
|
|
273
|
-
class TestEdgeSubGraph:
|
|
274
|
-
@classmethod
|
|
275
|
-
def setup_class(cls):
|
|
276
|
-
# Create a path graph on five nodes.
|
|
277
|
-
cls.G = G = nx.path_graph(5)
|
|
278
|
-
# Add some node, edge, and graph attributes.
|
|
279
|
-
for i in range(5):
|
|
280
|
-
G.nodes[i]["name"] = f"node{i}"
|
|
281
|
-
G.edges[0, 1]["name"] = "edge01"
|
|
282
|
-
G.edges[3, 4]["name"] = "edge34"
|
|
283
|
-
G.graph["name"] = "graph"
|
|
284
|
-
# Get the subgraph induced by the first and last edges.
|
|
285
|
-
cls.H = nx.edge_subgraph(G, [(0, 1), (3, 4)])
|
|
286
|
-
|
|
287
|
-
def test_correct_nodes(self):
|
|
288
|
-
"""Tests that the subgraph has the correct nodes."""
|
|
289
|
-
assert [(0, "node0"), (1, "node1"), (3, "node3"), (4, "node4")] == sorted(
|
|
290
|
-
self.H.nodes.data("name")
|
|
291
|
-
)
|
|
292
|
-
|
|
293
|
-
def test_correct_edges(self):
|
|
294
|
-
"""Tests that the subgraph has the correct edges."""
|
|
295
|
-
assert edges_equal(
|
|
296
|
-
[(0, 1, "edge01"), (3, 4, "edge34")], self.H.edges.data("name")
|
|
297
|
-
)
|
|
298
|
-
|
|
299
|
-
def test_add_node(self):
|
|
300
|
-
"""Tests that adding a node to the original graph does not
|
|
301
|
-
affect the nodes of the subgraph.
|
|
302
|
-
|
|
303
|
-
"""
|
|
304
|
-
self.G.add_node(5)
|
|
305
|
-
assert [0, 1, 3, 4] == sorted(self.H.nodes)
|
|
306
|
-
self.G.remove_node(5)
|
|
307
|
-
|
|
308
|
-
def test_remove_node(self):
|
|
309
|
-
"""Tests that removing a node in the original graph
|
|
310
|
-
removes the nodes of the subgraph.
|
|
311
|
-
|
|
312
|
-
"""
|
|
313
|
-
self.G.remove_node(0)
|
|
314
|
-
assert [1, 3, 4] == sorted(self.H.nodes)
|
|
315
|
-
self.G.add_node(0, name="node0")
|
|
316
|
-
self.G.add_edge(0, 1, name="edge01")
|
|
317
|
-
|
|
318
|
-
def test_node_attr_dict(self):
|
|
319
|
-
"""Tests that the node attribute dictionary of the two graphs is
|
|
320
|
-
the same object.
|
|
321
|
-
|
|
322
|
-
"""
|
|
323
|
-
for v in self.H:
|
|
324
|
-
assert self.G.nodes[v] == self.H.nodes[v]
|
|
325
|
-
# Making a change to G should make a change in H and vice versa.
|
|
326
|
-
self.G.nodes[0]["name"] = "foo"
|
|
327
|
-
assert self.G.nodes[0] == self.H.nodes[0]
|
|
328
|
-
self.H.nodes[1]["name"] = "bar"
|
|
329
|
-
assert self.G.nodes[1] == self.H.nodes[1]
|
|
330
|
-
# Revert the change, so tests pass with pytest-randomly
|
|
331
|
-
self.G.nodes[0]["name"] = "node0"
|
|
332
|
-
self.H.nodes[1]["name"] = "node1"
|
|
333
|
-
|
|
334
|
-
def test_edge_attr_dict(self):
|
|
335
|
-
"""Tests that the edge attribute dictionary of the two graphs is
|
|
336
|
-
the same object.
|
|
337
|
-
|
|
338
|
-
"""
|
|
339
|
-
for u, v in self.H.edges():
|
|
340
|
-
assert self.G.edges[u, v] == self.H.edges[u, v]
|
|
341
|
-
# Making a change to G should make a change in H and vice versa.
|
|
342
|
-
self.G.edges[0, 1]["name"] = "foo"
|
|
343
|
-
assert self.G.edges[0, 1]["name"] == self.H.edges[0, 1]["name"]
|
|
344
|
-
self.H.edges[3, 4]["name"] = "bar"
|
|
345
|
-
assert self.G.edges[3, 4]["name"] == self.H.edges[3, 4]["name"]
|
|
346
|
-
# Revert the change, so tests pass with pytest-randomly
|
|
347
|
-
self.G.edges[0, 1]["name"] = "edge01"
|
|
348
|
-
self.H.edges[3, 4]["name"] = "edge34"
|
|
349
|
-
|
|
350
|
-
def test_graph_attr_dict(self):
|
|
351
|
-
"""Tests that the graph attribute dictionary of the two graphs
|
|
352
|
-
is the same object.
|
|
353
|
-
|
|
354
|
-
"""
|
|
355
|
-
assert self.G.graph is self.H.graph
|
|
356
|
-
|
|
357
|
-
def test_readonly(self):
|
|
358
|
-
"""Tests that the subgraph cannot change the graph structure"""
|
|
359
|
-
pytest.raises(nx.NetworkXError, self.H.add_node, 5)
|
|
360
|
-
pytest.raises(nx.NetworkXError, self.H.remove_node, 0)
|
|
361
|
-
pytest.raises(nx.NetworkXError, self.H.add_edge, 5, 6)
|
|
362
|
-
pytest.raises(nx.NetworkXError, self.H.remove_edge, 0, 1)
|
|
363
|
-
|
|
364
|
-
@pytest.mark.parametrize("multigraph", (nx.MultiGraph, nx.MultiDiGraph))
|
|
365
|
-
def test_multigraph_filtered_edges(self, multigraph):
|
|
366
|
-
"""Check edge visibility in FilterMultiInner on edge_subgraph's of
|
|
367
|
-
multigraphs. See gh-7724."""
|
|
368
|
-
G = multigraph([("a", "b"), ("a", "c"), ("c", "b")])
|
|
369
|
-
H = nx.edge_subgraph(G, [("a", "b", 0), ("c", "b", 0)])
|
|
370
|
-
assert "c" not in H["a"]
|
|
371
|
-
assert not H.has_edge("a", "c")
|