-
Notifications
You must be signed in to change notification settings - Fork 0
/
constants.py
76 lines (74 loc) · 1.87 KB
/
constants.py
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import networkx as nx
from os.path import dirname, join, abspath
from matplotlib import pyplot as plt
#
# Construct graph family dict
# for easy graph generation
graph_dict = {
"complete": nx.complete_graph,
"complete_bipartite": nx.complete_bipartite_graph,
"star": nx.star_graph,
"path": nx.path_graph,
"cycle": nx.cycle_graph,
"hyper_cube": nx.hypercube_graph,
"random_binomial": nx.gnp_random_graph,
"wheel": nx.wheel_graph
}
#
# Construct layout dict
# for easy changese to layout
layout_dict = {
"kawada": nx.kamada_kawai_layout,
"fruchterman": nx.fruchterman_reingold_layout,
"spring": nx.spring_layout
}
#
# Matrix specifications
LAPLACIAN = "laplacian"
ADJACENCY = "adjacency"
#
# Perturbations specifications
NODE = "node"
EDGE = "edge"
#
# Graph specifications
TARGET = "target"
PERTURBED = "perturbed"
#
# Layout specifications
SPRING = "spring"
KAWADA = "kawada"
FRUCHTERMAN = "fruchterman"
#
# Graph specifications
COMPLETE = "complete"
COMPLETE_BIPARTITE = "complete_bipartite"
STAR = "star"
PATH = "path"
CYCLE = "cycle"
HYPER_CUBE = "hyper_cube"
RANDOM_BINOMIAL = "random_binomial"
WHEEL = "wheel"
#
# Create relative absolute path
# to data dir for easy read/write
root_dir = dirname(abspath(__file__))
data_dir = join(root_dir, "data")
#
# Perturbed Data Keys
BULK_INDICES = "bulk_indices"
NORMALIZED_EIGENCENTRALITIES = "normalized_eigencentralities"
SPECTRA = "spectra"
REDUCED_SPECTRAL_SIMILARITY = "rss"
IRRECONCILABLE_SPECTRAL_DIFFERENCE = "isd"
TOTAL_SPECTRAL_SIMILARITY = "tss"
#
# Color maps for different metrics
metric_color_maps = {
REDUCED_SPECTRAL_SIMILARITY: plt.get_cmap('PuBu'),
IRRECONCILABLE_SPECTRAL_DIFFERENCE: plt.get_cmap('YlGn'),
TOTAL_SPECTRAL_SIMILARITY: plt.get_cmap('YlOrRd')
}
misc_color_maps = {
"YlGnBu": plt.get_cmap('YlGnBu')
}