graphoskop 0.4.8__py3-none-any.whl
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.
- graphoskop/__init__.py +64 -0
- graphoskop/backboning.py +1370 -0
- graphoskop/bipartite_projections.py +534 -0
- graphoskop/centrality.py +1209 -0
- graphoskop/coloring.py +345 -0
- graphoskop/communities.py +226 -0
- graphoskop/equivalence.py +817 -0
- graphoskop/exploration.py +116 -0
- graphoskop/generators.py +1392 -0
- graphoskop/hierarchy.py +42 -0
- graphoskop/multilayer.py +170 -0
- graphoskop/network.py +1561 -0
- graphoskop/network_statistics.py +1259 -0
- graphoskop/node_vector_analysis.py +513 -0
- graphoskop/planarity.py +207 -0
- graphoskop/shortest_paths.py +658 -0
- graphoskop/signed.py +592 -0
- graphoskop/transformations.py +401 -0
- graphoskop/utils.py +622 -0
- graphoskop-0.4.8.dist-info/METADATA +144 -0
- graphoskop-0.4.8.dist-info/RECORD +23 -0
- graphoskop-0.4.8.dist-info/WHEEL +5 -0
- graphoskop-0.4.8.dist-info/top_level.txt +1 -0
graphoskop/__init__.py
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Graphoskop: analysis of networks and of vectors defined on their nodes.
|
|
3
|
+
|
|
4
|
+
All public functions and classes are available at the top level of the package.
|
|
5
|
+
|
|
6
|
+
Quick start, with an edge list ``edges.tsv``::
|
|
7
|
+
|
|
8
|
+
source target weight
|
|
9
|
+
alice bob 1.5
|
|
10
|
+
bob carol 2.0
|
|
11
|
+
|
|
12
|
+
and a node table ``nodes.tsv``::
|
|
13
|
+
|
|
14
|
+
id age height city
|
|
15
|
+
alice 34 170 Rome
|
|
16
|
+
carol 29 165 Oslo
|
|
17
|
+
|
|
18
|
+
.. code-block:: python
|
|
19
|
+
|
|
20
|
+
import graphoskop as gsk
|
|
21
|
+
|
|
22
|
+
net = gsk.load_network("edges.tsv", "nodes.tsv")
|
|
23
|
+
g = net.components[0] # largest weakly connected component
|
|
24
|
+
g.edge_index # edges, internal node ids
|
|
25
|
+
g.edge_attr # weight, one row per edge
|
|
26
|
+
g.node_attr # age and height (numeric), one row per node
|
|
27
|
+
net.qualitative_node_attr # city (qualitative), always in CPU memory
|
|
28
|
+
net.node_map["alice"] # (component, index)
|
|
29
|
+
|
|
30
|
+
Multilayer networks are loaded with ``multilayer = True`` from an edge list with a ``layer``
|
|
31
|
+
column; nodes are then copies ``(entity, layer)`` (see :doc:`multilayer`). Signed networks carry
|
|
32
|
+
a +1 / -1 sign on their edges, built from a positive and a negative layer or by thresholding a
|
|
33
|
+
weight (see :doc:`signed`).
|
|
34
|
+
|
|
35
|
+
Synthetic networks come from generators, which can also randomize an existing network, keeping
|
|
36
|
+
its nodes and their attributes (see :doc:`generators`).
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
from importlib.metadata import version, PackageNotFoundError
|
|
40
|
+
|
|
41
|
+
from .network import BIPARTITE, LAYER, Network, load_network, save_network, load_pickled_network
|
|
42
|
+
from .multilayer import layer_network, aggregate_network
|
|
43
|
+
from .transformations import to_undirected, remove_isolates, remove_self_loops, remove_parallel_edges, subgraph, to_strongly_connected
|
|
44
|
+
from .signed import SIGN, signed_network, signed_adjacency, structural_balance, signed_triangle_counts
|
|
45
|
+
from .utils import laplacian, laplacian_pinv, laplacian_solver, stationary_distribution, effective_resistance, hitting_time
|
|
46
|
+
from .shortest_paths import shortest_path, shortest_path_length, single_source_shortest_paths, single_source_shortest_path_lengths, all_pairs_shortest_paths, all_pairs_shortest_path_lengths, shortest_path_length_distribution, diameter
|
|
47
|
+
from .communities import modularity, maximal_cliques
|
|
48
|
+
from .coloring import graph_coloring, maximum_independent_set
|
|
49
|
+
from .exploration import bfs, dfs
|
|
50
|
+
from .centrality import closeness_centrality, harmonic_centrality, betweenness_centrality, edge_betweenness_centrality, flow_centrality, reach_centrality, eigenvector_centrality, pagerank, katz_centrality, alpha_centrality, hits, k_core_centrality, centralization
|
|
51
|
+
from .hierarchy import global_reach_centrality
|
|
52
|
+
from .equivalence import structural_equivalence, automorphic_equivalence, pairwise_structural_equivalence, pairwise_automorphic_equivalence, regular_equivalence, pairwise_regular_equivalence, path_regular_equivalence, pairwise_path_regular_equivalence
|
|
53
|
+
from .network_statistics import connected_components_count, connected_components_nodes, degree, average_degree, degree_power_law, degree_centralization, density, reciprocity, average_shortest_path_length, local_clustering, global_clustering, average_clustering, assortativity
|
|
54
|
+
from .backboning import noise_corrected, disparity_filter, doubly_stochastic, high_salience_skeleton, extract_backbone, test_bb_thresholds, find_bb_thresholds, spanning_tree, maximally_filtered_graph, triangulated_filtered_graph
|
|
55
|
+
from .bipartite_projections import simple_count_projection, hist_intersection_projection, hyperbolic_projection, resource_allocation_projection, random_walk_projection
|
|
56
|
+
from .generators import gnm_random_graph, gnp_random_graph, caveman_graph, watts_strogatz_graph, barabasi_albert_graph, link_selection_graph, copying_graph, holme_kim_graph
|
|
57
|
+
from .node_vector_analysis import generalized_euclidean, pairwise_generalized_euclidean, network_correlation, pairwise_network_correlation, network_variance, network_entropy
|
|
58
|
+
|
|
59
|
+
try:
|
|
60
|
+
__version__ = version("graphoskop")
|
|
61
|
+
except PackageNotFoundError:
|
|
62
|
+
__version__ = "unknown"
|
|
63
|
+
|
|
64
|
+
__all__ = ["BIPARTITE", "LAYER", "Network", "load_network", "save_network", "load_pickled_network", "layer_network", "aggregate_network", "to_undirected", "remove_isolates", "remove_self_loops", "remove_parallel_edges", "subgraph", "to_strongly_connected", "SIGN", "signed_network", "signed_adjacency", "structural_balance", "signed_triangle_counts", "laplacian", "laplacian_pinv", "laplacian_solver", "stationary_distribution", "generalized_euclidean", "pairwise_generalized_euclidean", "effective_resistance", "hitting_time", "network_correlation", "pairwise_network_correlation", "network_variance", "network_entropy", "shortest_path", "shortest_path_length", "single_source_shortest_paths", "single_source_shortest_path_lengths", "all_pairs_shortest_paths", "all_pairs_shortest_path_lengths", "shortest_path_length_distribution", "diameter", "noise_corrected", "disparity_filter", "doubly_stochastic", "high_salience_skeleton", "extract_backbone", "test_bb_thresholds", "find_bb_thresholds", "spanning_tree", "maximally_filtered_graph", "triangulated_filtered_graph", "connected_components_count", "connected_components_nodes", "degree", "average_degree", "degree_power_law", "degree_centralization", "density", "reciprocity", "average_shortest_path_length", "local_clustering", "global_clustering", "average_clustering", "assortativity", "modularity", "maximal_cliques", "graph_coloring", "maximum_independent_set", "bfs", "dfs", "closeness_centrality", "harmonic_centrality", "betweenness_centrality", "edge_betweenness_centrality", "flow_centrality", "reach_centrality", "eigenvector_centrality", "pagerank", "hits", "k_core_centrality", "centralization", "katz_centrality", "alpha_centrality", "global_reach_centrality", "structural_equivalence", "automorphic_equivalence", "pairwise_structural_equivalence", "pairwise_automorphic_equivalence", "regular_equivalence", "pairwise_regular_equivalence", "path_regular_equivalence", "pairwise_path_regular_equivalence", "simple_count_projection", "hist_intersection_projection", "hyperbolic_projection", "resource_allocation_projection", "random_walk_projection", "gnm_random_graph", "gnp_random_graph", "caveman_graph", "watts_strogatz_graph", "barabasi_albert_graph", "link_selection_graph", "copying_graph", "holme_kim_graph"]
|