okstra 0.114.0 → 0.115.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/lead/okstra-lead-contract.md +1 -1
- package/runtime/python/okstra_ctl/implementation_stage.py +46 -39
- package/runtime/python/okstra_ctl/report_views.py +151 -12
- package/runtime/python/okstra_ctl/run.py +24 -24
- package/runtime/python/okstra_ctl/worktree.py +1 -1
- package/runtime/python/okstra_token_usage/claude.py +58 -19
- package/runtime/python/okstra_token_usage/collect.py +3 -1
- package/runtime/python/okstra_vendor/__init__.py +3 -0
- package/runtime/schemas/final-report-v1.0.schema.json +20 -0
- package/runtime/templates/reports/final-report.template.md +14 -0
- package/runtime/templates/reports/i18n/en.json +23 -12
- package/runtime/templates/reports/i18n/ko.json +23 -12
- package/runtime/templates/reports/report.css +55 -0
- package/runtime/templates/reports/report.js +53 -1
- package/runtime/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,488 +0,0 @@
|
|
|
1
|
-
import math
|
|
2
|
-
import random
|
|
3
|
-
from itertools import combinations
|
|
4
|
-
|
|
5
|
-
import pytest
|
|
6
|
-
|
|
7
|
-
import networkx as nx
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
def l1dist(x, y):
|
|
11
|
-
return sum(abs(a - b) for a, b in zip(x, y))
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class TestRandomGeometricGraph:
|
|
15
|
-
"""Unit tests for :func:`~networkx.random_geometric_graph`"""
|
|
16
|
-
|
|
17
|
-
def test_number_of_nodes(self):
|
|
18
|
-
G = nx.random_geometric_graph(50, 0.25, seed=42)
|
|
19
|
-
assert len(G) == 50
|
|
20
|
-
G = nx.random_geometric_graph(range(50), 0.25, seed=42)
|
|
21
|
-
assert len(G) == 50
|
|
22
|
-
|
|
23
|
-
def test_distances(self):
|
|
24
|
-
"""Tests that pairs of vertices adjacent if and only if they are
|
|
25
|
-
within the prescribed radius.
|
|
26
|
-
"""
|
|
27
|
-
# Use the Euclidean metric, the default according to the
|
|
28
|
-
# documentation.
|
|
29
|
-
G = nx.random_geometric_graph(50, 0.25)
|
|
30
|
-
for u, v in combinations(G, 2):
|
|
31
|
-
# Adjacent vertices must be within the given distance.
|
|
32
|
-
if v in G[u]:
|
|
33
|
-
assert math.dist(G.nodes[u]["pos"], G.nodes[v]["pos"]) <= 0.25
|
|
34
|
-
# Nonadjacent vertices must be at greater distance.
|
|
35
|
-
else:
|
|
36
|
-
assert not math.dist(G.nodes[u]["pos"], G.nodes[v]["pos"]) <= 0.25
|
|
37
|
-
|
|
38
|
-
def test_p(self):
|
|
39
|
-
"""Tests for providing an alternate distance metric to the generator."""
|
|
40
|
-
# Use the L1 metric.
|
|
41
|
-
G = nx.random_geometric_graph(50, 0.25, p=1)
|
|
42
|
-
for u, v in combinations(G, 2):
|
|
43
|
-
# Adjacent vertices must be within the given distance.
|
|
44
|
-
if v in G[u]:
|
|
45
|
-
assert l1dist(G.nodes[u]["pos"], G.nodes[v]["pos"]) <= 0.25
|
|
46
|
-
# Nonadjacent vertices must be at greater distance.
|
|
47
|
-
else:
|
|
48
|
-
assert not l1dist(G.nodes[u]["pos"], G.nodes[v]["pos"]) <= 0.25
|
|
49
|
-
|
|
50
|
-
def test_node_names(self):
|
|
51
|
-
"""Tests using values other than sequential numbers as node IDs."""
|
|
52
|
-
import string
|
|
53
|
-
|
|
54
|
-
nodes = list(string.ascii_lowercase)
|
|
55
|
-
G = nx.random_geometric_graph(nodes, 0.25)
|
|
56
|
-
assert len(G) == len(nodes)
|
|
57
|
-
|
|
58
|
-
for u, v in combinations(G, 2):
|
|
59
|
-
# Adjacent vertices must be within the given distance.
|
|
60
|
-
if v in G[u]:
|
|
61
|
-
assert math.dist(G.nodes[u]["pos"], G.nodes[v]["pos"]) <= 0.25
|
|
62
|
-
# Nonadjacent vertices must be at greater distance.
|
|
63
|
-
else:
|
|
64
|
-
assert not math.dist(G.nodes[u]["pos"], G.nodes[v]["pos"]) <= 0.25
|
|
65
|
-
|
|
66
|
-
def test_pos_name(self):
|
|
67
|
-
G = nx.random_geometric_graph(50, 0.25, seed=42, pos_name="coords")
|
|
68
|
-
assert all(len(d["coords"]) == 2 for n, d in G.nodes.items())
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
class TestSoftRandomGeometricGraph:
|
|
72
|
-
"""Unit tests for :func:`~networkx.soft_random_geometric_graph`"""
|
|
73
|
-
|
|
74
|
-
def test_number_of_nodes(self):
|
|
75
|
-
G = nx.soft_random_geometric_graph(50, 0.25, seed=42)
|
|
76
|
-
assert len(G) == 50
|
|
77
|
-
G = nx.soft_random_geometric_graph(range(50), 0.25, seed=42)
|
|
78
|
-
assert len(G) == 50
|
|
79
|
-
|
|
80
|
-
def test_distances(self):
|
|
81
|
-
"""Tests that pairs of vertices adjacent if and only if they are
|
|
82
|
-
within the prescribed radius.
|
|
83
|
-
"""
|
|
84
|
-
# Use the Euclidean metric, the default according to the
|
|
85
|
-
# documentation.
|
|
86
|
-
G = nx.soft_random_geometric_graph(50, 0.25)
|
|
87
|
-
for u, v in combinations(G, 2):
|
|
88
|
-
# Adjacent vertices must be within the given distance.
|
|
89
|
-
if v in G[u]:
|
|
90
|
-
assert math.dist(G.nodes[u]["pos"], G.nodes[v]["pos"]) <= 0.25
|
|
91
|
-
|
|
92
|
-
def test_p(self):
|
|
93
|
-
"""Tests for providing an alternate distance metric to the generator."""
|
|
94
|
-
|
|
95
|
-
# Use the L1 metric.
|
|
96
|
-
def dist(x, y):
|
|
97
|
-
return sum(abs(a - b) for a, b in zip(x, y))
|
|
98
|
-
|
|
99
|
-
G = nx.soft_random_geometric_graph(50, 0.25, p=1)
|
|
100
|
-
for u, v in combinations(G, 2):
|
|
101
|
-
# Adjacent vertices must be within the given distance.
|
|
102
|
-
if v in G[u]:
|
|
103
|
-
assert dist(G.nodes[u]["pos"], G.nodes[v]["pos"]) <= 0.25
|
|
104
|
-
|
|
105
|
-
def test_node_names(self):
|
|
106
|
-
"""Tests using values other than sequential numbers as node IDs."""
|
|
107
|
-
import string
|
|
108
|
-
|
|
109
|
-
nodes = list(string.ascii_lowercase)
|
|
110
|
-
G = nx.soft_random_geometric_graph(nodes, 0.25)
|
|
111
|
-
assert len(G) == len(nodes)
|
|
112
|
-
|
|
113
|
-
for u, v in combinations(G, 2):
|
|
114
|
-
# Adjacent vertices must be within the given distance.
|
|
115
|
-
if v in G[u]:
|
|
116
|
-
assert math.dist(G.nodes[u]["pos"], G.nodes[v]["pos"]) <= 0.25
|
|
117
|
-
|
|
118
|
-
def test_p_dist_default(self):
|
|
119
|
-
"""Tests default p_dict = 0.5 returns graph with edge count <= RGG with
|
|
120
|
-
same n, radius, dim and positions
|
|
121
|
-
"""
|
|
122
|
-
nodes = 50
|
|
123
|
-
dim = 2
|
|
124
|
-
pos = {v: [random.random() for i in range(dim)] for v in range(nodes)}
|
|
125
|
-
RGG = nx.random_geometric_graph(50, 0.25, pos=pos)
|
|
126
|
-
SRGG = nx.soft_random_geometric_graph(50, 0.25, pos=pos)
|
|
127
|
-
assert len(SRGG.edges()) <= len(RGG.edges())
|
|
128
|
-
|
|
129
|
-
def test_p_dist_zero(self):
|
|
130
|
-
"""Tests if p_dict = 0 returns disconnected graph with 0 edges"""
|
|
131
|
-
|
|
132
|
-
def p_dist(dist):
|
|
133
|
-
return 0
|
|
134
|
-
|
|
135
|
-
G = nx.soft_random_geometric_graph(50, 0.25, p_dist=p_dist)
|
|
136
|
-
assert len(G.edges) == 0
|
|
137
|
-
|
|
138
|
-
def test_pos_name(self):
|
|
139
|
-
G = nx.soft_random_geometric_graph(50, 0.25, seed=42, pos_name="coords")
|
|
140
|
-
assert all(len(d["coords"]) == 2 for n, d in G.nodes.items())
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
def join(G, u, v, theta, alpha, metric):
|
|
144
|
-
"""Returns ``True`` if and only if the nodes whose attributes are
|
|
145
|
-
``du`` and ``dv`` should be joined, according to the threshold
|
|
146
|
-
condition for geographical threshold graphs.
|
|
147
|
-
|
|
148
|
-
``G`` is an undirected NetworkX graph, and ``u`` and ``v`` are nodes
|
|
149
|
-
in that graph. The nodes must have node attributes ``'pos'`` and
|
|
150
|
-
``'weight'``.
|
|
151
|
-
|
|
152
|
-
``metric`` is a distance metric.
|
|
153
|
-
"""
|
|
154
|
-
du, dv = G.nodes[u], G.nodes[v]
|
|
155
|
-
u_pos, v_pos = du["pos"], dv["pos"]
|
|
156
|
-
u_weight, v_weight = du["weight"], dv["weight"]
|
|
157
|
-
return (u_weight + v_weight) * metric(u_pos, v_pos) ** alpha >= theta
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
class TestGeographicalThresholdGraph:
|
|
161
|
-
"""Unit tests for :func:`~networkx.geographical_threshold_graph`"""
|
|
162
|
-
|
|
163
|
-
def test_number_of_nodes(self):
|
|
164
|
-
G = nx.geographical_threshold_graph(50, 100, seed=42)
|
|
165
|
-
assert len(G) == 50
|
|
166
|
-
G = nx.geographical_threshold_graph(range(50), 100, seed=42)
|
|
167
|
-
assert len(G) == 50
|
|
168
|
-
|
|
169
|
-
def test_distances(self):
|
|
170
|
-
"""Tests that pairs of vertices adjacent if and only if their
|
|
171
|
-
distances meet the given threshold.
|
|
172
|
-
"""
|
|
173
|
-
# Use the Euclidean metric and alpha = -2
|
|
174
|
-
# the default according to the documentation.
|
|
175
|
-
G = nx.geographical_threshold_graph(50, 10)
|
|
176
|
-
for u, v in combinations(G, 2):
|
|
177
|
-
# Adjacent vertices must exceed the threshold.
|
|
178
|
-
if v in G[u]:
|
|
179
|
-
assert join(G, u, v, 10, -2, math.dist)
|
|
180
|
-
# Nonadjacent vertices must not exceed the threshold.
|
|
181
|
-
else:
|
|
182
|
-
assert not join(G, u, v, 10, -2, math.dist)
|
|
183
|
-
|
|
184
|
-
def test_metric(self):
|
|
185
|
-
"""Tests for providing an alternate distance metric to the generator."""
|
|
186
|
-
# Use the L1 metric.
|
|
187
|
-
G = nx.geographical_threshold_graph(50, 10, metric=l1dist)
|
|
188
|
-
for u, v in combinations(G, 2):
|
|
189
|
-
# Adjacent vertices must exceed the threshold.
|
|
190
|
-
if v in G[u]:
|
|
191
|
-
assert join(G, u, v, 10, -2, l1dist)
|
|
192
|
-
# Nonadjacent vertices must not exceed the threshold.
|
|
193
|
-
else:
|
|
194
|
-
assert not join(G, u, v, 10, -2, l1dist)
|
|
195
|
-
|
|
196
|
-
def test_p_dist_zero(self):
|
|
197
|
-
"""Tests if p_dict = 0 returns disconnected graph with 0 edges"""
|
|
198
|
-
|
|
199
|
-
def p_dist(dist):
|
|
200
|
-
return 0
|
|
201
|
-
|
|
202
|
-
G = nx.geographical_threshold_graph(50, 1, p_dist=p_dist)
|
|
203
|
-
assert len(G.edges) == 0
|
|
204
|
-
|
|
205
|
-
def test_pos_weight_name(self):
|
|
206
|
-
gtg = nx.geographical_threshold_graph
|
|
207
|
-
G = gtg(50, 100, seed=42, pos_name="coords", weight_name="wt")
|
|
208
|
-
assert all(len(d["coords"]) == 2 for n, d in G.nodes.items())
|
|
209
|
-
assert all(d["wt"] > 0 for n, d in G.nodes.items())
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
class TestWaxmanGraph:
|
|
213
|
-
"""Unit tests for the :func:`~networkx.waxman_graph` function."""
|
|
214
|
-
|
|
215
|
-
def test_number_of_nodes_1(self):
|
|
216
|
-
G = nx.waxman_graph(50, 0.5, 0.1, seed=42)
|
|
217
|
-
assert len(G) == 50
|
|
218
|
-
G = nx.waxman_graph(range(50), 0.5, 0.1, seed=42)
|
|
219
|
-
assert len(G) == 50
|
|
220
|
-
|
|
221
|
-
def test_number_of_nodes_2(self):
|
|
222
|
-
G = nx.waxman_graph(50, 0.5, 0.1, L=1)
|
|
223
|
-
assert len(G) == 50
|
|
224
|
-
G = nx.waxman_graph(range(50), 0.5, 0.1, L=1)
|
|
225
|
-
assert len(G) == 50
|
|
226
|
-
|
|
227
|
-
def test_metric(self):
|
|
228
|
-
"""Tests for providing an alternate distance metric to the generator."""
|
|
229
|
-
# Use the L1 metric.
|
|
230
|
-
G = nx.waxman_graph(50, 0.5, 0.1, metric=l1dist)
|
|
231
|
-
assert len(G) == 50
|
|
232
|
-
|
|
233
|
-
def test_pos_name(self):
|
|
234
|
-
G = nx.waxman_graph(50, 0.5, 0.1, seed=42, pos_name="coords")
|
|
235
|
-
assert all(len(d["coords"]) == 2 for n, d in G.nodes.items())
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
class TestNavigableSmallWorldGraph:
|
|
239
|
-
def test_navigable_small_world(self):
|
|
240
|
-
G = nx.navigable_small_world_graph(5, p=1, q=0, seed=42)
|
|
241
|
-
gg = nx.grid_2d_graph(5, 5).to_directed()
|
|
242
|
-
assert nx.is_isomorphic(G, gg)
|
|
243
|
-
|
|
244
|
-
G = nx.navigable_small_world_graph(5, p=1, q=0, dim=3)
|
|
245
|
-
gg = nx.grid_graph([5, 5, 5]).to_directed()
|
|
246
|
-
assert nx.is_isomorphic(G, gg)
|
|
247
|
-
|
|
248
|
-
G = nx.navigable_small_world_graph(5, p=1, q=0, dim=1)
|
|
249
|
-
gg = nx.grid_graph([5]).to_directed()
|
|
250
|
-
assert nx.is_isomorphic(G, gg)
|
|
251
|
-
|
|
252
|
-
def test_invalid_diameter_value(self):
|
|
253
|
-
with pytest.raises(nx.NetworkXException, match=".*p must be >= 1"):
|
|
254
|
-
nx.navigable_small_world_graph(5, p=0, q=0, dim=1)
|
|
255
|
-
|
|
256
|
-
def test_invalid_long_range_connections_value(self):
|
|
257
|
-
with pytest.raises(nx.NetworkXException, match=".*q must be >= 0"):
|
|
258
|
-
nx.navigable_small_world_graph(5, p=1, q=-1, dim=1)
|
|
259
|
-
|
|
260
|
-
def test_invalid_exponent_for_decaying_probability_value(self):
|
|
261
|
-
with pytest.raises(nx.NetworkXException, match=".*r must be >= 0"):
|
|
262
|
-
nx.navigable_small_world_graph(5, p=1, q=0, r=-1, dim=1)
|
|
263
|
-
|
|
264
|
-
def test_r_between_0_and_1(self):
|
|
265
|
-
"""Smoke test for radius in range [0, 1]"""
|
|
266
|
-
# q=0 means no long-range connections
|
|
267
|
-
G = nx.navigable_small_world_graph(3, p=1, q=0, r=0.5, dim=2, seed=42)
|
|
268
|
-
expected = nx.grid_2d_graph(3, 3, create_using=nx.DiGraph)
|
|
269
|
-
assert nx.utils.graphs_equal(G, expected)
|
|
270
|
-
|
|
271
|
-
@pytest.mark.parametrize("seed", range(2478, 2578, 10))
|
|
272
|
-
def test_r_general_scaling(self, seed):
|
|
273
|
-
"""The probability of adding a long-range edge scales with `1 / dist**r`,
|
|
274
|
-
so a navigable_small_world graph created with r < 1 should generally
|
|
275
|
-
result in more edges than a navigable_small_world graph with r >= 1
|
|
276
|
-
(for 0 < q << n).
|
|
277
|
-
|
|
278
|
-
N.B. this is probabilistic, so this test may not hold for all seeds."""
|
|
279
|
-
G1 = nx.navigable_small_world_graph(7, q=3, r=0.5, seed=seed)
|
|
280
|
-
G2 = nx.navigable_small_world_graph(7, q=3, r=1, seed=seed)
|
|
281
|
-
G3 = nx.navigable_small_world_graph(7, q=3, r=2, seed=seed)
|
|
282
|
-
assert G1.number_of_edges() > G2.number_of_edges()
|
|
283
|
-
assert G2.number_of_edges() > G3.number_of_edges()
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
class TestThresholdedRandomGeometricGraph:
|
|
287
|
-
"""Unit tests for :func:`~networkx.thresholded_random_geometric_graph`"""
|
|
288
|
-
|
|
289
|
-
def test_number_of_nodes(self):
|
|
290
|
-
G = nx.thresholded_random_geometric_graph(50, 0.2, 0.1, seed=42)
|
|
291
|
-
assert len(G) == 50
|
|
292
|
-
G = nx.thresholded_random_geometric_graph(range(50), 0.2, 0.1, seed=42)
|
|
293
|
-
assert len(G) == 50
|
|
294
|
-
|
|
295
|
-
def test_distances(self):
|
|
296
|
-
"""Tests that pairs of vertices adjacent if and only if they are
|
|
297
|
-
within the prescribed radius.
|
|
298
|
-
"""
|
|
299
|
-
# Use the Euclidean metric, the default according to the
|
|
300
|
-
# documentation.
|
|
301
|
-
G = nx.thresholded_random_geometric_graph(50, 0.25, 0.1, seed=42)
|
|
302
|
-
for u, v in combinations(G, 2):
|
|
303
|
-
# Adjacent vertices must be within the given distance.
|
|
304
|
-
if v in G[u]:
|
|
305
|
-
assert math.dist(G.nodes[u]["pos"], G.nodes[v]["pos"]) <= 0.25
|
|
306
|
-
|
|
307
|
-
def test_p(self):
|
|
308
|
-
"""Tests for providing an alternate distance metric to the generator."""
|
|
309
|
-
|
|
310
|
-
# Use the L1 metric.
|
|
311
|
-
def dist(x, y):
|
|
312
|
-
return sum(abs(a - b) for a, b in zip(x, y))
|
|
313
|
-
|
|
314
|
-
G = nx.thresholded_random_geometric_graph(50, 0.25, 0.1, p=1, seed=42)
|
|
315
|
-
for u, v in combinations(G, 2):
|
|
316
|
-
# Adjacent vertices must be within the given distance.
|
|
317
|
-
if v in G[u]:
|
|
318
|
-
assert dist(G.nodes[u]["pos"], G.nodes[v]["pos"]) <= 0.25
|
|
319
|
-
|
|
320
|
-
def test_node_names(self):
|
|
321
|
-
"""Tests using values other than sequential numbers as node IDs."""
|
|
322
|
-
import string
|
|
323
|
-
|
|
324
|
-
nodes = list(string.ascii_lowercase)
|
|
325
|
-
G = nx.thresholded_random_geometric_graph(nodes, 0.25, 0.1, seed=42)
|
|
326
|
-
assert len(G) == len(nodes)
|
|
327
|
-
|
|
328
|
-
for u, v in combinations(G, 2):
|
|
329
|
-
# Adjacent vertices must be within the given distance.
|
|
330
|
-
if v in G[u]:
|
|
331
|
-
assert math.dist(G.nodes[u]["pos"], G.nodes[v]["pos"]) <= 0.25
|
|
332
|
-
|
|
333
|
-
def test_theta(self):
|
|
334
|
-
"""Tests that pairs of vertices adjacent if and only if their sum
|
|
335
|
-
weights exceeds the threshold parameter theta.
|
|
336
|
-
"""
|
|
337
|
-
G = nx.thresholded_random_geometric_graph(50, 0.25, 0.1, seed=42)
|
|
338
|
-
|
|
339
|
-
for u, v in combinations(G, 2):
|
|
340
|
-
# Adjacent vertices must be within the given distance.
|
|
341
|
-
if v in G[u]:
|
|
342
|
-
assert (G.nodes[u]["weight"] + G.nodes[v]["weight"]) >= 0.1
|
|
343
|
-
|
|
344
|
-
def test_pos_name(self):
|
|
345
|
-
trgg = nx.thresholded_random_geometric_graph
|
|
346
|
-
G = trgg(50, 0.25, 0.1, seed=42, pos_name="p", weight_name="wt")
|
|
347
|
-
assert all(len(d["p"]) == 2 for n, d in G.nodes.items())
|
|
348
|
-
assert all(d["wt"] > 0 for n, d in G.nodes.items())
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
def test_geometric_edges_pos_attribute():
|
|
352
|
-
G = nx.Graph()
|
|
353
|
-
G.add_nodes_from(
|
|
354
|
-
[
|
|
355
|
-
(0, {"position": (0, 0)}),
|
|
356
|
-
(1, {"position": (0, 1)}),
|
|
357
|
-
(2, {"position": (1, 0)}),
|
|
358
|
-
]
|
|
359
|
-
)
|
|
360
|
-
expected_edges = [(0, 1), (0, 2)]
|
|
361
|
-
assert expected_edges == nx.geometric_edges(G, radius=1, pos_name="position")
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
def test_geometric_edges_raises_no_pos():
|
|
365
|
-
G = nx.path_graph(3)
|
|
366
|
-
msg = "all nodes. must have a '"
|
|
367
|
-
with pytest.raises(nx.NetworkXError, match=msg):
|
|
368
|
-
nx.geometric_edges(G, radius=1)
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
def test_number_of_nodes_S1():
|
|
372
|
-
G = nx.geometric_soft_configuration_graph(
|
|
373
|
-
beta=1.5, n=100, gamma=2.7, mean_degree=10, seed=42
|
|
374
|
-
)
|
|
375
|
-
assert len(G) == 100
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
def test_set_attributes_S1():
|
|
379
|
-
G = nx.geometric_soft_configuration_graph(
|
|
380
|
-
beta=1.5, n=100, gamma=2.7, mean_degree=10, seed=42
|
|
381
|
-
)
|
|
382
|
-
kappas = nx.get_node_attributes(G, "kappa")
|
|
383
|
-
assert len(kappas) == 100
|
|
384
|
-
thetas = nx.get_node_attributes(G, "theta")
|
|
385
|
-
assert len(thetas) == 100
|
|
386
|
-
radii = nx.get_node_attributes(G, "radius")
|
|
387
|
-
assert len(radii) == 100
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
def test_mean_kappas_mean_degree_S1():
|
|
391
|
-
G = nx.geometric_soft_configuration_graph(
|
|
392
|
-
beta=2.5, n=50, gamma=2.7, mean_degree=10, seed=8023
|
|
393
|
-
)
|
|
394
|
-
|
|
395
|
-
kappas = nx.get_node_attributes(G, "kappa")
|
|
396
|
-
mean_kappas = sum(kappas.values()) / len(kappas)
|
|
397
|
-
assert math.fabs(mean_kappas - 10) < 0.5
|
|
398
|
-
|
|
399
|
-
degrees = dict(G.degree())
|
|
400
|
-
mean_degree = sum(degrees.values()) / len(degrees)
|
|
401
|
-
assert math.fabs(mean_degree - 10) < 1
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
def test_dict_kappas_S1():
|
|
405
|
-
kappas = {i: 10 for i in range(1000)}
|
|
406
|
-
G = nx.geometric_soft_configuration_graph(beta=1, kappas=kappas)
|
|
407
|
-
assert len(G) == 1000
|
|
408
|
-
kappas = nx.get_node_attributes(G, "kappa")
|
|
409
|
-
assert all(kappa == 10 for kappa in kappas.values())
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
def test_beta_clustering_S1():
|
|
413
|
-
G1 = nx.geometric_soft_configuration_graph(
|
|
414
|
-
beta=1.5, n=100, gamma=3.5, mean_degree=10, seed=42
|
|
415
|
-
)
|
|
416
|
-
G2 = nx.geometric_soft_configuration_graph(
|
|
417
|
-
beta=3.0, n=100, gamma=3.5, mean_degree=10, seed=42
|
|
418
|
-
)
|
|
419
|
-
assert nx.average_clustering(G1) < nx.average_clustering(G2)
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
def test_wrong_parameters_S1():
|
|
423
|
-
with pytest.raises(
|
|
424
|
-
nx.NetworkXError,
|
|
425
|
-
match="Please provide either kappas, or all 3 of: n, gamma and mean_degree.",
|
|
426
|
-
):
|
|
427
|
-
G = nx.geometric_soft_configuration_graph(
|
|
428
|
-
beta=1.5, gamma=3.5, mean_degree=10, seed=42
|
|
429
|
-
)
|
|
430
|
-
|
|
431
|
-
with pytest.raises(
|
|
432
|
-
nx.NetworkXError,
|
|
433
|
-
match="When kappas is input, n, gamma and mean_degree must not be.",
|
|
434
|
-
):
|
|
435
|
-
kappas = {i: 10 for i in range(1000)}
|
|
436
|
-
G = nx.geometric_soft_configuration_graph(
|
|
437
|
-
beta=1.5, kappas=kappas, gamma=2.3, seed=42
|
|
438
|
-
)
|
|
439
|
-
|
|
440
|
-
with pytest.raises(
|
|
441
|
-
nx.NetworkXError,
|
|
442
|
-
match="Please provide either kappas, or all 3 of: n, gamma and mean_degree.",
|
|
443
|
-
):
|
|
444
|
-
G = nx.geometric_soft_configuration_graph(beta=1.5, seed=42)
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
def test_negative_beta_S1():
|
|
448
|
-
with pytest.raises(
|
|
449
|
-
nx.NetworkXError, match="The parameter beta cannot be smaller or equal to 0."
|
|
450
|
-
):
|
|
451
|
-
G = nx.geometric_soft_configuration_graph(
|
|
452
|
-
beta=-1, n=100, gamma=2.3, mean_degree=10, seed=42
|
|
453
|
-
)
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
def test_non_zero_clustering_beta_lower_one_S1():
|
|
457
|
-
G = nx.geometric_soft_configuration_graph(
|
|
458
|
-
beta=0.5, n=100, gamma=3.5, mean_degree=10, seed=42
|
|
459
|
-
)
|
|
460
|
-
assert nx.average_clustering(G) > 0
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
def test_mean_degree_influence_on_connectivity_S1():
|
|
464
|
-
low_mean_degree = 2
|
|
465
|
-
high_mean_degree = 20
|
|
466
|
-
G_low = nx.geometric_soft_configuration_graph(
|
|
467
|
-
beta=1.2, n=100, gamma=2.7, mean_degree=low_mean_degree, seed=42
|
|
468
|
-
)
|
|
469
|
-
G_high = nx.geometric_soft_configuration_graph(
|
|
470
|
-
beta=1.2, n=100, gamma=2.7, mean_degree=high_mean_degree, seed=42
|
|
471
|
-
)
|
|
472
|
-
assert nx.number_connected_components(G_low) > nx.number_connected_components(
|
|
473
|
-
G_high
|
|
474
|
-
)
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
def test_compare_mean_kappas_different_gammas_S1():
|
|
478
|
-
G1 = nx.geometric_soft_configuration_graph(
|
|
479
|
-
beta=1.5, n=20, gamma=2.7, mean_degree=5, seed=42
|
|
480
|
-
)
|
|
481
|
-
G2 = nx.geometric_soft_configuration_graph(
|
|
482
|
-
beta=1.5, n=20, gamma=3.5, mean_degree=5, seed=42
|
|
483
|
-
)
|
|
484
|
-
kappas1 = nx.get_node_attributes(G1, "kappa")
|
|
485
|
-
mean_kappas1 = sum(kappas1.values()) / len(kappas1)
|
|
486
|
-
kappas2 = nx.get_node_attributes(G2, "kappa")
|
|
487
|
-
mean_kappas2 = sum(kappas2.values()) / len(kappas2)
|
|
488
|
-
assert math.fabs(mean_kappas1 - mean_kappas2) < 1
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
"""Unit tests for the :mod:`networkx.generators.harary_graph` module."""
|
|
2
|
-
|
|
3
|
-
import pytest
|
|
4
|
-
|
|
5
|
-
import networkx as nx
|
|
6
|
-
from networkx.algorithms.isomorphism.isomorph import is_isomorphic
|
|
7
|
-
from networkx.generators.harary_graph import hkn_harary_graph, hnm_harary_graph
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class TestHararyGraph:
|
|
11
|
-
"""
|
|
12
|
-
Suppose n nodes, m >= n-1 edges, d = 2m // n, r = 2m % n
|
|
13
|
-
"""
|
|
14
|
-
|
|
15
|
-
def test_hnm_harary_graph(self):
|
|
16
|
-
# When d is even and r = 0, the hnm_harary_graph(n,m) is
|
|
17
|
-
# the circulant_graph(n, list(range(1,d/2+1)))
|
|
18
|
-
for n, m in [(5, 5), (6, 12), (7, 14)]:
|
|
19
|
-
G1 = hnm_harary_graph(n, m)
|
|
20
|
-
d = 2 * m // n
|
|
21
|
-
G2 = nx.circulant_graph(n, list(range(1, d // 2 + 1)))
|
|
22
|
-
assert is_isomorphic(G1, G2)
|
|
23
|
-
|
|
24
|
-
# When d is even and r > 0, the hnm_harary_graph(n,m) is
|
|
25
|
-
# the circulant_graph(n, list(range(1,d/2+1)))
|
|
26
|
-
# with r edges added arbitrarily
|
|
27
|
-
for n, m in [(5, 7), (6, 13), (7, 16)]:
|
|
28
|
-
G1 = hnm_harary_graph(n, m)
|
|
29
|
-
d = 2 * m // n
|
|
30
|
-
G2 = nx.circulant_graph(n, list(range(1, d // 2 + 1)))
|
|
31
|
-
assert set(G2.edges) < set(G1.edges)
|
|
32
|
-
assert G1.number_of_edges() == m
|
|
33
|
-
|
|
34
|
-
# When d is odd and n is even and r = 0, the hnm_harary_graph(n,m)
|
|
35
|
-
# is the circulant_graph(n, list(range(1,(d+1)/2) plus [n//2])
|
|
36
|
-
for n, m in [(6, 9), (8, 12), (10, 15)]:
|
|
37
|
-
G1 = hnm_harary_graph(n, m)
|
|
38
|
-
d = 2 * m // n
|
|
39
|
-
L = list(range(1, (d + 1) // 2))
|
|
40
|
-
L.append(n // 2)
|
|
41
|
-
G2 = nx.circulant_graph(n, L)
|
|
42
|
-
assert is_isomorphic(G1, G2)
|
|
43
|
-
|
|
44
|
-
# When d is odd and n is even and r > 0, the hnm_harary_graph(n,m)
|
|
45
|
-
# is the circulant_graph(n, list(range(1,(d+1)/2) plus [n//2])
|
|
46
|
-
# with r edges added arbitrarily
|
|
47
|
-
for n, m in [(6, 10), (8, 13), (10, 17)]:
|
|
48
|
-
G1 = hnm_harary_graph(n, m)
|
|
49
|
-
d = 2 * m // n
|
|
50
|
-
L = list(range(1, (d + 1) // 2))
|
|
51
|
-
L.append(n // 2)
|
|
52
|
-
G2 = nx.circulant_graph(n, L)
|
|
53
|
-
assert set(G2.edges) < set(G1.edges)
|
|
54
|
-
assert G1.number_of_edges() == m
|
|
55
|
-
|
|
56
|
-
# When d is odd and n is odd, the hnm_harary_graph(n,m) is
|
|
57
|
-
# the circulant_graph(n, list(range(1,(d+1)/2))
|
|
58
|
-
# with m - n*(d-1)/2 edges added arbitrarily
|
|
59
|
-
for n, m in [(5, 4), (7, 12), (9, 14)]:
|
|
60
|
-
G1 = hnm_harary_graph(n, m)
|
|
61
|
-
d = 2 * m // n
|
|
62
|
-
L = list(range(1, (d + 1) // 2))
|
|
63
|
-
G2 = nx.circulant_graph(n, L)
|
|
64
|
-
assert set(G2.edges) < set(G1.edges)
|
|
65
|
-
assert G1.number_of_edges() == m
|
|
66
|
-
|
|
67
|
-
# Raise NetworkXError if n<1
|
|
68
|
-
n = 0
|
|
69
|
-
m = 0
|
|
70
|
-
pytest.raises(nx.NetworkXError, hnm_harary_graph, n, m)
|
|
71
|
-
|
|
72
|
-
# Raise NetworkXError if m < n-1
|
|
73
|
-
n = 6
|
|
74
|
-
m = 4
|
|
75
|
-
pytest.raises(nx.NetworkXError, hnm_harary_graph, n, m)
|
|
76
|
-
|
|
77
|
-
# Raise NetworkXError if m > n(n-1)/2
|
|
78
|
-
n = 6
|
|
79
|
-
m = 16
|
|
80
|
-
pytest.raises(nx.NetworkXError, hnm_harary_graph, n, m)
|
|
81
|
-
|
|
82
|
-
"""
|
|
83
|
-
Suppose connectivity k, number of nodes n
|
|
84
|
-
"""
|
|
85
|
-
|
|
86
|
-
def test_hkn_harary_graph(self):
|
|
87
|
-
# When k == 1, the hkn_harary_graph(k,n) is
|
|
88
|
-
# the path_graph(n)
|
|
89
|
-
for k, n in [(1, 6), (1, 7)]:
|
|
90
|
-
G1 = hkn_harary_graph(k, n)
|
|
91
|
-
G2 = nx.path_graph(n)
|
|
92
|
-
assert is_isomorphic(G1, G2)
|
|
93
|
-
|
|
94
|
-
# When k is even, the hkn_harary_graph(k,n) is
|
|
95
|
-
# the circulant_graph(n, list(range(1,k/2+1)))
|
|
96
|
-
for k, n in [(2, 6), (2, 7), (4, 6), (4, 7)]:
|
|
97
|
-
G1 = hkn_harary_graph(k, n)
|
|
98
|
-
G2 = nx.circulant_graph(n, list(range(1, k // 2 + 1)))
|
|
99
|
-
assert is_isomorphic(G1, G2)
|
|
100
|
-
|
|
101
|
-
# When k is odd and n is even, the hkn_harary_graph(k,n) is
|
|
102
|
-
# the circulant_graph(n, list(range(1,(k+1)/2)) plus [n/2])
|
|
103
|
-
for k, n in [(3, 6), (5, 8), (7, 10)]:
|
|
104
|
-
G1 = hkn_harary_graph(k, n)
|
|
105
|
-
L = list(range(1, (k + 1) // 2))
|
|
106
|
-
L.append(n // 2)
|
|
107
|
-
G2 = nx.circulant_graph(n, L)
|
|
108
|
-
assert is_isomorphic(G1, G2)
|
|
109
|
-
|
|
110
|
-
# When k is odd and n is odd, the hkn_harary_graph(k,n) is
|
|
111
|
-
# the circulant_graph(n, list(range(1,(k+1)/2))) with
|
|
112
|
-
# n//2+1 edges added between node i and node i+n//2+1
|
|
113
|
-
for k, n in [(3, 5), (5, 9), (7, 11)]:
|
|
114
|
-
G1 = hkn_harary_graph(k, n)
|
|
115
|
-
G2 = nx.circulant_graph(n, list(range(1, (k + 1) // 2)))
|
|
116
|
-
eSet1 = set(G1.edges)
|
|
117
|
-
eSet2 = set(G2.edges)
|
|
118
|
-
eSet3 = set()
|
|
119
|
-
half = n // 2
|
|
120
|
-
for i in range(half + 1):
|
|
121
|
-
# add half+1 edges between i and i+half
|
|
122
|
-
eSet3.add((i, (i + half) % n))
|
|
123
|
-
assert eSet1 == eSet2 | eSet3
|
|
124
|
-
|
|
125
|
-
# Raise NetworkXError if k<1
|
|
126
|
-
k = 0
|
|
127
|
-
n = 0
|
|
128
|
-
pytest.raises(nx.NetworkXError, hkn_harary_graph, k, n)
|
|
129
|
-
|
|
130
|
-
# Raise NetworkXError if n<k+1
|
|
131
|
-
k = 6
|
|
132
|
-
n = 6
|
|
133
|
-
pytest.raises(nx.NetworkXError, hkn_harary_graph, k, n)
|