-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy path55_debug_technical.py
More file actions
36 lines (31 loc) · 989 Bytes
/
Copy path55_debug_technical.py
File metadata and controls
36 lines (31 loc) · 989 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
"""
55. Debug: Technical debugging information
FAST: <1s runtime
Dependencies: py3plex (core)
Demonstrates .debug() for getting technical details about query execution.
"""
from py3plex.core import multinet
from py3plex.dsl import Q, L
# Create small multilayer network
net = multinet.multi_layer_network(directed=False)
net.add_nodes([
{'source': 'Alice', 'type': 'social'},
{'source': 'Bob', 'type': 'social'},
{'source': 'Carol', 'type': 'social'},
])
net.add_edges([
{'source': 'Alice', 'target': 'Bob', 'source_type': 'social', 'target_type': 'social'},
{'source': 'Alice', 'target': 'Carol', 'source_type': 'social', 'target_type': 'social'},
])
# DSL: Execute query and get debugging info
result = (
Q.nodes()
.compute("degree", "betweenness_centrality")
.order_by("betweenness_centrality", desc=True)
.limit(10)
.execute(net)
)
# Get technical debugging information
print("Debug Information:")
print("=" * 60)
print(result.debug())