okstra 0.113.0 → 0.115.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.kr.md +2 -2
- package/README.md +2 -2
- package/docs/for-ai/README.md +2 -2
- package/docs/for-ai/skills/{okstra-brief.md → okstra-brief-gen.md} +3 -3
- package/docs/for-ai/skills/okstra-inspect.md +1 -1
- package/docs/kr/architecture.md +11 -11
- package/docs/kr/cli.md +1 -1
- package/docs/kr/follow-ups/2026-07-10-final-report-option-3.md +51 -0
- package/docs/project-structure-overview.md +2 -2
- package/package.json +1 -1
- package/runtime/BUILD.json +2 -2
- package/runtime/agents/workers/report-writer-worker.md +1 -0
- package/runtime/prompts/lead/context-loader.md +2 -2
- package/runtime/prompts/lead/okstra-lead-contract.md +1 -1
- package/runtime/prompts/profiles/_common-contract.md +3 -3
- package/runtime/prompts/profiles/implementation-planning.md +1 -1
- package/runtime/prompts/profiles/requirements-discovery.md +2 -2
- package/runtime/python/okstra_ctl/fix_cycles.py +1 -1
- package/runtime/python/okstra_ctl/implementation_stage.py +46 -39
- package/runtime/python/okstra_ctl/report_views.py +151 -12
- package/runtime/python/okstra_ctl/run.py +24 -24
- package/runtime/python/okstra_ctl/wizard.py +3 -3
- package/runtime/python/okstra_ctl/worktree.py +1 -1
- package/runtime/python/okstra_token_usage/claude.py +58 -19
- package/runtime/python/okstra_token_usage/collect.py +3 -1
- package/runtime/python/okstra_vendor/__init__.py +3 -0
- package/runtime/schemas/final-report-v1.0.schema.json +20 -0
- package/runtime/skills/{okstra-brief → okstra-brief-gen}/SKILL.md +6 -6
- package/runtime/skills/{okstra-brief → okstra-brief-gen}/references/reporter-confirmations.md +1 -1
- package/runtime/skills/{okstra-brief → okstra-brief-gen}/references/tracker-recursion.md +1 -1
- package/runtime/skills/okstra-inspect/SKILL.md +2 -2
- package/runtime/templates/reports/brief.template.md +2 -2
- package/runtime/templates/reports/final-report.template.md +14 -0
- package/runtime/templates/reports/i18n/en.json +23 -12
- package/runtime/templates/reports/i18n/ko.json +23 -12
- package/runtime/templates/reports/report.css +55 -0
- package/runtime/templates/reports/report.js +53 -1
- package/runtime/validators/validate-brief.py +5 -5
- package/runtime/validators/validate-brief.sh +1 -1
- package/src/commands/lifecycle/uninstall.mjs +2 -1
- package/src/lib/skill-catalog.mjs +2 -1
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_approx_clust_coeff.py +0 -41
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_clique.py +0 -112
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_connectivity.py +0 -199
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_density.py +0 -146
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_distance_measures.py +0 -59
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_dominating_set.py +0 -78
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_kcomponents.py +0 -303
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_matching.py +0 -8
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_maxcut.py +0 -94
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_ramsey.py +0 -31
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_steinertree.py +0 -306
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_traveling_salesman.py +0 -1014
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_treewidth.py +0 -274
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_vertex_cover.py +0 -68
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/tests/base_test.py +0 -81
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/tests/test_connectivity.py +0 -143
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/tests/test_correlation.py +0 -122
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/tests/test_mixing.py +0 -174
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/tests/test_neighbor_degree.py +0 -107
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/tests/test_pairs.py +0 -87
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_basic.py +0 -125
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_centrality.py +0 -192
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_cluster.py +0 -84
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_covering.py +0 -33
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_edgelist.py +0 -240
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_extendability.py +0 -334
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_generators.py +0 -407
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_link_analysis.py +0 -218
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_matching.py +0 -327
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_matrix.py +0 -138
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_project.py +0 -409
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_redundancy.py +0 -35
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_spectral_bipartivity.py +0 -80
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_betweenness_centrality.py +0 -923
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_betweenness_centrality_subset.py +0 -354
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_closeness_centrality.py +0 -274
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_current_flow_betweenness_centrality.py +0 -259
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_current_flow_betweenness_centrality_subset.py +0 -147
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_current_flow_closeness.py +0 -43
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_degree_centrality.py +0 -144
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_dispersion.py +0 -73
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_eigenvector_centrality.py +0 -186
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_group.py +0 -277
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_harmonic_centrality.py +0 -122
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_katz_centrality.py +0 -345
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_laplacian_centrality.py +0 -220
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_load_centrality.py +0 -344
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_percolation_centrality.py +0 -87
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_reaching.py +0 -140
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_second_order_centrality.py +0 -82
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_subgraph.py +0 -110
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_trophic.py +0 -302
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_voterank.py +0 -64
- package/runtime/python/okstra_vendor/networkx/algorithms/coloring/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/coloring/tests/test_coloring.py +0 -863
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_asyn_fluid.py +0 -147
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_bipartitions.py +0 -157
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_centrality.py +0 -85
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_divisive.py +0 -106
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_kclique.py +0 -91
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_label_propagation.py +0 -241
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_leiden.py +0 -138
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_local.py +0 -76
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_louvain.py +0 -264
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_lukes.py +0 -152
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_modularity_max.py +0 -340
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_quality.py +0 -139
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_utils.py +0 -26
- package/runtime/python/okstra_vendor/networkx/algorithms/components/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/components/tests/test_attracting.py +0 -70
- package/runtime/python/okstra_vendor/networkx/algorithms/components/tests/test_biconnected.py +0 -248
- package/runtime/python/okstra_vendor/networkx/algorithms/components/tests/test_connected.py +0 -138
- package/runtime/python/okstra_vendor/networkx/algorithms/components/tests/test_semiconnected.py +0 -55
- package/runtime/python/okstra_vendor/networkx/algorithms/components/tests/test_strongly_connected.py +0 -193
- package/runtime/python/okstra_vendor/networkx/algorithms/components/tests/test_weakly_connected.py +0 -96
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_connectivity.py +0 -421
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_cuts.py +0 -309
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_disjoint_paths.py +0 -249
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_edge_augmentation.py +0 -502
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_edge_kcomponents.py +0 -488
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_kcomponents.py +0 -323
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_kcutsets.py +0 -280
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_stoer_wagner.py +0 -102
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/gl1.gpickle.bz2 +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/gw1.gpickle.bz2 +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/netgen-2.gpickle.bz2 +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/test_gomory_hu.py +0 -128
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/test_maxflow.py +0 -573
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/test_maxflow_large_graph.py +0 -155
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/test_mincost.py +0 -475
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/test_networksimplex.py +0 -481
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/wlm3.gpickle.bz2 +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/iso_r01_s80.A99 +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/iso_r01_s80.B99 +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/si2_b06_m200.A99 +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/si2_b06_m200.B99 +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_ismags.py +0 -719
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_isomorphism.py +0 -103
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_isomorphvf2.py +0 -490
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_match_helpers.py +0 -64
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_temporalisomorphvf2.py +0 -212
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_tree_isomorphism.py +0 -202
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_vf2pp.py +0 -1655
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_vf2pp_helpers.py +0 -3118
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_vf2userfunc.py +0 -196
- package/runtime/python/okstra_vendor/networkx/algorithms/link_analysis/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/link_analysis/tests/test_hits.py +0 -77
- package/runtime/python/okstra_vendor/networkx/algorithms/link_analysis/tests/test_pagerank.py +0 -213
- package/runtime/python/okstra_vendor/networkx/algorithms/minors/tests/test_contraction.py +0 -544
- package/runtime/python/okstra_vendor/networkx/algorithms/operators/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/operators/tests/test_all.py +0 -328
- package/runtime/python/okstra_vendor/networkx/algorithms/operators/tests/test_binary.py +0 -451
- package/runtime/python/okstra_vendor/networkx/algorithms/operators/tests/test_product.py +0 -491
- package/runtime/python/okstra_vendor/networkx/algorithms/operators/tests/test_unary.py +0 -55
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/tests/test_astar.py +0 -254
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/tests/test_dense.py +0 -212
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/tests/test_dense_numpy.py +0 -88
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/tests/test_generic.py +0 -511
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/tests/test_unweighted.py +0 -149
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/tests/test_weighted.py +0 -983
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_asteroidal.py +0 -23
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_boundary.py +0 -154
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_bridges.py +0 -144
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_broadcasting.py +0 -109
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_chains.py +0 -136
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_chordal.py +0 -129
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_clique.py +0 -300
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_cluster.py +0 -678
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_communicability.py +0 -80
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_core.py +0 -266
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_covering.py +0 -85
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_cuts.py +0 -171
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_cycles.py +0 -984
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_d_separation.py +0 -340
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_dag.py +0 -835
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_distance_measures.py +0 -831
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_distance_regular.py +0 -85
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_dominance.py +0 -299
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_dominating.py +0 -115
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_efficiency.py +0 -58
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_euler.py +0 -314
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_graph_hashing.py +0 -872
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_graphical.py +0 -163
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_hierarchy.py +0 -46
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_hybrid.py +0 -24
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_isolate.py +0 -26
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_link_prediction.py +0 -615
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_lowest_common_ancestors.py +0 -459
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_matching.py +0 -556
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_max_weight_clique.py +0 -179
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_mis.py +0 -62
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_moral.py +0 -15
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_node_classification.py +0 -140
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_non_randomness.py +0 -60
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_perfect_graph.py +0 -27
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_planar_drawing.py +0 -274
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_planarity.py +0 -556
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_polynomials.py +0 -57
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_reciprocity.py +0 -37
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_regular.py +0 -88
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_richclub.py +0 -149
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_similarity.py +0 -1158
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_simple_paths.py +0 -803
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_smallworld.py +0 -76
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_smetric.py +0 -8
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_sparsifiers.py +0 -138
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_structuralholes.py +0 -191
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_summarization.py +0 -642
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_swap.py +0 -179
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_threshold.py +0 -270
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_time_dependent.py +0 -431
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_tournament.py +0 -161
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_triads.py +0 -248
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_vitality.py +0 -41
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_voronoi.py +0 -103
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_walks.py +0 -54
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_wiener.py +0 -157
- package/runtime/python/okstra_vendor/networkx/algorithms/traversal/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/traversal/tests/test_beamsearch.py +0 -25
- package/runtime/python/okstra_vendor/networkx/algorithms/traversal/tests/test_bfs.py +0 -203
- package/runtime/python/okstra_vendor/networkx/algorithms/traversal/tests/test_dfs.py +0 -307
- package/runtime/python/okstra_vendor/networkx/algorithms/traversal/tests/test_edgebfs.py +0 -147
- package/runtime/python/okstra_vendor/networkx/algorithms/traversal/tests/test_edgedfs.py +0 -131
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/test_branchings.py +0 -624
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/test_coding.py +0 -114
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/test_decomposition.py +0 -79
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/test_distance_measures.py +0 -99
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/test_mst.py +0 -934
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/test_operations.py +0 -53
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/test_recognition.py +0 -174
- package/runtime/python/okstra_vendor/networkx/classes/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/classes/tests/dispatch_interface.py +0 -192
- package/runtime/python/okstra_vendor/networkx/classes/tests/historical_tests.py +0 -476
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_coreviews.py +0 -362
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_digraph.py +0 -331
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_digraph_historical.py +0 -110
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_filters.py +0 -177
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_function.py +0 -1045
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_graph.py +0 -950
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_graph_historical.py +0 -12
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_graphviews.py +0 -349
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_multidigraph.py +0 -459
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_multigraph.py +0 -528
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_reportviews.py +0 -1421
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_special.py +0 -131
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_subgraphviews.py +0 -371
- package/runtime/python/okstra_vendor/networkx/conftest.py +0 -261
- package/runtime/python/okstra_vendor/networkx/drawing/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/baseline/test_display_complex.png +0 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/baseline/test_display_empty_graph.png +0 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/baseline/test_display_house_with_colors.png +0 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/baseline/test_display_labels_and_colors.png +0 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/baseline/test_display_shortest_path.png +0 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/baseline/test_house_with_colors.png +0 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/test_agraph.py +0 -237
- package/runtime/python/okstra_vendor/networkx/drawing/tests/test_image_comparison_pylab_mpl.py +0 -229
- package/runtime/python/okstra_vendor/networkx/drawing/tests/test_latex.py +0 -285
- package/runtime/python/okstra_vendor/networkx/drawing/tests/test_layout.py +0 -631
- package/runtime/python/okstra_vendor/networkx/drawing/tests/test_pydot.py +0 -146
- package/runtime/python/okstra_vendor/networkx/drawing/tests/test_pylab.py +0 -1582
- package/runtime/python/okstra_vendor/networkx/generators/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_atlas.py +0 -75
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_classic.py +0 -642
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_cographs.py +0 -20
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_community.py +0 -362
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_degree_seq.py +0 -224
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_directed.py +0 -189
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_duplication.py +0 -103
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_ego.py +0 -39
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_expanders.py +0 -182
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_geometric.py +0 -488
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_harary_graph.py +0 -133
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_internet_as_graphs.py +0 -221
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_intersection.py +0 -28
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_interval_graph.py +0 -144
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_joint_degree_seq.py +0 -125
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_lattice.py +0 -264
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_line.py +0 -316
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_mycielski.py +0 -30
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_nonisomorphic_trees.py +0 -82
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_random_clustered.py +0 -33
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_random_graphs.py +0 -495
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_small.py +0 -220
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_spectral_graph_forge.py +0 -49
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_stochastic.py +0 -72
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_sudoku.py +0 -92
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_time_series.py +0 -64
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_trees.py +0 -195
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_triads.py +0 -15
- package/runtime/python/okstra_vendor/networkx/linalg/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/linalg/tests/test_algebraic_connectivity.py +0 -400
- package/runtime/python/okstra_vendor/networkx/linalg/tests/test_attrmatrix.py +0 -108
- package/runtime/python/okstra_vendor/networkx/linalg/tests/test_bethehessian.py +0 -40
- package/runtime/python/okstra_vendor/networkx/linalg/tests/test_graphmatrix.py +0 -275
- package/runtime/python/okstra_vendor/networkx/linalg/tests/test_laplacian.py +0 -334
- package/runtime/python/okstra_vendor/networkx/linalg/tests/test_modularity.py +0 -86
- package/runtime/python/okstra_vendor/networkx/linalg/tests/test_spectrum.py +0 -70
- package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/tests/test_adjacency.py +0 -78
- package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/tests/test_cytoscape.py +0 -78
- package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/tests/test_node_link.py +0 -109
- package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/tests/test_tree.py +0 -48
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_adjlist.py +0 -354
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_edgelist.py +0 -318
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_gexf.py +0 -612
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_gml.py +0 -744
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_graph6.py +0 -181
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_graphml.py +0 -1531
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_leda.py +0 -30
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_p2g.py +0 -63
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_pajek.py +0 -128
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_sparse6.py +0 -166
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_text.py +0 -1742
- package/runtime/python/okstra_vendor/networkx/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/tests/test_all_random_functions.py +0 -248
- package/runtime/python/okstra_vendor/networkx/tests/test_convert.py +0 -321
- package/runtime/python/okstra_vendor/networkx/tests/test_convert_numpy.py +0 -531
- package/runtime/python/okstra_vendor/networkx/tests/test_convert_pandas.py +0 -349
- package/runtime/python/okstra_vendor/networkx/tests/test_convert_scipy.py +0 -281
- package/runtime/python/okstra_vendor/networkx/tests/test_exceptions.py +0 -40
- package/runtime/python/okstra_vendor/networkx/tests/test_import.py +0 -11
- package/runtime/python/okstra_vendor/networkx/tests/test_lazy_imports.py +0 -96
- package/runtime/python/okstra_vendor/networkx/tests/test_relabel.py +0 -349
- package/runtime/python/okstra_vendor/networkx/tests/test_removed_functions_exception_messages.py +0 -8
- package/runtime/python/okstra_vendor/networkx/utils/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/utils/tests/test__init.py +0 -11
- package/runtime/python/okstra_vendor/networkx/utils/tests/test_backends.py +0 -225
- package/runtime/python/okstra_vendor/networkx/utils/tests/test_config.py +0 -263
- package/runtime/python/okstra_vendor/networkx/utils/tests/test_decorators.py +0 -510
- package/runtime/python/okstra_vendor/networkx/utils/tests/test_heaps.py +0 -131
- package/runtime/python/okstra_vendor/networkx/utils/tests/test_mapped_queue.py +0 -268
- package/runtime/python/okstra_vendor/networkx/utils/tests/test_misc.py +0 -393
- package/runtime/python/okstra_vendor/networkx/utils/tests/test_random_sequence.py +0 -53
- package/runtime/python/okstra_vendor/networkx/utils/tests/test_rcm.py +0 -63
- package/runtime/python/okstra_vendor/networkx/utils/tests/test_unionfind.py +0 -55
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import pytest
|
|
2
|
-
|
|
3
|
-
import networkx as nx
|
|
4
|
-
|
|
5
|
-
from .base_test import BaseTestAttributeMixing, BaseTestDegreeMixing
|
|
6
|
-
|
|
7
|
-
np = pytest.importorskip("numpy")
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class TestDegreeMixingDict(BaseTestDegreeMixing):
|
|
11
|
-
def test_degree_mixing_dict_undirected(self):
|
|
12
|
-
d = nx.degree_mixing_dict(self.P4)
|
|
13
|
-
d_result = {1: {2: 2}, 2: {1: 2, 2: 2}}
|
|
14
|
-
assert d == d_result
|
|
15
|
-
|
|
16
|
-
def test_degree_mixing_dict_undirected_normalized(self):
|
|
17
|
-
d = nx.degree_mixing_dict(self.P4, normalized=True)
|
|
18
|
-
d_result = {1: {2: 1.0 / 3}, 2: {1: 1.0 / 3, 2: 1.0 / 3}}
|
|
19
|
-
assert d == d_result
|
|
20
|
-
|
|
21
|
-
def test_degree_mixing_dict_directed(self):
|
|
22
|
-
d = nx.degree_mixing_dict(self.D)
|
|
23
|
-
d_result = {1: {3: 2}, 2: {1: 1, 3: 1}, 3: {}}
|
|
24
|
-
assert d == d_result
|
|
25
|
-
|
|
26
|
-
def test_degree_mixing_dict_multigraph(self):
|
|
27
|
-
d = nx.degree_mixing_dict(self.M)
|
|
28
|
-
d_result = {1: {2: 1}, 2: {1: 1, 3: 3}, 3: {2: 3}}
|
|
29
|
-
assert d == d_result
|
|
30
|
-
|
|
31
|
-
def test_degree_mixing_dict_weighted(self):
|
|
32
|
-
d = nx.degree_mixing_dict(self.W, weight="weight")
|
|
33
|
-
d_result = {0.5: {1.5: 1}, 1.5: {1.5: 6, 0.5: 1}}
|
|
34
|
-
assert d == d_result
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
class TestDegreeMixingMatrix(BaseTestDegreeMixing):
|
|
38
|
-
def test_degree_mixing_matrix_undirected(self):
|
|
39
|
-
# fmt: off
|
|
40
|
-
a_result = np.array([[0, 2],
|
|
41
|
-
[2, 2]]
|
|
42
|
-
)
|
|
43
|
-
# fmt: on
|
|
44
|
-
a = nx.degree_mixing_matrix(self.P4, normalized=False)
|
|
45
|
-
np.testing.assert_equal(a, a_result)
|
|
46
|
-
a = nx.degree_mixing_matrix(self.P4)
|
|
47
|
-
np.testing.assert_equal(a, a_result / a_result.sum())
|
|
48
|
-
|
|
49
|
-
def test_degree_mixing_matrix_directed(self):
|
|
50
|
-
# fmt: off
|
|
51
|
-
a_result = np.array([[0, 0, 2],
|
|
52
|
-
[1, 0, 1],
|
|
53
|
-
[0, 0, 0]]
|
|
54
|
-
)
|
|
55
|
-
# fmt: on
|
|
56
|
-
a = nx.degree_mixing_matrix(self.D, normalized=False)
|
|
57
|
-
np.testing.assert_equal(a, a_result)
|
|
58
|
-
a = nx.degree_mixing_matrix(self.D)
|
|
59
|
-
np.testing.assert_equal(a, a_result / a_result.sum())
|
|
60
|
-
|
|
61
|
-
def test_degree_mixing_matrix_multigraph(self):
|
|
62
|
-
# fmt: off
|
|
63
|
-
a_result = np.array([[0, 1, 0],
|
|
64
|
-
[1, 0, 3],
|
|
65
|
-
[0, 3, 0]]
|
|
66
|
-
)
|
|
67
|
-
# fmt: on
|
|
68
|
-
a = nx.degree_mixing_matrix(self.M, normalized=False)
|
|
69
|
-
np.testing.assert_equal(a, a_result)
|
|
70
|
-
a = nx.degree_mixing_matrix(self.M)
|
|
71
|
-
np.testing.assert_equal(a, a_result / a_result.sum())
|
|
72
|
-
|
|
73
|
-
def test_degree_mixing_matrix_selfloop(self):
|
|
74
|
-
# fmt: off
|
|
75
|
-
a_result = np.array([[2]])
|
|
76
|
-
# fmt: on
|
|
77
|
-
a = nx.degree_mixing_matrix(self.S, normalized=False)
|
|
78
|
-
np.testing.assert_equal(a, a_result)
|
|
79
|
-
a = nx.degree_mixing_matrix(self.S)
|
|
80
|
-
np.testing.assert_equal(a, a_result / a_result.sum())
|
|
81
|
-
|
|
82
|
-
def test_degree_mixing_matrix_weighted(self):
|
|
83
|
-
a_result = np.array([[0.0, 1.0], [1.0, 6.0]])
|
|
84
|
-
a = nx.degree_mixing_matrix(self.W, weight="weight", normalized=False)
|
|
85
|
-
np.testing.assert_equal(a, a_result)
|
|
86
|
-
a = nx.degree_mixing_matrix(self.W, weight="weight")
|
|
87
|
-
np.testing.assert_equal(a, a_result / float(a_result.sum()))
|
|
88
|
-
|
|
89
|
-
def test_degree_mixing_matrix_mapping(self):
|
|
90
|
-
a_result = np.array([[6.0, 1.0], [1.0, 0.0]])
|
|
91
|
-
mapping = {0.5: 1, 1.5: 0}
|
|
92
|
-
a = nx.degree_mixing_matrix(
|
|
93
|
-
self.W, weight="weight", normalized=False, mapping=mapping
|
|
94
|
-
)
|
|
95
|
-
np.testing.assert_equal(a, a_result)
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
class TestAttributeMixingDict(BaseTestAttributeMixing):
|
|
99
|
-
def test_attribute_mixing_dict_undirected(self):
|
|
100
|
-
d = nx.attribute_mixing_dict(self.G, "fish")
|
|
101
|
-
d_result = {
|
|
102
|
-
"one": {"one": 2, "red": 1},
|
|
103
|
-
"two": {"two": 2, "blue": 1},
|
|
104
|
-
"red": {"one": 1},
|
|
105
|
-
"blue": {"two": 1},
|
|
106
|
-
}
|
|
107
|
-
assert d == d_result
|
|
108
|
-
|
|
109
|
-
def test_attribute_mixing_dict_directed(self):
|
|
110
|
-
d = nx.attribute_mixing_dict(self.D, "fish")
|
|
111
|
-
d_result = {
|
|
112
|
-
"one": {"one": 1, "red": 1},
|
|
113
|
-
"two": {"two": 1, "blue": 1},
|
|
114
|
-
"red": {},
|
|
115
|
-
"blue": {},
|
|
116
|
-
}
|
|
117
|
-
assert d == d_result
|
|
118
|
-
|
|
119
|
-
def test_attribute_mixing_dict_multigraph(self):
|
|
120
|
-
d = nx.attribute_mixing_dict(self.M, "fish")
|
|
121
|
-
d_result = {"one": {"one": 4}, "two": {"two": 2}}
|
|
122
|
-
assert d == d_result
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
class TestAttributeMixingMatrix(BaseTestAttributeMixing):
|
|
126
|
-
def test_attribute_mixing_matrix_undirected(self):
|
|
127
|
-
mapping = {"one": 0, "two": 1, "red": 2, "blue": 3}
|
|
128
|
-
a_result = np.array([[2, 0, 1, 0], [0, 2, 0, 1], [1, 0, 0, 0], [0, 1, 0, 0]])
|
|
129
|
-
a = nx.attribute_mixing_matrix(
|
|
130
|
-
self.G, "fish", mapping=mapping, normalized=False
|
|
131
|
-
)
|
|
132
|
-
np.testing.assert_equal(a, a_result)
|
|
133
|
-
a = nx.attribute_mixing_matrix(self.G, "fish", mapping=mapping)
|
|
134
|
-
np.testing.assert_equal(a, a_result / a_result.sum())
|
|
135
|
-
|
|
136
|
-
def test_attribute_mixing_matrix_directed(self):
|
|
137
|
-
mapping = {"one": 0, "two": 1, "red": 2, "blue": 3}
|
|
138
|
-
a_result = np.array([[1, 0, 1, 0], [0, 1, 0, 1], [0, 0, 0, 0], [0, 0, 0, 0]])
|
|
139
|
-
a = nx.attribute_mixing_matrix(
|
|
140
|
-
self.D, "fish", mapping=mapping, normalized=False
|
|
141
|
-
)
|
|
142
|
-
np.testing.assert_equal(a, a_result)
|
|
143
|
-
a = nx.attribute_mixing_matrix(self.D, "fish", mapping=mapping)
|
|
144
|
-
np.testing.assert_equal(a, a_result / a_result.sum())
|
|
145
|
-
|
|
146
|
-
def test_attribute_mixing_matrix_multigraph(self):
|
|
147
|
-
mapping = {"one": 0, "two": 1, "red": 2, "blue": 3}
|
|
148
|
-
a_result = np.array([[4, 0, 0, 0], [0, 2, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]])
|
|
149
|
-
a = nx.attribute_mixing_matrix(
|
|
150
|
-
self.M, "fish", mapping=mapping, normalized=False
|
|
151
|
-
)
|
|
152
|
-
np.testing.assert_equal(a, a_result)
|
|
153
|
-
a = nx.attribute_mixing_matrix(self.M, "fish", mapping=mapping)
|
|
154
|
-
np.testing.assert_equal(a, a_result / a_result.sum())
|
|
155
|
-
|
|
156
|
-
def test_attribute_mixing_matrix_negative(self):
|
|
157
|
-
mapping = {-2: 0, -3: 1, -4: 2}
|
|
158
|
-
a_result = np.array([[4.0, 1.0, 1.0], [1.0, 0.0, 0.0], [1.0, 0.0, 0.0]])
|
|
159
|
-
a = nx.attribute_mixing_matrix(
|
|
160
|
-
self.N, "margin", mapping=mapping, normalized=False
|
|
161
|
-
)
|
|
162
|
-
np.testing.assert_equal(a, a_result)
|
|
163
|
-
a = nx.attribute_mixing_matrix(self.N, "margin", mapping=mapping)
|
|
164
|
-
np.testing.assert_equal(a, a_result / float(a_result.sum()))
|
|
165
|
-
|
|
166
|
-
def test_attribute_mixing_matrix_float(self):
|
|
167
|
-
mapping = {0.5: 1, 1.5: 0}
|
|
168
|
-
a_result = np.array([[6.0, 1.0], [1.0, 0.0]])
|
|
169
|
-
a = nx.attribute_mixing_matrix(
|
|
170
|
-
self.F, "margin", mapping=mapping, normalized=False
|
|
171
|
-
)
|
|
172
|
-
np.testing.assert_equal(a, a_result)
|
|
173
|
-
a = nx.attribute_mixing_matrix(self.F, "margin", mapping=mapping)
|
|
174
|
-
np.testing.assert_equal(a, a_result / a_result.sum())
|
package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/tests/test_neighbor_degree.py
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import pytest
|
|
2
|
-
|
|
3
|
-
import networkx as nx
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class TestAverageNeighbor:
|
|
7
|
-
def test_degree_p4(self):
|
|
8
|
-
G = nx.path_graph(4)
|
|
9
|
-
answer = {0: 2, 1: 1.5, 2: 1.5, 3: 2}
|
|
10
|
-
nd = nx.average_neighbor_degree(G)
|
|
11
|
-
assert nd == answer
|
|
12
|
-
|
|
13
|
-
D = G.to_directed()
|
|
14
|
-
nd = nx.average_neighbor_degree(D)
|
|
15
|
-
assert nd == answer
|
|
16
|
-
|
|
17
|
-
D = nx.DiGraph(G.edges(data=True))
|
|
18
|
-
nd = nx.average_neighbor_degree(D)
|
|
19
|
-
assert nd == {0: 1, 1: 1, 2: 0, 3: 0}
|
|
20
|
-
nd = nx.average_neighbor_degree(D, "in", "out")
|
|
21
|
-
assert nd == {0: 0, 1: 1, 2: 1, 3: 1}
|
|
22
|
-
nd = nx.average_neighbor_degree(D, "out", "in")
|
|
23
|
-
assert nd == {0: 1, 1: 1, 2: 1, 3: 0}
|
|
24
|
-
nd = nx.average_neighbor_degree(D, "in", "in")
|
|
25
|
-
assert nd == {0: 0, 1: 0, 2: 1, 3: 1}
|
|
26
|
-
|
|
27
|
-
def test_degree_p4_weighted(self):
|
|
28
|
-
G = nx.path_graph(4)
|
|
29
|
-
G[1][2]["weight"] = 4
|
|
30
|
-
answer = {0: 2, 1: 1.8, 2: 1.8, 3: 2}
|
|
31
|
-
nd = nx.average_neighbor_degree(G, weight="weight")
|
|
32
|
-
assert nd == answer
|
|
33
|
-
|
|
34
|
-
D = G.to_directed()
|
|
35
|
-
nd = nx.average_neighbor_degree(D, weight="weight")
|
|
36
|
-
assert nd == answer
|
|
37
|
-
|
|
38
|
-
D = nx.DiGraph(G.edges(data=True))
|
|
39
|
-
nd = nx.average_neighbor_degree(D, weight="weight")
|
|
40
|
-
assert nd == {0: 1, 1: 1, 2: 0, 3: 0}
|
|
41
|
-
nd = nx.average_neighbor_degree(D, "out", "out", weight="weight")
|
|
42
|
-
assert nd == {0: 1, 1: 1, 2: 0, 3: 0}
|
|
43
|
-
nd = nx.average_neighbor_degree(D, "in", "in", weight="weight")
|
|
44
|
-
assert nd == {0: 0, 1: 0, 2: 1, 3: 1}
|
|
45
|
-
nd = nx.average_neighbor_degree(D, "in", "out", weight="weight")
|
|
46
|
-
assert nd == {0: 0, 1: 1, 2: 1, 3: 1}
|
|
47
|
-
nd = nx.average_neighbor_degree(D, "out", "in", weight="weight")
|
|
48
|
-
assert nd == {0: 1, 1: 1, 2: 1, 3: 0}
|
|
49
|
-
nd = nx.average_neighbor_degree(D, source="in+out", weight="weight")
|
|
50
|
-
assert nd == {0: 1.0, 1: 1.0, 2: 0.8, 3: 1.0}
|
|
51
|
-
nd = nx.average_neighbor_degree(D, target="in+out", weight="weight")
|
|
52
|
-
assert nd == {0: 2.0, 1: 2.0, 2: 1.0, 3: 0.0}
|
|
53
|
-
|
|
54
|
-
D = G.to_directed()
|
|
55
|
-
nd = nx.average_neighbor_degree(D, weight="weight")
|
|
56
|
-
assert nd == answer
|
|
57
|
-
nd = nx.average_neighbor_degree(D, source="out", target="out", weight="weight")
|
|
58
|
-
assert nd == answer
|
|
59
|
-
|
|
60
|
-
D = G.to_directed()
|
|
61
|
-
nd = nx.average_neighbor_degree(D, source="in", target="in", weight="weight")
|
|
62
|
-
assert nd == answer
|
|
63
|
-
|
|
64
|
-
def test_degree_k4(self):
|
|
65
|
-
G = nx.complete_graph(4)
|
|
66
|
-
answer = {0: 3, 1: 3, 2: 3, 3: 3}
|
|
67
|
-
nd = nx.average_neighbor_degree(G)
|
|
68
|
-
assert nd == answer
|
|
69
|
-
|
|
70
|
-
D = G.to_directed()
|
|
71
|
-
nd = nx.average_neighbor_degree(D)
|
|
72
|
-
assert nd == answer
|
|
73
|
-
|
|
74
|
-
D = G.to_directed()
|
|
75
|
-
nd = nx.average_neighbor_degree(D)
|
|
76
|
-
assert nd == answer
|
|
77
|
-
|
|
78
|
-
D = G.to_directed()
|
|
79
|
-
nd = nx.average_neighbor_degree(D, source="in", target="in")
|
|
80
|
-
assert nd == answer
|
|
81
|
-
|
|
82
|
-
def test_degree_k4_nodes(self):
|
|
83
|
-
G = nx.complete_graph(4)
|
|
84
|
-
answer = {1: 3.0, 2: 3.0}
|
|
85
|
-
nd = nx.average_neighbor_degree(G, nodes=[1, 2])
|
|
86
|
-
assert nd == answer
|
|
87
|
-
|
|
88
|
-
def test_degree_barrat(self):
|
|
89
|
-
G = nx.star_graph(5)
|
|
90
|
-
G.add_edges_from([(5, 6), (5, 7), (5, 8), (5, 9)])
|
|
91
|
-
G[0][5]["weight"] = 5
|
|
92
|
-
nd = nx.average_neighbor_degree(G)[5]
|
|
93
|
-
assert nd == 1.8
|
|
94
|
-
nd = nx.average_neighbor_degree(G, weight="weight")[5]
|
|
95
|
-
assert nd == pytest.approx(3.222222, abs=1e-5)
|
|
96
|
-
|
|
97
|
-
def test_error_invalid_source_target(self):
|
|
98
|
-
G = nx.path_graph(4)
|
|
99
|
-
with pytest.raises(nx.NetworkXError):
|
|
100
|
-
nx.average_neighbor_degree(G, "error")
|
|
101
|
-
with pytest.raises(nx.NetworkXError):
|
|
102
|
-
nx.average_neighbor_degree(G, "in", "error")
|
|
103
|
-
G = G.to_directed()
|
|
104
|
-
with pytest.raises(nx.NetworkXError):
|
|
105
|
-
nx.average_neighbor_degree(G, "error")
|
|
106
|
-
with pytest.raises(nx.NetworkXError):
|
|
107
|
-
nx.average_neighbor_degree(G, "in", "error")
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import networkx as nx
|
|
2
|
-
|
|
3
|
-
from .base_test import BaseTestAttributeMixing, BaseTestDegreeMixing
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class TestAttributeMixingXY(BaseTestAttributeMixing):
|
|
7
|
-
def test_node_attribute_xy_undirected(self):
|
|
8
|
-
attrxy = sorted(nx.node_attribute_xy(self.G, "fish"))
|
|
9
|
-
attrxy_result = sorted(
|
|
10
|
-
[
|
|
11
|
-
("one", "one"),
|
|
12
|
-
("one", "one"),
|
|
13
|
-
("two", "two"),
|
|
14
|
-
("two", "two"),
|
|
15
|
-
("one", "red"),
|
|
16
|
-
("red", "one"),
|
|
17
|
-
("blue", "two"),
|
|
18
|
-
("two", "blue"),
|
|
19
|
-
]
|
|
20
|
-
)
|
|
21
|
-
assert attrxy == attrxy_result
|
|
22
|
-
|
|
23
|
-
def test_node_attribute_xy_undirected_nodes(self):
|
|
24
|
-
attrxy = sorted(nx.node_attribute_xy(self.G, "fish", nodes=["one", "yellow"]))
|
|
25
|
-
attrxy_result = sorted([])
|
|
26
|
-
assert attrxy == attrxy_result
|
|
27
|
-
|
|
28
|
-
def test_node_attribute_xy_directed(self):
|
|
29
|
-
attrxy = sorted(nx.node_attribute_xy(self.D, "fish"))
|
|
30
|
-
attrxy_result = sorted(
|
|
31
|
-
[("one", "one"), ("two", "two"), ("one", "red"), ("two", "blue")]
|
|
32
|
-
)
|
|
33
|
-
assert attrxy == attrxy_result
|
|
34
|
-
|
|
35
|
-
def test_node_attribute_xy_multigraph(self):
|
|
36
|
-
attrxy = sorted(nx.node_attribute_xy(self.M, "fish"))
|
|
37
|
-
attrxy_result = [
|
|
38
|
-
("one", "one"),
|
|
39
|
-
("one", "one"),
|
|
40
|
-
("one", "one"),
|
|
41
|
-
("one", "one"),
|
|
42
|
-
("two", "two"),
|
|
43
|
-
("two", "two"),
|
|
44
|
-
]
|
|
45
|
-
assert attrxy == attrxy_result
|
|
46
|
-
|
|
47
|
-
def test_node_attribute_xy_selfloop(self):
|
|
48
|
-
attrxy = sorted(nx.node_attribute_xy(self.S, "fish"))
|
|
49
|
-
attrxy_result = [("one", "one"), ("two", "two")]
|
|
50
|
-
assert attrxy == attrxy_result
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
class TestDegreeMixingXY(BaseTestDegreeMixing):
|
|
54
|
-
def test_node_degree_xy_undirected(self):
|
|
55
|
-
xy = sorted(nx.node_degree_xy(self.P4))
|
|
56
|
-
xy_result = sorted([(1, 2), (2, 1), (2, 2), (2, 2), (1, 2), (2, 1)])
|
|
57
|
-
assert xy == xy_result
|
|
58
|
-
|
|
59
|
-
def test_node_degree_xy_undirected_nodes(self):
|
|
60
|
-
xy = sorted(nx.node_degree_xy(self.P4, nodes=[0, 1, -1]))
|
|
61
|
-
xy_result = sorted([(1, 2), (2, 1)])
|
|
62
|
-
assert xy == xy_result
|
|
63
|
-
|
|
64
|
-
def test_node_degree_xy_directed(self):
|
|
65
|
-
xy = sorted(nx.node_degree_xy(self.D))
|
|
66
|
-
xy_result = sorted([(2, 1), (2, 3), (1, 3), (1, 3)])
|
|
67
|
-
assert xy == xy_result
|
|
68
|
-
|
|
69
|
-
def test_node_degree_xy_multigraph(self):
|
|
70
|
-
xy = sorted(nx.node_degree_xy(self.M))
|
|
71
|
-
xy_result = sorted(
|
|
72
|
-
[(2, 3), (2, 3), (3, 2), (3, 2), (2, 3), (3, 2), (1, 2), (2, 1)]
|
|
73
|
-
)
|
|
74
|
-
assert xy == xy_result
|
|
75
|
-
|
|
76
|
-
def test_node_degree_xy_selfloop(self):
|
|
77
|
-
xy = sorted(nx.node_degree_xy(self.S))
|
|
78
|
-
xy_result = sorted([(2, 2), (2, 2)])
|
|
79
|
-
assert xy == xy_result
|
|
80
|
-
|
|
81
|
-
def test_node_degree_xy_weighted(self):
|
|
82
|
-
G = nx.Graph()
|
|
83
|
-
G.add_edge(1, 2, weight=7)
|
|
84
|
-
G.add_edge(2, 3, weight=10)
|
|
85
|
-
xy = sorted(nx.node_degree_xy(G, weight="weight"))
|
|
86
|
-
xy_result = sorted([(7, 17), (17, 10), (17, 7), (10, 17)])
|
|
87
|
-
assert xy == xy_result
|
|
File without changes
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import pytest
|
|
2
|
-
|
|
3
|
-
import networkx as nx
|
|
4
|
-
from networkx.algorithms import bipartite
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class TestBipartiteBasic:
|
|
8
|
-
def test_is_bipartite(self):
|
|
9
|
-
assert bipartite.is_bipartite(nx.path_graph(4))
|
|
10
|
-
assert bipartite.is_bipartite(nx.DiGraph([(1, 0)]))
|
|
11
|
-
assert not bipartite.is_bipartite(nx.complete_graph(3))
|
|
12
|
-
|
|
13
|
-
def test_bipartite_color(self):
|
|
14
|
-
G = nx.path_graph(4)
|
|
15
|
-
c = bipartite.color(G)
|
|
16
|
-
assert c == {0: 1, 1: 0, 2: 1, 3: 0}
|
|
17
|
-
|
|
18
|
-
def test_not_bipartite_color(self):
|
|
19
|
-
with pytest.raises(nx.NetworkXError):
|
|
20
|
-
c = bipartite.color(nx.complete_graph(4))
|
|
21
|
-
|
|
22
|
-
def test_bipartite_directed(self):
|
|
23
|
-
G = bipartite.random_graph(10, 10, 0.1, directed=True)
|
|
24
|
-
assert bipartite.is_bipartite(G)
|
|
25
|
-
|
|
26
|
-
def test_bipartite_sets(self):
|
|
27
|
-
G = nx.path_graph(4)
|
|
28
|
-
X, Y = bipartite.sets(G)
|
|
29
|
-
assert X == {0, 2}
|
|
30
|
-
assert Y == {1, 3}
|
|
31
|
-
|
|
32
|
-
def test_bipartite_sets_directed(self):
|
|
33
|
-
G = nx.path_graph(4)
|
|
34
|
-
D = G.to_directed()
|
|
35
|
-
X, Y = bipartite.sets(D)
|
|
36
|
-
assert X == {0, 2}
|
|
37
|
-
assert Y == {1, 3}
|
|
38
|
-
|
|
39
|
-
def test_bipartite_sets_given_top_nodes(self):
|
|
40
|
-
G = nx.path_graph(4)
|
|
41
|
-
top_nodes = [0, 2]
|
|
42
|
-
X, Y = bipartite.sets(G, top_nodes)
|
|
43
|
-
assert X == {0, 2}
|
|
44
|
-
assert Y == {1, 3}
|
|
45
|
-
|
|
46
|
-
def test_bipartite_sets_disconnected(self):
|
|
47
|
-
with pytest.raises(nx.AmbiguousSolution):
|
|
48
|
-
G = nx.path_graph(4)
|
|
49
|
-
G.add_edges_from([(5, 6), (6, 7)])
|
|
50
|
-
X, Y = bipartite.sets(G)
|
|
51
|
-
|
|
52
|
-
def test_is_bipartite_node_set(self):
|
|
53
|
-
G = nx.path_graph(4)
|
|
54
|
-
|
|
55
|
-
with pytest.raises(nx.AmbiguousSolution):
|
|
56
|
-
bipartite.is_bipartite_node_set(G, [1, 1, 2, 3])
|
|
57
|
-
|
|
58
|
-
assert bipartite.is_bipartite_node_set(G, [0, 2])
|
|
59
|
-
assert bipartite.is_bipartite_node_set(G, [1, 3])
|
|
60
|
-
assert not bipartite.is_bipartite_node_set(G, [1, 2])
|
|
61
|
-
G.add_edge(10, 20)
|
|
62
|
-
assert bipartite.is_bipartite_node_set(G, [0, 2, 10])
|
|
63
|
-
assert bipartite.is_bipartite_node_set(G, [0, 2, 20])
|
|
64
|
-
assert bipartite.is_bipartite_node_set(G, [1, 3, 10])
|
|
65
|
-
assert bipartite.is_bipartite_node_set(G, [1, 3, 20])
|
|
66
|
-
|
|
67
|
-
def test_bipartite_density(self):
|
|
68
|
-
G = nx.path_graph(5)
|
|
69
|
-
X, Y = bipartite.sets(G)
|
|
70
|
-
density = len(list(G.edges())) / (len(X) * len(Y))
|
|
71
|
-
assert bipartite.density(G, X) == density
|
|
72
|
-
D = nx.DiGraph(G.edges())
|
|
73
|
-
assert bipartite.density(D, X) == density / 2.0
|
|
74
|
-
assert bipartite.density(nx.Graph(), {}) == 0.0
|
|
75
|
-
|
|
76
|
-
def test_bipartite_degrees(self):
|
|
77
|
-
G = nx.path_graph(5)
|
|
78
|
-
X = {1, 3}
|
|
79
|
-
Y = {0, 2, 4}
|
|
80
|
-
u, d = bipartite.degrees(G, Y)
|
|
81
|
-
assert dict(u) == {1: 2, 3: 2}
|
|
82
|
-
assert dict(d) == {0: 1, 2: 2, 4: 1}
|
|
83
|
-
|
|
84
|
-
def test_bipartite_weighted_degrees(self):
|
|
85
|
-
G = nx.path_graph(5)
|
|
86
|
-
G.add_edge(0, 1, weight=0.1, other=0.2)
|
|
87
|
-
X = {1, 3}
|
|
88
|
-
Y = {0, 2, 4}
|
|
89
|
-
u, d = bipartite.degrees(G, Y, weight="weight")
|
|
90
|
-
assert dict(u) == {1: 1.1, 3: 2}
|
|
91
|
-
assert dict(d) == {0: 0.1, 2: 2, 4: 1}
|
|
92
|
-
u, d = bipartite.degrees(G, Y, weight="other")
|
|
93
|
-
assert dict(u) == {1: 1.2, 3: 2}
|
|
94
|
-
assert dict(d) == {0: 0.2, 2: 2, 4: 1}
|
|
95
|
-
|
|
96
|
-
def test_biadjacency_matrix_weight(self):
|
|
97
|
-
pytest.importorskip("scipy")
|
|
98
|
-
G = nx.path_graph(5)
|
|
99
|
-
G.add_edge(0, 1, weight=2, other=4)
|
|
100
|
-
X = [1, 3]
|
|
101
|
-
Y = [0, 2, 4]
|
|
102
|
-
M = bipartite.biadjacency_matrix(G, X, weight="weight")
|
|
103
|
-
assert M[0, 0] == 2
|
|
104
|
-
M = bipartite.biadjacency_matrix(G, X, weight="other")
|
|
105
|
-
assert M[0, 0] == 4
|
|
106
|
-
|
|
107
|
-
def test_biadjacency_matrix(self):
|
|
108
|
-
pytest.importorskip("scipy")
|
|
109
|
-
tops = [2, 5, 10]
|
|
110
|
-
bots = [5, 10, 15]
|
|
111
|
-
for i in range(len(tops)):
|
|
112
|
-
G = bipartite.random_graph(tops[i], bots[i], 0.2)
|
|
113
|
-
top = [n for n, d in G.nodes(data=True) if d["bipartite"] == 0]
|
|
114
|
-
M = bipartite.biadjacency_matrix(G, top)
|
|
115
|
-
assert M.shape[0] == tops[i]
|
|
116
|
-
assert M.shape[1] == bots[i]
|
|
117
|
-
|
|
118
|
-
def test_biadjacency_matrix_order(self):
|
|
119
|
-
pytest.importorskip("scipy")
|
|
120
|
-
G = nx.path_graph(5)
|
|
121
|
-
G.add_edge(0, 1, weight=2)
|
|
122
|
-
X = [3, 1]
|
|
123
|
-
Y = [4, 2, 0]
|
|
124
|
-
M = bipartite.biadjacency_matrix(G, X, Y, weight="weight")
|
|
125
|
-
assert M[1, 2] == 2
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import pytest
|
|
2
|
-
|
|
3
|
-
import networkx as nx
|
|
4
|
-
from networkx.algorithms import bipartite
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class TestBipartiteCentrality:
|
|
8
|
-
@classmethod
|
|
9
|
-
def setup_class(cls):
|
|
10
|
-
cls.P4 = nx.path_graph(4)
|
|
11
|
-
cls.K3 = nx.complete_bipartite_graph(3, 3)
|
|
12
|
-
cls.C4 = nx.cycle_graph(4)
|
|
13
|
-
cls.davis = nx.davis_southern_women_graph()
|
|
14
|
-
cls.top_nodes = [
|
|
15
|
-
n for n, d in cls.davis.nodes(data=True) if d["bipartite"] == 0
|
|
16
|
-
]
|
|
17
|
-
|
|
18
|
-
def test_degree_centrality(self):
|
|
19
|
-
d = bipartite.degree_centrality(self.P4, [1, 3])
|
|
20
|
-
answer = {0: 0.5, 1: 1.0, 2: 1.0, 3: 0.5}
|
|
21
|
-
assert d == answer
|
|
22
|
-
d = bipartite.degree_centrality(self.K3, [0, 1, 2])
|
|
23
|
-
answer = {0: 1.0, 1: 1.0, 2: 1.0, 3: 1.0, 4: 1.0, 5: 1.0}
|
|
24
|
-
assert d == answer
|
|
25
|
-
d = bipartite.degree_centrality(self.C4, [0, 2])
|
|
26
|
-
answer = {0: 1.0, 1: 1.0, 2: 1.0, 3: 1.0}
|
|
27
|
-
assert d == answer
|
|
28
|
-
|
|
29
|
-
def test_betweenness_centrality(self):
|
|
30
|
-
c = bipartite.betweenness_centrality(self.P4, [1, 3])
|
|
31
|
-
answer = {0: 0.0, 1: 1.0, 2: 1.0, 3: 0.0}
|
|
32
|
-
assert c == answer
|
|
33
|
-
c = bipartite.betweenness_centrality(self.K3, [0, 1, 2])
|
|
34
|
-
answer = {0: 0.125, 1: 0.125, 2: 0.125, 3: 0.125, 4: 0.125, 5: 0.125}
|
|
35
|
-
assert c == answer
|
|
36
|
-
c = bipartite.betweenness_centrality(self.C4, [0, 2])
|
|
37
|
-
answer = {0: 0.25, 1: 0.25, 2: 0.25, 3: 0.25}
|
|
38
|
-
assert c == answer
|
|
39
|
-
|
|
40
|
-
def test_closeness_centrality(self):
|
|
41
|
-
c = bipartite.closeness_centrality(self.P4, [1, 3])
|
|
42
|
-
answer = {0: 2.0 / 3, 1: 1.0, 2: 1.0, 3: 2.0 / 3}
|
|
43
|
-
assert c == answer
|
|
44
|
-
c = bipartite.closeness_centrality(self.K3, [0, 1, 2])
|
|
45
|
-
answer = {0: 1.0, 1: 1.0, 2: 1.0, 3: 1.0, 4: 1.0, 5: 1.0}
|
|
46
|
-
assert c == answer
|
|
47
|
-
c = bipartite.closeness_centrality(self.C4, [0, 2])
|
|
48
|
-
answer = {0: 1.0, 1: 1.0, 2: 1.0, 3: 1.0}
|
|
49
|
-
assert c == answer
|
|
50
|
-
G = nx.Graph()
|
|
51
|
-
G.add_node(0)
|
|
52
|
-
G.add_node(1)
|
|
53
|
-
c = bipartite.closeness_centrality(G, [0])
|
|
54
|
-
assert c == {0: 0.0, 1: 0.0}
|
|
55
|
-
c = bipartite.closeness_centrality(G, [1])
|
|
56
|
-
assert c == {0: 0.0, 1: 0.0}
|
|
57
|
-
|
|
58
|
-
def test_bipartite_closeness_centrality_unconnected(self):
|
|
59
|
-
G = nx.complete_bipartite_graph(3, 3)
|
|
60
|
-
G.add_edge(6, 7)
|
|
61
|
-
c = bipartite.closeness_centrality(G, [0, 2, 4, 6], normalized=False)
|
|
62
|
-
answer = {
|
|
63
|
-
0: 10.0 / 7,
|
|
64
|
-
2: 10.0 / 7,
|
|
65
|
-
4: 10.0 / 7,
|
|
66
|
-
6: 10.0,
|
|
67
|
-
1: 10.0 / 7,
|
|
68
|
-
3: 10.0 / 7,
|
|
69
|
-
5: 10.0 / 7,
|
|
70
|
-
7: 10.0,
|
|
71
|
-
}
|
|
72
|
-
assert c == answer
|
|
73
|
-
|
|
74
|
-
def test_davis_degree_centrality(self):
|
|
75
|
-
G = self.davis
|
|
76
|
-
deg = bipartite.degree_centrality(G, self.top_nodes)
|
|
77
|
-
answer = {
|
|
78
|
-
"E8": 0.78,
|
|
79
|
-
"E9": 0.67,
|
|
80
|
-
"E7": 0.56,
|
|
81
|
-
"Nora Fayette": 0.57,
|
|
82
|
-
"Evelyn Jefferson": 0.57,
|
|
83
|
-
"Theresa Anderson": 0.57,
|
|
84
|
-
"E6": 0.44,
|
|
85
|
-
"Sylvia Avondale": 0.50,
|
|
86
|
-
"Laura Mandeville": 0.50,
|
|
87
|
-
"Brenda Rogers": 0.50,
|
|
88
|
-
"Katherina Rogers": 0.43,
|
|
89
|
-
"E5": 0.44,
|
|
90
|
-
"Helen Lloyd": 0.36,
|
|
91
|
-
"E3": 0.33,
|
|
92
|
-
"Ruth DeSand": 0.29,
|
|
93
|
-
"Verne Sanderson": 0.29,
|
|
94
|
-
"E12": 0.33,
|
|
95
|
-
"Myra Liddel": 0.29,
|
|
96
|
-
"E11": 0.22,
|
|
97
|
-
"Eleanor Nye": 0.29,
|
|
98
|
-
"Frances Anderson": 0.29,
|
|
99
|
-
"Pearl Oglethorpe": 0.21,
|
|
100
|
-
"E4": 0.22,
|
|
101
|
-
"Charlotte McDowd": 0.29,
|
|
102
|
-
"E10": 0.28,
|
|
103
|
-
"Olivia Carleton": 0.14,
|
|
104
|
-
"Flora Price": 0.14,
|
|
105
|
-
"E2": 0.17,
|
|
106
|
-
"E1": 0.17,
|
|
107
|
-
"Dorothy Murchison": 0.14,
|
|
108
|
-
"E13": 0.17,
|
|
109
|
-
"E14": 0.17,
|
|
110
|
-
}
|
|
111
|
-
for node, value in answer.items():
|
|
112
|
-
assert value == pytest.approx(deg[node], abs=1e-2)
|
|
113
|
-
|
|
114
|
-
def test_davis_betweenness_centrality(self):
|
|
115
|
-
G = self.davis
|
|
116
|
-
bet = bipartite.betweenness_centrality(G, self.top_nodes)
|
|
117
|
-
answer = {
|
|
118
|
-
"E8": 0.24,
|
|
119
|
-
"E9": 0.23,
|
|
120
|
-
"E7": 0.13,
|
|
121
|
-
"Nora Fayette": 0.11,
|
|
122
|
-
"Evelyn Jefferson": 0.10,
|
|
123
|
-
"Theresa Anderson": 0.09,
|
|
124
|
-
"E6": 0.07,
|
|
125
|
-
"Sylvia Avondale": 0.07,
|
|
126
|
-
"Laura Mandeville": 0.05,
|
|
127
|
-
"Brenda Rogers": 0.05,
|
|
128
|
-
"Katherina Rogers": 0.05,
|
|
129
|
-
"E5": 0.04,
|
|
130
|
-
"Helen Lloyd": 0.04,
|
|
131
|
-
"E3": 0.02,
|
|
132
|
-
"Ruth DeSand": 0.02,
|
|
133
|
-
"Verne Sanderson": 0.02,
|
|
134
|
-
"E12": 0.02,
|
|
135
|
-
"Myra Liddel": 0.02,
|
|
136
|
-
"E11": 0.02,
|
|
137
|
-
"Eleanor Nye": 0.01,
|
|
138
|
-
"Frances Anderson": 0.01,
|
|
139
|
-
"Pearl Oglethorpe": 0.01,
|
|
140
|
-
"E4": 0.01,
|
|
141
|
-
"Charlotte McDowd": 0.01,
|
|
142
|
-
"E10": 0.01,
|
|
143
|
-
"Olivia Carleton": 0.01,
|
|
144
|
-
"Flora Price": 0.01,
|
|
145
|
-
"E2": 0.00,
|
|
146
|
-
"E1": 0.00,
|
|
147
|
-
"Dorothy Murchison": 0.00,
|
|
148
|
-
"E13": 0.00,
|
|
149
|
-
"E14": 0.00,
|
|
150
|
-
}
|
|
151
|
-
for node, value in answer.items():
|
|
152
|
-
assert value == pytest.approx(bet[node], abs=1e-2)
|
|
153
|
-
|
|
154
|
-
def test_davis_closeness_centrality(self):
|
|
155
|
-
G = self.davis
|
|
156
|
-
clos = bipartite.closeness_centrality(G, self.top_nodes)
|
|
157
|
-
answer = {
|
|
158
|
-
"E8": 0.85,
|
|
159
|
-
"E9": 0.79,
|
|
160
|
-
"E7": 0.73,
|
|
161
|
-
"Nora Fayette": 0.80,
|
|
162
|
-
"Evelyn Jefferson": 0.80,
|
|
163
|
-
"Theresa Anderson": 0.80,
|
|
164
|
-
"E6": 0.69,
|
|
165
|
-
"Sylvia Avondale": 0.77,
|
|
166
|
-
"Laura Mandeville": 0.73,
|
|
167
|
-
"Brenda Rogers": 0.73,
|
|
168
|
-
"Katherina Rogers": 0.73,
|
|
169
|
-
"E5": 0.59,
|
|
170
|
-
"Helen Lloyd": 0.73,
|
|
171
|
-
"E3": 0.56,
|
|
172
|
-
"Ruth DeSand": 0.71,
|
|
173
|
-
"Verne Sanderson": 0.71,
|
|
174
|
-
"E12": 0.56,
|
|
175
|
-
"Myra Liddel": 0.69,
|
|
176
|
-
"E11": 0.54,
|
|
177
|
-
"Eleanor Nye": 0.67,
|
|
178
|
-
"Frances Anderson": 0.67,
|
|
179
|
-
"Pearl Oglethorpe": 0.67,
|
|
180
|
-
"E4": 0.54,
|
|
181
|
-
"Charlotte McDowd": 0.60,
|
|
182
|
-
"E10": 0.55,
|
|
183
|
-
"Olivia Carleton": 0.59,
|
|
184
|
-
"Flora Price": 0.59,
|
|
185
|
-
"E2": 0.52,
|
|
186
|
-
"E1": 0.52,
|
|
187
|
-
"Dorothy Murchison": 0.65,
|
|
188
|
-
"E13": 0.52,
|
|
189
|
-
"E14": 0.52,
|
|
190
|
-
}
|
|
191
|
-
for node, value in answer.items():
|
|
192
|
-
assert value == pytest.approx(clos[node], abs=1e-2)
|