build.graph.weights.nx_edge_data_weight()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1.125

Importance

Changes 0
Metric Value
cc 1
eloc 2
nop 3
dl 0
loc 3
ccs 1
cts 2
cp 0.5
crap 1.125
rs 10
c 0
b 0
f 0
1
"""Weight functions for use in pathfinding."""
2
# pylint: disable=unused-argument
3
4 1
def nx_edge_data_weight(edge_u, edge_v, edge_data: dict):
5
    """Return custom edge data value to be used as a callback by nx."""
6
    return edge_data.get("hop", 1)
7
8
9 1
def nx_edge_data_delay(edge_u, edge_v, edge_data: dict):
10
    """Return custom edge data value to be used as a callback by nx."""
11
    return edge_data.get("delay", 1)
12
13
14 1
def nx_edge_data_priority(edge_u, edge_v, edge_data: dict):
15
    """Return custom edge data value to be used as a callback by nx."""
16
    return edge_data.get("priority", 1)
17