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,189 +0,0 @@
|
|
|
1
|
-
"""Generators - Directed Graphs
|
|
2
|
-
----------------------------
|
|
3
|
-
"""
|
|
4
|
-
|
|
5
|
-
import pytest
|
|
6
|
-
|
|
7
|
-
import networkx as nx
|
|
8
|
-
from networkx.classes import Graph, MultiDiGraph
|
|
9
|
-
from networkx.generators.directed import (
|
|
10
|
-
_random_k_out_graph_numpy,
|
|
11
|
-
_random_k_out_graph_python,
|
|
12
|
-
gn_graph,
|
|
13
|
-
gnc_graph,
|
|
14
|
-
gnr_graph,
|
|
15
|
-
random_k_out_graph,
|
|
16
|
-
random_uniform_k_out_graph,
|
|
17
|
-
scale_free_graph,
|
|
18
|
-
)
|
|
19
|
-
|
|
20
|
-
try:
|
|
21
|
-
import numpy as np
|
|
22
|
-
|
|
23
|
-
has_numpy = True
|
|
24
|
-
except ImportError:
|
|
25
|
-
has_numpy = False
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
class TestGeneratorsDirected:
|
|
29
|
-
def test_smoke_test_random_graphs(self):
|
|
30
|
-
gn_graph(100)
|
|
31
|
-
gnr_graph(100, 0.5)
|
|
32
|
-
gnc_graph(100)
|
|
33
|
-
scale_free_graph(100)
|
|
34
|
-
|
|
35
|
-
gn_graph(100, seed=42)
|
|
36
|
-
gnr_graph(100, 0.5, seed=42)
|
|
37
|
-
gnc_graph(100, seed=42)
|
|
38
|
-
scale_free_graph(100, seed=42)
|
|
39
|
-
|
|
40
|
-
def test_create_using_keyword_arguments(self):
|
|
41
|
-
pytest.raises(nx.NetworkXError, gn_graph, 100, create_using=Graph())
|
|
42
|
-
pytest.raises(nx.NetworkXError, gnr_graph, 100, 0.5, create_using=Graph())
|
|
43
|
-
pytest.raises(nx.NetworkXError, gnc_graph, 100, create_using=Graph())
|
|
44
|
-
G = gn_graph(100, seed=1)
|
|
45
|
-
MG = gn_graph(100, create_using=MultiDiGraph(), seed=1)
|
|
46
|
-
assert sorted(G.edges()) == sorted(MG.edges())
|
|
47
|
-
G = gnr_graph(100, 0.5, seed=1)
|
|
48
|
-
MG = gnr_graph(100, 0.5, create_using=MultiDiGraph(), seed=1)
|
|
49
|
-
assert sorted(G.edges()) == sorted(MG.edges())
|
|
50
|
-
G = gnc_graph(100, seed=1)
|
|
51
|
-
MG = gnc_graph(100, create_using=MultiDiGraph(), seed=1)
|
|
52
|
-
assert sorted(G.edges()) == sorted(MG.edges())
|
|
53
|
-
|
|
54
|
-
G = scale_free_graph(
|
|
55
|
-
100,
|
|
56
|
-
alpha=0.3,
|
|
57
|
-
beta=0.4,
|
|
58
|
-
gamma=0.3,
|
|
59
|
-
delta_in=0.3,
|
|
60
|
-
delta_out=0.1,
|
|
61
|
-
initial_graph=nx.cycle_graph(4, create_using=MultiDiGraph),
|
|
62
|
-
seed=1,
|
|
63
|
-
)
|
|
64
|
-
pytest.raises(ValueError, scale_free_graph, 100, 0.5, 0.4, 0.3)
|
|
65
|
-
pytest.raises(ValueError, scale_free_graph, 100, alpha=-0.3)
|
|
66
|
-
pytest.raises(ValueError, scale_free_graph, 100, beta=-0.3)
|
|
67
|
-
pytest.raises(ValueError, scale_free_graph, 100, gamma=-0.3)
|
|
68
|
-
|
|
69
|
-
def test_parameters(self):
|
|
70
|
-
G = nx.DiGraph()
|
|
71
|
-
G.add_node(0)
|
|
72
|
-
|
|
73
|
-
def kernel(x):
|
|
74
|
-
return x
|
|
75
|
-
|
|
76
|
-
assert nx.is_isomorphic(gn_graph(1), G)
|
|
77
|
-
assert nx.is_isomorphic(gn_graph(1, kernel=kernel), G)
|
|
78
|
-
assert nx.is_isomorphic(gnc_graph(1), G)
|
|
79
|
-
assert nx.is_isomorphic(gnr_graph(1, 0.5), G)
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
def test_scale_free_graph_negative_delta():
|
|
83
|
-
with pytest.raises(ValueError, match="delta_in must be >= 0."):
|
|
84
|
-
scale_free_graph(10, delta_in=-1)
|
|
85
|
-
with pytest.raises(ValueError, match="delta_out must be >= 0."):
|
|
86
|
-
scale_free_graph(10, delta_out=-1)
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
def test_non_numeric_ordering():
|
|
90
|
-
G = MultiDiGraph([("a", "b"), ("b", "c"), ("c", "a")])
|
|
91
|
-
s = scale_free_graph(3, initial_graph=G)
|
|
92
|
-
assert len(s) == 3
|
|
93
|
-
assert len(s.edges) == 3
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
@pytest.mark.parametrize("ig", (nx.Graph(), nx.DiGraph([(0, 1)])))
|
|
97
|
-
def test_scale_free_graph_initial_graph_kwarg(ig):
|
|
98
|
-
with pytest.raises(nx.NetworkXError):
|
|
99
|
-
scale_free_graph(100, initial_graph=ig)
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
class TestRandomKOutGraph:
|
|
103
|
-
"""Unit tests for the
|
|
104
|
-
:func:`~networkx.generators.directed.random_k_out_graph` function.
|
|
105
|
-
|
|
106
|
-
"""
|
|
107
|
-
|
|
108
|
-
@pytest.fixture(
|
|
109
|
-
params=[
|
|
110
|
-
pytest.param(
|
|
111
|
-
_random_k_out_graph_numpy,
|
|
112
|
-
marks=pytest.mark.skipif(not has_numpy, reason="numpy not installed"),
|
|
113
|
-
),
|
|
114
|
-
_random_k_out_graph_python,
|
|
115
|
-
]
|
|
116
|
-
)
|
|
117
|
-
def f(self, request):
|
|
118
|
-
yield request.param
|
|
119
|
-
|
|
120
|
-
@pytest.fixture(params=[(10, 3, 1), (20, 2, 4), (5, 1, 10)])
|
|
121
|
-
def nkalpha(self, request):
|
|
122
|
-
yield request.param
|
|
123
|
-
|
|
124
|
-
def test_regularity(self, f, nkalpha):
|
|
125
|
-
"""Test that the generated graph is `k`-out-regular."""
|
|
126
|
-
n, k, alpha = nkalpha
|
|
127
|
-
G = f(n, k, alpha, seed=42)
|
|
128
|
-
assert all(d == k for _, d in G.out_degree)
|
|
129
|
-
|
|
130
|
-
def test_no_self_loops(self, f, nkalpha):
|
|
131
|
-
"""Test for forbidding self-loops."""
|
|
132
|
-
n, k, alpha = nkalpha
|
|
133
|
-
G = f(n, k, alpha, self_loops=False, seed=42)
|
|
134
|
-
assert nx.number_of_selfloops(G) == 0
|
|
135
|
-
|
|
136
|
-
def test_random_k_out_graph(self, nkalpha):
|
|
137
|
-
"""Test that the interface function `random_k_out_graph` works correctly."""
|
|
138
|
-
n, k, alpha = nkalpha
|
|
139
|
-
G = random_k_out_graph(n, k, alpha, seed=42)
|
|
140
|
-
assert len(G) == n
|
|
141
|
-
assert all(d == k for _, d in G.out_degree)
|
|
142
|
-
|
|
143
|
-
def test_negative_alpha(self):
|
|
144
|
-
with pytest.raises(ValueError, match="alpha must be positive"):
|
|
145
|
-
random_k_out_graph(10, 3, -1)
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
class TestUniformRandomKOutGraph:
|
|
149
|
-
"""Unit tests for the
|
|
150
|
-
:func:`~networkx.generators.directed.random_uniform_k_out_graph`
|
|
151
|
-
function.
|
|
152
|
-
|
|
153
|
-
"""
|
|
154
|
-
|
|
155
|
-
def test_regularity(self):
|
|
156
|
-
"""Tests that the generated graph is `k`-out-regular."""
|
|
157
|
-
n = 10
|
|
158
|
-
k = 3
|
|
159
|
-
G = random_uniform_k_out_graph(n, k)
|
|
160
|
-
assert all(d == k for v, d in G.out_degree())
|
|
161
|
-
G = random_uniform_k_out_graph(n, k, seed=42)
|
|
162
|
-
assert all(d == k for v, d in G.out_degree())
|
|
163
|
-
|
|
164
|
-
def test_no_self_loops(self):
|
|
165
|
-
"""Tests for forbidding self-loops."""
|
|
166
|
-
n = 10
|
|
167
|
-
k = 3
|
|
168
|
-
G = random_uniform_k_out_graph(n, k, self_loops=False)
|
|
169
|
-
assert nx.number_of_selfloops(G) == 0
|
|
170
|
-
assert all(d == k for v, d in G.out_degree())
|
|
171
|
-
|
|
172
|
-
def test_with_replacement(self):
|
|
173
|
-
n = 10
|
|
174
|
-
k = 3
|
|
175
|
-
G = random_uniform_k_out_graph(n, k, with_replacement=True)
|
|
176
|
-
assert G.is_multigraph()
|
|
177
|
-
assert all(d == k for v, d in G.out_degree())
|
|
178
|
-
n = 10
|
|
179
|
-
k = 9
|
|
180
|
-
G = random_uniform_k_out_graph(n, k, with_replacement=False, self_loops=False)
|
|
181
|
-
assert nx.number_of_selfloops(G) == 0
|
|
182
|
-
assert all(d == k for v, d in G.out_degree())
|
|
183
|
-
|
|
184
|
-
def test_without_replacement(self):
|
|
185
|
-
n = 10
|
|
186
|
-
k = 3
|
|
187
|
-
G = random_uniform_k_out_graph(n, k, with_replacement=False)
|
|
188
|
-
assert not G.is_multigraph()
|
|
189
|
-
assert all(d == k for v, d in G.out_degree())
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
"""Unit tests for the :mod:`networkx.generators.duplication` module."""
|
|
2
|
-
|
|
3
|
-
import pytest
|
|
4
|
-
|
|
5
|
-
import networkx as nx
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class TestDuplicationDivergenceGraph:
|
|
9
|
-
"""Unit tests for the
|
|
10
|
-
:func:`networkx.generators.duplication.duplication_divergence_graph`
|
|
11
|
-
function.
|
|
12
|
-
|
|
13
|
-
"""
|
|
14
|
-
|
|
15
|
-
def test_final_size(self):
|
|
16
|
-
G = nx.duplication_divergence_graph(3, p=1)
|
|
17
|
-
assert len(G) == 3
|
|
18
|
-
G = nx.duplication_divergence_graph(3, p=1, seed=42)
|
|
19
|
-
assert len(G) == 3
|
|
20
|
-
|
|
21
|
-
def test_probability_too_large(self):
|
|
22
|
-
with pytest.raises(nx.NetworkXError):
|
|
23
|
-
nx.duplication_divergence_graph(3, p=2)
|
|
24
|
-
|
|
25
|
-
def test_probability_too_small(self):
|
|
26
|
-
with pytest.raises(nx.NetworkXError):
|
|
27
|
-
nx.duplication_divergence_graph(3, p=-1)
|
|
28
|
-
|
|
29
|
-
def test_non_extreme_probability_value(self):
|
|
30
|
-
G = nx.duplication_divergence_graph(6, p=0.3, seed=42)
|
|
31
|
-
assert len(G) == 6
|
|
32
|
-
assert list(G.degree()) == [(0, 2), (1, 3), (2, 2), (3, 3), (4, 1), (5, 1)]
|
|
33
|
-
|
|
34
|
-
def test_minimum_desired_nodes(self):
|
|
35
|
-
with pytest.raises(
|
|
36
|
-
nx.NetworkXError, match=".*n must be greater than or equal to 2"
|
|
37
|
-
):
|
|
38
|
-
nx.duplication_divergence_graph(1, p=1)
|
|
39
|
-
|
|
40
|
-
def test_create_using(self):
|
|
41
|
-
class DummyGraph(nx.Graph):
|
|
42
|
-
pass
|
|
43
|
-
|
|
44
|
-
class DummyDiGraph(nx.DiGraph):
|
|
45
|
-
pass
|
|
46
|
-
|
|
47
|
-
G = nx.duplication_divergence_graph(6, 0.3, seed=42, create_using=DummyGraph)
|
|
48
|
-
assert isinstance(G, DummyGraph)
|
|
49
|
-
with pytest.raises(nx.NetworkXError, match="create_using must not be directed"):
|
|
50
|
-
nx.duplication_divergence_graph(6, 0.3, seed=42, create_using=DummyDiGraph)
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
class TestPartialDuplicationGraph:
|
|
54
|
-
"""Unit tests for the
|
|
55
|
-
:func:`networkx.generators.duplication.partial_duplication_graph`
|
|
56
|
-
function.
|
|
57
|
-
|
|
58
|
-
"""
|
|
59
|
-
|
|
60
|
-
def test_final_size(self):
|
|
61
|
-
N = 10
|
|
62
|
-
n = 5
|
|
63
|
-
p = 0.5
|
|
64
|
-
q = 0.5
|
|
65
|
-
G = nx.partial_duplication_graph(N, n, p, q)
|
|
66
|
-
assert len(G) == N
|
|
67
|
-
G = nx.partial_duplication_graph(N, n, p, q, seed=42)
|
|
68
|
-
assert len(G) == N
|
|
69
|
-
|
|
70
|
-
def test_initial_clique_size(self):
|
|
71
|
-
N = 10
|
|
72
|
-
n = 10
|
|
73
|
-
p = 0.5
|
|
74
|
-
q = 0.5
|
|
75
|
-
G = nx.partial_duplication_graph(N, n, p, q)
|
|
76
|
-
assert len(G) == n
|
|
77
|
-
|
|
78
|
-
def test_invalid_initial_size(self):
|
|
79
|
-
with pytest.raises(nx.NetworkXError):
|
|
80
|
-
N = 5
|
|
81
|
-
n = 10
|
|
82
|
-
p = 0.5
|
|
83
|
-
q = 0.5
|
|
84
|
-
G = nx.partial_duplication_graph(N, n, p, q)
|
|
85
|
-
|
|
86
|
-
def test_invalid_probabilities(self):
|
|
87
|
-
N = 1
|
|
88
|
-
n = 1
|
|
89
|
-
for p, q in [(0.5, 2), (0.5, -1), (2, 0.5), (-1, 0.5)]:
|
|
90
|
-
args = (N, n, p, q)
|
|
91
|
-
pytest.raises(nx.NetworkXError, nx.partial_duplication_graph, *args)
|
|
92
|
-
|
|
93
|
-
def test_create_using(self):
|
|
94
|
-
class DummyGraph(nx.Graph):
|
|
95
|
-
pass
|
|
96
|
-
|
|
97
|
-
class DummyDiGraph(nx.DiGraph):
|
|
98
|
-
pass
|
|
99
|
-
|
|
100
|
-
G = nx.partial_duplication_graph(10, 5, 0.5, 0.5, create_using=DummyGraph)
|
|
101
|
-
assert isinstance(G, DummyGraph)
|
|
102
|
-
with pytest.raises(nx.NetworkXError, match="create_using must not be directed"):
|
|
103
|
-
nx.partial_duplication_graph(10, 5, 0.5, 0.5, create_using=DummyDiGraph)
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
ego graph
|
|
3
|
-
---------
|
|
4
|
-
"""
|
|
5
|
-
|
|
6
|
-
import networkx as nx
|
|
7
|
-
from networkx.utils import edges_equal, nodes_equal
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class TestGeneratorEgo:
|
|
11
|
-
def test_ego(self):
|
|
12
|
-
G = nx.star_graph(3)
|
|
13
|
-
H = nx.ego_graph(G, 0)
|
|
14
|
-
assert nx.is_isomorphic(G, H)
|
|
15
|
-
G.add_edge(1, 11)
|
|
16
|
-
G.add_edge(2, 22)
|
|
17
|
-
G.add_edge(3, 33)
|
|
18
|
-
H = nx.ego_graph(G, 0)
|
|
19
|
-
assert nx.is_isomorphic(nx.star_graph(3), H)
|
|
20
|
-
G = nx.path_graph(3)
|
|
21
|
-
H = nx.ego_graph(G, 0)
|
|
22
|
-
assert edges_equal(H.edges(), [(0, 1)])
|
|
23
|
-
H = nx.ego_graph(G, 0, undirected=True)
|
|
24
|
-
assert edges_equal(H.edges(), [(0, 1)])
|
|
25
|
-
H = nx.ego_graph(G, 0, center=False)
|
|
26
|
-
assert edges_equal(H.edges(), [])
|
|
27
|
-
|
|
28
|
-
def test_ego_distance(self):
|
|
29
|
-
G = nx.Graph()
|
|
30
|
-
G.add_edge(0, 1, weight=2, distance=1)
|
|
31
|
-
G.add_edge(1, 2, weight=2, distance=2)
|
|
32
|
-
G.add_edge(2, 3, weight=2, distance=1)
|
|
33
|
-
assert nodes_equal(nx.ego_graph(G, 0, radius=3).nodes(), [0, 1, 2, 3])
|
|
34
|
-
eg = nx.ego_graph(G, 0, radius=3, distance="weight")
|
|
35
|
-
assert nodes_equal(eg.nodes(), [0, 1])
|
|
36
|
-
eg = nx.ego_graph(G, 0, radius=3, distance="weight", undirected=True)
|
|
37
|
-
assert nodes_equal(eg.nodes(), [0, 1])
|
|
38
|
-
eg = nx.ego_graph(G, 0, radius=3, distance="distance")
|
|
39
|
-
assert nodes_equal(eg.nodes(), [0, 1, 2])
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
"""Unit tests for the :mod:`networkx.generators.expanders` module."""
|
|
2
|
-
|
|
3
|
-
import pytest
|
|
4
|
-
|
|
5
|
-
import networkx as nx
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
@pytest.mark.parametrize("n", (2, 3, 5, 6, 10))
|
|
9
|
-
def test_margulis_gabber_galil_graph_properties(n):
|
|
10
|
-
g = nx.margulis_gabber_galil_graph(n)
|
|
11
|
-
assert g.number_of_nodes() == n * n
|
|
12
|
-
for node in g:
|
|
13
|
-
assert g.degree(node) == 8
|
|
14
|
-
assert len(node) == 2
|
|
15
|
-
for i in node:
|
|
16
|
-
assert int(i) == i
|
|
17
|
-
assert 0 <= i < n
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
@pytest.mark.parametrize("n", (2, 3, 5, 6, 10))
|
|
21
|
-
def test_margulis_gabber_galil_graph_eigvals(n):
|
|
22
|
-
np = pytest.importorskip("numpy")
|
|
23
|
-
sp = pytest.importorskip("scipy")
|
|
24
|
-
|
|
25
|
-
g = nx.margulis_gabber_galil_graph(n)
|
|
26
|
-
# Eigenvalues are already sorted using the scipy eigvalsh,
|
|
27
|
-
# but the implementation in numpy does not guarantee order.
|
|
28
|
-
w = sorted(sp.linalg.eigvalsh(nx.adjacency_matrix(g).toarray()))
|
|
29
|
-
assert w[-2] < 5 * np.sqrt(2)
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
@pytest.mark.parametrize("p", (3, 5, 7, 11)) # Primes
|
|
33
|
-
def test_chordal_cycle_graph(p):
|
|
34
|
-
"""Test for the :func:`networkx.chordal_cycle_graph` function."""
|
|
35
|
-
G = nx.chordal_cycle_graph(p)
|
|
36
|
-
assert len(G) == p
|
|
37
|
-
# TODO The second largest eigenvalue should be smaller than a constant,
|
|
38
|
-
# independent of the number of nodes in the graph:
|
|
39
|
-
#
|
|
40
|
-
# eigs = sorted(sp.linalg.eigvalsh(nx.adjacency_matrix(G).toarray()))
|
|
41
|
-
# assert_less(eigs[-2], ...)
|
|
42
|
-
#
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
@pytest.mark.parametrize("p", (3, 5, 7, 11, 13)) # Primes
|
|
46
|
-
def test_paley_graph(p):
|
|
47
|
-
"""Test for the :func:`networkx.paley_graph` function."""
|
|
48
|
-
G = nx.paley_graph(p)
|
|
49
|
-
# G has p nodes
|
|
50
|
-
assert len(G) == p
|
|
51
|
-
# G is (p-1)/2-regular
|
|
52
|
-
in_degrees = {G.in_degree(node) for node in G.nodes}
|
|
53
|
-
out_degrees = {G.out_degree(node) for node in G.nodes}
|
|
54
|
-
assert len(in_degrees) == 1 and in_degrees.pop() == (p - 1) // 2
|
|
55
|
-
assert len(out_degrees) == 1 and out_degrees.pop() == (p - 1) // 2
|
|
56
|
-
|
|
57
|
-
# If p = 1 mod 4, -1 is a square mod 4 and therefore the
|
|
58
|
-
# edge in the Paley graph are symmetric.
|
|
59
|
-
if p % 4 == 1:
|
|
60
|
-
for u, v in G.edges:
|
|
61
|
-
assert (v, u) in G.edges
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
@pytest.mark.parametrize("d, n", [(2, 7), (4, 10), (4, 16)])
|
|
65
|
-
def test_maybe_regular_expander_graph(d, n):
|
|
66
|
-
pytest.importorskip("numpy")
|
|
67
|
-
G = nx.maybe_regular_expander_graph(n, d, seed=1729)
|
|
68
|
-
|
|
69
|
-
assert len(G) == n, "Should have n nodes"
|
|
70
|
-
assert len(G.edges) == n * d / 2, "Should have n*d/2 edges"
|
|
71
|
-
assert nx.is_k_regular(G, d), "Should be d-regular"
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
def test_maybe_regular_expander_graph_max_tries():
|
|
75
|
-
pytest.importorskip("numpy")
|
|
76
|
-
d, n = 4, 10
|
|
77
|
-
msg = "Too many iterations in maybe_regular_expander_graph"
|
|
78
|
-
with pytest.raises(nx.NetworkXError, match=msg):
|
|
79
|
-
nx.maybe_regular_expander_graph(n, d, max_tries=100, seed=6818) # See gh-8048
|
|
80
|
-
|
|
81
|
-
nx.maybe_regular_expander_graph(n, d, max_tries=130, seed=6818)
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
def test_maybe_regular_expander_deprecated():
|
|
85
|
-
pytest.importorskip("numpy")
|
|
86
|
-
d, n = 2, 7
|
|
87
|
-
with pytest.deprecated_call():
|
|
88
|
-
G = nx.maybe_regular_expander(n, d, seed=1729)
|
|
89
|
-
|
|
90
|
-
assert len(G) == n, "Should have n nodes"
|
|
91
|
-
assert len(G.edges) == n * d / 2, "Should have n*d/2 edges"
|
|
92
|
-
assert nx.is_k_regular(G, d), "Should be d-regular"
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
@pytest.mark.parametrize("n", (3, 5, 6, 10))
|
|
96
|
-
def test_is_regular_expander(n):
|
|
97
|
-
pytest.importorskip("numpy")
|
|
98
|
-
pytest.importorskip("scipy")
|
|
99
|
-
G = nx.complete_graph(n)
|
|
100
|
-
|
|
101
|
-
assert nx.is_regular_expander(G), "Should be a regular expander"
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
@pytest.mark.parametrize("d, n", [(2, 7), (4, 10), (4, 16), (4, 2000)])
|
|
105
|
-
def test_random_regular_expander(d, n):
|
|
106
|
-
pytest.importorskip("numpy")
|
|
107
|
-
pytest.importorskip("scipy")
|
|
108
|
-
G = nx.random_regular_expander_graph(n, d, seed=1729)
|
|
109
|
-
|
|
110
|
-
assert len(G) == n, "Should have n nodes"
|
|
111
|
-
assert len(G.edges) == n * d / 2, "Should have n*d/2 edges"
|
|
112
|
-
assert nx.is_k_regular(G, d), "Should be d-regular"
|
|
113
|
-
assert nx.is_regular_expander(G), "Should be a regular expander"
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
def test_random_regular_expander_explicit_construction():
|
|
117
|
-
pytest.importorskip("numpy")
|
|
118
|
-
pytest.importorskip("scipy")
|
|
119
|
-
G = nx.random_regular_expander_graph(d=4, n=5, seed=1729)
|
|
120
|
-
|
|
121
|
-
assert len(G) == 5 and len(G.edges) == 10, "Should be a complete graph"
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
@pytest.mark.parametrize("graph_type", (nx.Graph, nx.DiGraph, nx.MultiDiGraph))
|
|
125
|
-
def test_margulis_gabber_galil_graph_badinput(graph_type):
|
|
126
|
-
with pytest.raises(
|
|
127
|
-
nx.NetworkXError, match="`create_using` must be an undirected multigraph"
|
|
128
|
-
):
|
|
129
|
-
nx.margulis_gabber_galil_graph(3, create_using=graph_type)
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
@pytest.mark.parametrize("graph_type", (nx.Graph, nx.DiGraph, nx.MultiDiGraph))
|
|
133
|
-
def test_chordal_cycle_graph_badinput(graph_type):
|
|
134
|
-
with pytest.raises(
|
|
135
|
-
nx.NetworkXError, match="`create_using` must be an undirected multigraph"
|
|
136
|
-
):
|
|
137
|
-
nx.chordal_cycle_graph(3, create_using=graph_type)
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
def test_paley_graph_badinput():
|
|
141
|
-
with pytest.raises(
|
|
142
|
-
nx.NetworkXError, match="`create_using` cannot be a multigraph."
|
|
143
|
-
):
|
|
144
|
-
nx.paley_graph(3, create_using=nx.MultiGraph)
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
def test_maybe_regular_expander_graph_badinput():
|
|
148
|
-
pytest.importorskip("numpy")
|
|
149
|
-
|
|
150
|
-
with pytest.raises(nx.NetworkXError, match="n must be a positive integer"):
|
|
151
|
-
nx.maybe_regular_expander_graph(n=-1, d=2)
|
|
152
|
-
|
|
153
|
-
with pytest.raises(nx.NetworkXError, match="d must be greater than or equal to 2"):
|
|
154
|
-
nx.maybe_regular_expander_graph(n=10, d=0)
|
|
155
|
-
|
|
156
|
-
with pytest.raises(nx.NetworkXError, match="Need n-1>= d to have room"):
|
|
157
|
-
nx.maybe_regular_expander_graph(n=5, d=6)
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
def test_is_regular_expander_badinput():
|
|
161
|
-
pytest.importorskip("numpy")
|
|
162
|
-
pytest.importorskip("scipy")
|
|
163
|
-
|
|
164
|
-
with pytest.raises(nx.NetworkXError, match="epsilon must be non negative"):
|
|
165
|
-
nx.is_regular_expander(nx.Graph(), epsilon=-1)
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
def test_random_regular_expander_badinput():
|
|
169
|
-
pytest.importorskip("numpy")
|
|
170
|
-
pytest.importorskip("scipy")
|
|
171
|
-
|
|
172
|
-
with pytest.raises(nx.NetworkXError, match="n must be a positive integer"):
|
|
173
|
-
nx.random_regular_expander_graph(n=-1, d=2)
|
|
174
|
-
|
|
175
|
-
with pytest.raises(nx.NetworkXError, match="d must be greater than or equal to 2"):
|
|
176
|
-
nx.random_regular_expander_graph(n=10, d=0)
|
|
177
|
-
|
|
178
|
-
with pytest.raises(nx.NetworkXError, match="Need n-1>= d to have room"):
|
|
179
|
-
nx.random_regular_expander_graph(n=5, d=6)
|
|
180
|
-
|
|
181
|
-
with pytest.raises(nx.NetworkXError, match="epsilon must be non negative"):
|
|
182
|
-
nx.random_regular_expander_graph(n=4, d=2, epsilon=-1)
|