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,431 +0,0 @@
|
|
|
1
|
-
"""Unit testing for time dependent algorithms."""
|
|
2
|
-
|
|
3
|
-
from datetime import datetime, timedelta
|
|
4
|
-
|
|
5
|
-
import pytest
|
|
6
|
-
|
|
7
|
-
import networkx as nx
|
|
8
|
-
|
|
9
|
-
_delta = timedelta(days=5 * 365)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class TestCdIndex:
|
|
13
|
-
"""Unit testing for the cd index function."""
|
|
14
|
-
|
|
15
|
-
def test_common_graph(self):
|
|
16
|
-
G = nx.DiGraph()
|
|
17
|
-
G.add_nodes_from([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
|
|
18
|
-
G.add_edge(4, 2)
|
|
19
|
-
G.add_edge(4, 0)
|
|
20
|
-
G.add_edge(4, 1)
|
|
21
|
-
G.add_edge(4, 3)
|
|
22
|
-
G.add_edge(5, 2)
|
|
23
|
-
G.add_edge(6, 2)
|
|
24
|
-
G.add_edge(6, 4)
|
|
25
|
-
G.add_edge(7, 4)
|
|
26
|
-
G.add_edge(8, 4)
|
|
27
|
-
G.add_edge(9, 4)
|
|
28
|
-
G.add_edge(9, 1)
|
|
29
|
-
G.add_edge(9, 3)
|
|
30
|
-
G.add_edge(10, 4)
|
|
31
|
-
|
|
32
|
-
node_attrs = {
|
|
33
|
-
0: {"time": datetime(1992, 1, 1)},
|
|
34
|
-
1: {"time": datetime(1992, 1, 1)},
|
|
35
|
-
2: {"time": datetime(1993, 1, 1)},
|
|
36
|
-
3: {"time": datetime(1993, 1, 1)},
|
|
37
|
-
4: {"time": datetime(1995, 1, 1)},
|
|
38
|
-
5: {"time": datetime(1997, 1, 1)},
|
|
39
|
-
6: {"time": datetime(1998, 1, 1)},
|
|
40
|
-
7: {"time": datetime(1999, 1, 1)},
|
|
41
|
-
8: {"time": datetime(1999, 1, 1)},
|
|
42
|
-
9: {"time": datetime(1998, 1, 1)},
|
|
43
|
-
10: {"time": datetime(1997, 4, 1)},
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
nx.set_node_attributes(G, node_attrs)
|
|
47
|
-
|
|
48
|
-
assert nx.cd_index(G, 4, time_delta=_delta) == 0.17
|
|
49
|
-
|
|
50
|
-
def test_common_graph_with_given_attributes(self):
|
|
51
|
-
G = nx.DiGraph()
|
|
52
|
-
G.add_nodes_from([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
|
|
53
|
-
G.add_edge(4, 2)
|
|
54
|
-
G.add_edge(4, 0)
|
|
55
|
-
G.add_edge(4, 1)
|
|
56
|
-
G.add_edge(4, 3)
|
|
57
|
-
G.add_edge(5, 2)
|
|
58
|
-
G.add_edge(6, 2)
|
|
59
|
-
G.add_edge(6, 4)
|
|
60
|
-
G.add_edge(7, 4)
|
|
61
|
-
G.add_edge(8, 4)
|
|
62
|
-
G.add_edge(9, 4)
|
|
63
|
-
G.add_edge(9, 1)
|
|
64
|
-
G.add_edge(9, 3)
|
|
65
|
-
G.add_edge(10, 4)
|
|
66
|
-
|
|
67
|
-
node_attrs = {
|
|
68
|
-
0: {"date": datetime(1992, 1, 1)},
|
|
69
|
-
1: {"date": datetime(1992, 1, 1)},
|
|
70
|
-
2: {"date": datetime(1993, 1, 1)},
|
|
71
|
-
3: {"date": datetime(1993, 1, 1)},
|
|
72
|
-
4: {"date": datetime(1995, 1, 1)},
|
|
73
|
-
5: {"date": datetime(1997, 1, 1)},
|
|
74
|
-
6: {"date": datetime(1998, 1, 1)},
|
|
75
|
-
7: {"date": datetime(1999, 1, 1)},
|
|
76
|
-
8: {"date": datetime(1999, 1, 1)},
|
|
77
|
-
9: {"date": datetime(1998, 1, 1)},
|
|
78
|
-
10: {"date": datetime(1997, 4, 1)},
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
nx.set_node_attributes(G, node_attrs)
|
|
82
|
-
|
|
83
|
-
assert nx.cd_index(G, 4, time_delta=_delta, time="date") == 0.17
|
|
84
|
-
|
|
85
|
-
def test_common_graph_with_int_attributes(self):
|
|
86
|
-
G = nx.DiGraph()
|
|
87
|
-
G.add_nodes_from([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
|
|
88
|
-
G.add_edge(4, 2)
|
|
89
|
-
G.add_edge(4, 0)
|
|
90
|
-
G.add_edge(4, 1)
|
|
91
|
-
G.add_edge(4, 3)
|
|
92
|
-
G.add_edge(5, 2)
|
|
93
|
-
G.add_edge(6, 2)
|
|
94
|
-
G.add_edge(6, 4)
|
|
95
|
-
G.add_edge(7, 4)
|
|
96
|
-
G.add_edge(8, 4)
|
|
97
|
-
G.add_edge(9, 4)
|
|
98
|
-
G.add_edge(9, 1)
|
|
99
|
-
G.add_edge(9, 3)
|
|
100
|
-
G.add_edge(10, 4)
|
|
101
|
-
|
|
102
|
-
node_attrs = {
|
|
103
|
-
0: {"time": 20},
|
|
104
|
-
1: {"time": 20},
|
|
105
|
-
2: {"time": 30},
|
|
106
|
-
3: {"time": 30},
|
|
107
|
-
4: {"time": 50},
|
|
108
|
-
5: {"time": 70},
|
|
109
|
-
6: {"time": 80},
|
|
110
|
-
7: {"time": 90},
|
|
111
|
-
8: {"time": 90},
|
|
112
|
-
9: {"time": 80},
|
|
113
|
-
10: {"time": 74},
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
nx.set_node_attributes(G, node_attrs)
|
|
117
|
-
|
|
118
|
-
assert nx.cd_index(G, 4, time_delta=50) == 0.17
|
|
119
|
-
|
|
120
|
-
def test_common_graph_with_float_attributes(self):
|
|
121
|
-
G = nx.DiGraph()
|
|
122
|
-
G.add_nodes_from([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
|
|
123
|
-
G.add_edge(4, 2)
|
|
124
|
-
G.add_edge(4, 0)
|
|
125
|
-
G.add_edge(4, 1)
|
|
126
|
-
G.add_edge(4, 3)
|
|
127
|
-
G.add_edge(5, 2)
|
|
128
|
-
G.add_edge(6, 2)
|
|
129
|
-
G.add_edge(6, 4)
|
|
130
|
-
G.add_edge(7, 4)
|
|
131
|
-
G.add_edge(8, 4)
|
|
132
|
-
G.add_edge(9, 4)
|
|
133
|
-
G.add_edge(9, 1)
|
|
134
|
-
G.add_edge(9, 3)
|
|
135
|
-
G.add_edge(10, 4)
|
|
136
|
-
|
|
137
|
-
node_attrs = {
|
|
138
|
-
0: {"time": 20.2},
|
|
139
|
-
1: {"time": 20.2},
|
|
140
|
-
2: {"time": 30.7},
|
|
141
|
-
3: {"time": 30.7},
|
|
142
|
-
4: {"time": 50.9},
|
|
143
|
-
5: {"time": 70.1},
|
|
144
|
-
6: {"time": 80.6},
|
|
145
|
-
7: {"time": 90.7},
|
|
146
|
-
8: {"time": 90.7},
|
|
147
|
-
9: {"time": 80.6},
|
|
148
|
-
10: {"time": 74.2},
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
nx.set_node_attributes(G, node_attrs)
|
|
152
|
-
|
|
153
|
-
assert nx.cd_index(G, 4, time_delta=50) == 0.17
|
|
154
|
-
|
|
155
|
-
def test_common_graph_with_weights(self):
|
|
156
|
-
G = nx.DiGraph()
|
|
157
|
-
G.add_nodes_from([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
|
|
158
|
-
G.add_edge(4, 2)
|
|
159
|
-
G.add_edge(4, 0)
|
|
160
|
-
G.add_edge(4, 1)
|
|
161
|
-
G.add_edge(4, 3)
|
|
162
|
-
G.add_edge(5, 2)
|
|
163
|
-
G.add_edge(6, 2)
|
|
164
|
-
G.add_edge(6, 4)
|
|
165
|
-
G.add_edge(7, 4)
|
|
166
|
-
G.add_edge(8, 4)
|
|
167
|
-
G.add_edge(9, 4)
|
|
168
|
-
G.add_edge(9, 1)
|
|
169
|
-
G.add_edge(9, 3)
|
|
170
|
-
G.add_edge(10, 4)
|
|
171
|
-
|
|
172
|
-
node_attrs = {
|
|
173
|
-
0: {"time": datetime(1992, 1, 1)},
|
|
174
|
-
1: {"time": datetime(1992, 1, 1)},
|
|
175
|
-
2: {"time": datetime(1993, 1, 1)},
|
|
176
|
-
3: {"time": datetime(1993, 1, 1)},
|
|
177
|
-
4: {"time": datetime(1995, 1, 1)},
|
|
178
|
-
5: {"time": datetime(1997, 1, 1)},
|
|
179
|
-
6: {"time": datetime(1998, 1, 1), "weight": 5},
|
|
180
|
-
7: {"time": datetime(1999, 1, 1), "weight": 2},
|
|
181
|
-
8: {"time": datetime(1999, 1, 1), "weight": 6},
|
|
182
|
-
9: {"time": datetime(1998, 1, 1), "weight": 3},
|
|
183
|
-
10: {"time": datetime(1997, 4, 1), "weight": 10},
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
nx.set_node_attributes(G, node_attrs)
|
|
187
|
-
assert nx.cd_index(G, 4, time_delta=_delta, weight="weight") == 0.04
|
|
188
|
-
|
|
189
|
-
def test_node_with_no_predecessors(self):
|
|
190
|
-
G = nx.DiGraph()
|
|
191
|
-
G.add_nodes_from([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
|
|
192
|
-
G.add_edge(4, 2)
|
|
193
|
-
G.add_edge(4, 0)
|
|
194
|
-
G.add_edge(4, 3)
|
|
195
|
-
G.add_edge(5, 2)
|
|
196
|
-
G.add_edge(6, 2)
|
|
197
|
-
G.add_edge(6, 4)
|
|
198
|
-
G.add_edge(7, 4)
|
|
199
|
-
G.add_edge(8, 4)
|
|
200
|
-
G.add_edge(9, 4)
|
|
201
|
-
G.add_edge(9, 1)
|
|
202
|
-
G.add_edge(9, 3)
|
|
203
|
-
G.add_edge(10, 4)
|
|
204
|
-
|
|
205
|
-
node_attrs = {
|
|
206
|
-
0: {"time": datetime(1992, 1, 1)},
|
|
207
|
-
1: {"time": datetime(1992, 1, 1)},
|
|
208
|
-
2: {"time": datetime(1993, 1, 1)},
|
|
209
|
-
3: {"time": datetime(1993, 1, 1)},
|
|
210
|
-
4: {"time": datetime(1995, 1, 1)},
|
|
211
|
-
5: {"time": datetime(2005, 1, 1)},
|
|
212
|
-
6: {"time": datetime(2010, 1, 1)},
|
|
213
|
-
7: {"time": datetime(2001, 1, 1)},
|
|
214
|
-
8: {"time": datetime(2020, 1, 1)},
|
|
215
|
-
9: {"time": datetime(2017, 1, 1)},
|
|
216
|
-
10: {"time": datetime(2004, 4, 1)},
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
nx.set_node_attributes(G, node_attrs)
|
|
220
|
-
assert nx.cd_index(G, 4, time_delta=_delta) == 0.0
|
|
221
|
-
|
|
222
|
-
def test_node_with_no_successors(self):
|
|
223
|
-
G = nx.DiGraph()
|
|
224
|
-
G.add_nodes_from([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
|
|
225
|
-
G.add_edge(8, 2)
|
|
226
|
-
G.add_edge(6, 0)
|
|
227
|
-
G.add_edge(6, 3)
|
|
228
|
-
G.add_edge(5, 2)
|
|
229
|
-
G.add_edge(6, 2)
|
|
230
|
-
G.add_edge(6, 4)
|
|
231
|
-
G.add_edge(7, 4)
|
|
232
|
-
G.add_edge(8, 4)
|
|
233
|
-
G.add_edge(9, 4)
|
|
234
|
-
G.add_edge(9, 1)
|
|
235
|
-
G.add_edge(9, 3)
|
|
236
|
-
G.add_edge(10, 4)
|
|
237
|
-
|
|
238
|
-
node_attrs = {
|
|
239
|
-
0: {"time": datetime(1992, 1, 1)},
|
|
240
|
-
1: {"time": datetime(1992, 1, 1)},
|
|
241
|
-
2: {"time": datetime(1993, 1, 1)},
|
|
242
|
-
3: {"time": datetime(1993, 1, 1)},
|
|
243
|
-
4: {"time": datetime(1995, 1, 1)},
|
|
244
|
-
5: {"time": datetime(1997, 1, 1)},
|
|
245
|
-
6: {"time": datetime(1998, 1, 1)},
|
|
246
|
-
7: {"time": datetime(1999, 1, 1)},
|
|
247
|
-
8: {"time": datetime(1999, 1, 1)},
|
|
248
|
-
9: {"time": datetime(1998, 1, 1)},
|
|
249
|
-
10: {"time": datetime(1997, 4, 1)},
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
nx.set_node_attributes(G, node_attrs)
|
|
253
|
-
assert nx.cd_index(G, 4, time_delta=_delta) == 1.0
|
|
254
|
-
|
|
255
|
-
def test_n_equals_zero(self):
|
|
256
|
-
G = nx.DiGraph()
|
|
257
|
-
G.add_nodes_from([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
|
|
258
|
-
G.add_edge(4, 2)
|
|
259
|
-
G.add_edge(4, 0)
|
|
260
|
-
G.add_edge(4, 3)
|
|
261
|
-
G.add_edge(6, 4)
|
|
262
|
-
G.add_edge(7, 4)
|
|
263
|
-
G.add_edge(8, 4)
|
|
264
|
-
G.add_edge(9, 4)
|
|
265
|
-
G.add_edge(9, 1)
|
|
266
|
-
G.add_edge(10, 4)
|
|
267
|
-
|
|
268
|
-
node_attrs = {
|
|
269
|
-
0: {"time": datetime(1992, 1, 1)},
|
|
270
|
-
1: {"time": datetime(1992, 1, 1)},
|
|
271
|
-
2: {"time": datetime(1993, 1, 1)},
|
|
272
|
-
3: {"time": datetime(1993, 1, 1)},
|
|
273
|
-
4: {"time": datetime(1995, 1, 1)},
|
|
274
|
-
5: {"time": datetime(2005, 1, 1)},
|
|
275
|
-
6: {"time": datetime(2010, 1, 1)},
|
|
276
|
-
7: {"time": datetime(2001, 1, 1)},
|
|
277
|
-
8: {"time": datetime(2020, 1, 1)},
|
|
278
|
-
9: {"time": datetime(2017, 1, 1)},
|
|
279
|
-
10: {"time": datetime(2004, 4, 1)},
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
nx.set_node_attributes(G, node_attrs)
|
|
283
|
-
|
|
284
|
-
with pytest.raises(
|
|
285
|
-
nx.NetworkXError, match="The cd index cannot be defined."
|
|
286
|
-
) as ve:
|
|
287
|
-
nx.cd_index(G, 4, time_delta=_delta)
|
|
288
|
-
|
|
289
|
-
def test_time_timedelta_compatibility(self):
|
|
290
|
-
G = nx.DiGraph()
|
|
291
|
-
G.add_nodes_from([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
|
|
292
|
-
G.add_edge(4, 2)
|
|
293
|
-
G.add_edge(4, 0)
|
|
294
|
-
G.add_edge(4, 3)
|
|
295
|
-
G.add_edge(6, 4)
|
|
296
|
-
G.add_edge(7, 4)
|
|
297
|
-
G.add_edge(8, 4)
|
|
298
|
-
G.add_edge(9, 4)
|
|
299
|
-
G.add_edge(9, 1)
|
|
300
|
-
G.add_edge(10, 4)
|
|
301
|
-
|
|
302
|
-
node_attrs = {
|
|
303
|
-
0: {"time": 20.2},
|
|
304
|
-
1: {"time": 20.2},
|
|
305
|
-
2: {"time": 30.7},
|
|
306
|
-
3: {"time": 30.7},
|
|
307
|
-
4: {"time": 50.9},
|
|
308
|
-
5: {"time": 70.1},
|
|
309
|
-
6: {"time": 80.6},
|
|
310
|
-
7: {"time": 90.7},
|
|
311
|
-
8: {"time": 90.7},
|
|
312
|
-
9: {"time": 80.6},
|
|
313
|
-
10: {"time": 74.2},
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
nx.set_node_attributes(G, node_attrs)
|
|
317
|
-
|
|
318
|
-
with pytest.raises(
|
|
319
|
-
nx.NetworkXError,
|
|
320
|
-
match="Addition and comparison are not supported between",
|
|
321
|
-
) as ve:
|
|
322
|
-
nx.cd_index(G, 4, time_delta=_delta)
|
|
323
|
-
|
|
324
|
-
def test_node_with_no_time(self):
|
|
325
|
-
G = nx.DiGraph()
|
|
326
|
-
G.add_nodes_from([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
|
|
327
|
-
G.add_edge(8, 2)
|
|
328
|
-
G.add_edge(6, 0)
|
|
329
|
-
G.add_edge(6, 3)
|
|
330
|
-
G.add_edge(5, 2)
|
|
331
|
-
G.add_edge(6, 2)
|
|
332
|
-
G.add_edge(6, 4)
|
|
333
|
-
G.add_edge(7, 4)
|
|
334
|
-
G.add_edge(8, 4)
|
|
335
|
-
G.add_edge(9, 4)
|
|
336
|
-
G.add_edge(9, 1)
|
|
337
|
-
G.add_edge(9, 3)
|
|
338
|
-
G.add_edge(10, 4)
|
|
339
|
-
|
|
340
|
-
node_attrs = {
|
|
341
|
-
0: {"time": datetime(1992, 1, 1)},
|
|
342
|
-
1: {"time": datetime(1992, 1, 1)},
|
|
343
|
-
2: {"time": datetime(1993, 1, 1)},
|
|
344
|
-
3: {"time": datetime(1993, 1, 1)},
|
|
345
|
-
4: {"time": datetime(1995, 1, 1)},
|
|
346
|
-
6: {"time": datetime(1998, 1, 1)},
|
|
347
|
-
7: {"time": datetime(1999, 1, 1)},
|
|
348
|
-
8: {"time": datetime(1999, 1, 1)},
|
|
349
|
-
9: {"time": datetime(1998, 1, 1)},
|
|
350
|
-
10: {"time": datetime(1997, 4, 1)},
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
nx.set_node_attributes(G, node_attrs)
|
|
354
|
-
|
|
355
|
-
with pytest.raises(
|
|
356
|
-
nx.NetworkXError, match="Not all nodes have a 'time' attribute."
|
|
357
|
-
) as ve:
|
|
358
|
-
nx.cd_index(G, 4, time_delta=_delta)
|
|
359
|
-
|
|
360
|
-
def test_maximally_consolidating(self):
|
|
361
|
-
G = nx.DiGraph()
|
|
362
|
-
G.add_nodes_from([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11])
|
|
363
|
-
G.add_edge(5, 1)
|
|
364
|
-
G.add_edge(5, 2)
|
|
365
|
-
G.add_edge(5, 3)
|
|
366
|
-
G.add_edge(5, 4)
|
|
367
|
-
G.add_edge(6, 1)
|
|
368
|
-
G.add_edge(6, 5)
|
|
369
|
-
G.add_edge(7, 1)
|
|
370
|
-
G.add_edge(7, 5)
|
|
371
|
-
G.add_edge(8, 2)
|
|
372
|
-
G.add_edge(8, 5)
|
|
373
|
-
G.add_edge(9, 5)
|
|
374
|
-
G.add_edge(9, 3)
|
|
375
|
-
G.add_edge(10, 5)
|
|
376
|
-
G.add_edge(10, 3)
|
|
377
|
-
G.add_edge(10, 4)
|
|
378
|
-
G.add_edge(11, 5)
|
|
379
|
-
G.add_edge(11, 4)
|
|
380
|
-
|
|
381
|
-
node_attrs = {
|
|
382
|
-
0: {"time": datetime(1992, 1, 1)},
|
|
383
|
-
1: {"time": datetime(1992, 1, 1)},
|
|
384
|
-
2: {"time": datetime(1993, 1, 1)},
|
|
385
|
-
3: {"time": datetime(1993, 1, 1)},
|
|
386
|
-
4: {"time": datetime(1995, 1, 1)},
|
|
387
|
-
5: {"time": datetime(1997, 1, 1)},
|
|
388
|
-
6: {"time": datetime(1998, 1, 1)},
|
|
389
|
-
7: {"time": datetime(1999, 1, 1)},
|
|
390
|
-
8: {"time": datetime(1999, 1, 1)},
|
|
391
|
-
9: {"time": datetime(1998, 1, 1)},
|
|
392
|
-
10: {"time": datetime(1997, 4, 1)},
|
|
393
|
-
11: {"time": datetime(1998, 5, 1)},
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
nx.set_node_attributes(G, node_attrs)
|
|
397
|
-
|
|
398
|
-
assert nx.cd_index(G, 5, time_delta=_delta) == -1
|
|
399
|
-
|
|
400
|
-
def test_maximally_destabilizing(self):
|
|
401
|
-
G = nx.DiGraph()
|
|
402
|
-
G.add_nodes_from([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11])
|
|
403
|
-
G.add_edge(5, 1)
|
|
404
|
-
G.add_edge(5, 2)
|
|
405
|
-
G.add_edge(5, 3)
|
|
406
|
-
G.add_edge(5, 4)
|
|
407
|
-
G.add_edge(6, 5)
|
|
408
|
-
G.add_edge(7, 5)
|
|
409
|
-
G.add_edge(8, 5)
|
|
410
|
-
G.add_edge(9, 5)
|
|
411
|
-
G.add_edge(10, 5)
|
|
412
|
-
G.add_edge(11, 5)
|
|
413
|
-
|
|
414
|
-
node_attrs = {
|
|
415
|
-
0: {"time": datetime(1992, 1, 1)},
|
|
416
|
-
1: {"time": datetime(1992, 1, 1)},
|
|
417
|
-
2: {"time": datetime(1993, 1, 1)},
|
|
418
|
-
3: {"time": datetime(1993, 1, 1)},
|
|
419
|
-
4: {"time": datetime(1995, 1, 1)},
|
|
420
|
-
5: {"time": datetime(1997, 1, 1)},
|
|
421
|
-
6: {"time": datetime(1998, 1, 1)},
|
|
422
|
-
7: {"time": datetime(1999, 1, 1)},
|
|
423
|
-
8: {"time": datetime(1999, 1, 1)},
|
|
424
|
-
9: {"time": datetime(1998, 1, 1)},
|
|
425
|
-
10: {"time": datetime(1997, 4, 1)},
|
|
426
|
-
11: {"time": datetime(1998, 5, 1)},
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
nx.set_node_attributes(G, node_attrs)
|
|
430
|
-
|
|
431
|
-
assert nx.cd_index(G, 5, time_delta=_delta) == 1
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
"""Unit tests for the :mod:`networkx.algorithms.tournament` module."""
|
|
2
|
-
|
|
3
|
-
from itertools import combinations
|
|
4
|
-
|
|
5
|
-
import pytest
|
|
6
|
-
|
|
7
|
-
from networkx import DiGraph
|
|
8
|
-
from networkx.algorithms.tournament import (
|
|
9
|
-
hamiltonian_path,
|
|
10
|
-
index_satisfying,
|
|
11
|
-
is_reachable,
|
|
12
|
-
is_strongly_connected,
|
|
13
|
-
is_tournament,
|
|
14
|
-
random_tournament,
|
|
15
|
-
score_sequence,
|
|
16
|
-
tournament_matrix,
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
def test_condition_not_satisfied():
|
|
21
|
-
iter_in = [0]
|
|
22
|
-
assert index_satisfying(iter_in, lambda x: x > 0) == 1
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
def test_empty_iterable():
|
|
26
|
-
with pytest.raises(ValueError):
|
|
27
|
-
index_satisfying([], lambda x: x > 0)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
def test_is_tournament():
|
|
31
|
-
G = DiGraph()
|
|
32
|
-
G.add_edges_from([(0, 1), (1, 2), (2, 3), (3, 0), (1, 3), (0, 2)])
|
|
33
|
-
assert is_tournament(G)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
def test_self_loops():
|
|
37
|
-
"""A tournament must have no self-loops."""
|
|
38
|
-
G = DiGraph()
|
|
39
|
-
G.add_edges_from([(0, 1), (1, 2), (2, 3), (3, 0), (1, 3), (0, 2)])
|
|
40
|
-
G.add_edge(0, 0)
|
|
41
|
-
assert not is_tournament(G)
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
def test_missing_edges():
|
|
45
|
-
"""A tournament must not have any pair of nodes without at least
|
|
46
|
-
one edge joining the pair.
|
|
47
|
-
|
|
48
|
-
"""
|
|
49
|
-
G = DiGraph()
|
|
50
|
-
G.add_edges_from([(0, 1), (1, 2), (2, 3), (3, 0), (1, 3)])
|
|
51
|
-
assert not is_tournament(G)
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
def test_bidirectional_edges():
|
|
55
|
-
"""A tournament must not have any pair of nodes with greater
|
|
56
|
-
than one edge joining the pair.
|
|
57
|
-
|
|
58
|
-
"""
|
|
59
|
-
G = DiGraph()
|
|
60
|
-
G.add_edges_from([(0, 1), (1, 2), (2, 3), (3, 0), (1, 3), (0, 2)])
|
|
61
|
-
G.add_edge(1, 0)
|
|
62
|
-
assert not is_tournament(G)
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
def test_graph_is_tournament():
|
|
66
|
-
for _ in range(10):
|
|
67
|
-
G = random_tournament(5)
|
|
68
|
-
assert is_tournament(G)
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
def test_graph_is_tournament_seed():
|
|
72
|
-
for _ in range(10):
|
|
73
|
-
G = random_tournament(5, seed=1)
|
|
74
|
-
assert is_tournament(G)
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
def test_graph_is_tournament_one_node():
|
|
78
|
-
G = random_tournament(1)
|
|
79
|
-
assert is_tournament(G)
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
def test_graph_is_tournament_zero_node():
|
|
83
|
-
G = random_tournament(0)
|
|
84
|
-
assert is_tournament(G)
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
def test_hamiltonian_empty_graph():
|
|
88
|
-
path = hamiltonian_path(DiGraph())
|
|
89
|
-
assert len(path) == 0
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
def test_path_is_hamiltonian():
|
|
93
|
-
G = DiGraph()
|
|
94
|
-
G.add_edges_from([(0, 1), (1, 2), (2, 3), (3, 0), (1, 3), (0, 2)])
|
|
95
|
-
path = hamiltonian_path(G)
|
|
96
|
-
assert len(path) == 4
|
|
97
|
-
assert all(v in G[u] for u, v in zip(path, path[1:]))
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
def test_hamiltonian_cycle():
|
|
101
|
-
"""Tests that :func:`networkx.tournament.hamiltonian_path`
|
|
102
|
-
returns a Hamiltonian cycle when provided a strongly connected
|
|
103
|
-
tournament.
|
|
104
|
-
|
|
105
|
-
"""
|
|
106
|
-
G = DiGraph()
|
|
107
|
-
G.add_edges_from([(0, 1), (1, 2), (2, 3), (3, 0), (1, 3), (0, 2)])
|
|
108
|
-
path = hamiltonian_path(G)
|
|
109
|
-
assert len(path) == 4
|
|
110
|
-
assert all(v in G[u] for u, v in zip(path, path[1:]))
|
|
111
|
-
assert path[0] in G[path[-1]]
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
def test_score_sequence_edge():
|
|
115
|
-
G = DiGraph([(0, 1)])
|
|
116
|
-
assert score_sequence(G) == [0, 1]
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
def test_score_sequence_triangle():
|
|
120
|
-
G = DiGraph([(0, 1), (1, 2), (2, 0)])
|
|
121
|
-
assert score_sequence(G) == [1, 1, 1]
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
def test_tournament_matrix():
|
|
125
|
-
np = pytest.importorskip("numpy")
|
|
126
|
-
pytest.importorskip("scipy")
|
|
127
|
-
npt = np.testing
|
|
128
|
-
G = DiGraph([(0, 1)])
|
|
129
|
-
m = tournament_matrix(G)
|
|
130
|
-
npt.assert_array_equal(m.todense(), np.array([[0, 1], [-1, 0]]))
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
def test_reachable_pair():
|
|
134
|
-
"""Tests for a reachable pair of nodes."""
|
|
135
|
-
G = DiGraph([(0, 1), (1, 2), (2, 0)])
|
|
136
|
-
assert is_reachable(G, 0, 2)
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
def test_same_node_is_reachable():
|
|
140
|
-
"""Tests that a node is always reachable from it."""
|
|
141
|
-
# G is an arbitrary tournament on ten nodes.
|
|
142
|
-
G = DiGraph(sorted(p) for p in combinations(range(10), 2))
|
|
143
|
-
assert all(is_reachable(G, v, v) for v in G)
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
def test_unreachable_pair():
|
|
147
|
-
"""Tests for an unreachable pair of nodes."""
|
|
148
|
-
G = DiGraph([(0, 1), (0, 2), (1, 2)])
|
|
149
|
-
assert not is_reachable(G, 1, 0)
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
def test_is_strongly_connected():
|
|
153
|
-
"""Tests for a strongly connected tournament."""
|
|
154
|
-
G = DiGraph([(0, 1), (1, 2), (2, 0)])
|
|
155
|
-
assert is_strongly_connected(G)
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
def test_not_strongly_connected():
|
|
159
|
-
"""Tests for a tournament that is not strongly connected."""
|
|
160
|
-
G = DiGraph([(0, 1), (0, 2), (1, 2)])
|
|
161
|
-
assert not is_strongly_connected(G)
|