-
Notifications
You must be signed in to change notification settings - Fork 0
/
logging_utilities.py
39 lines (25 loc) · 1.06 KB
/
logging_utilities.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
import re
def write_node_features(features: list[str]) -> str:
log_text = "---\n"
log_text += "## Node Features: \n"
log_text += "---\n"
for feature in features:
if re.match("^gro|^per", feature):
n_features = " 25 (one-hot encoded)\n" # 7 period, 18 group = 25
else:
n_features = " 1 float\n"
log_text += "- " + feature + " " + n_features
return log_text
def write_parameters(head: str, parameters: dict,
units: str = "Angstrom") -> str:
log_text = "---\n"
log_text += "## parameters for: " + head + "\n"
log_text += "---\n"
log_text += "- nFeatures: " + repr(parameters["n_features"]) + "\n"
log_text += "- r_min: " + repr(parameters["x_min"]) + " " + units + "\n"
log_text += "- r_max: " + repr(parameters["x_max"]) + " " + units + "\n"
log_text += "- sigma: " + repr(parameters["sigma"]) + " " + units + "\n"
if parameters["norm"]:
log_text += "- Normalised: " + "True\n"
log_text += "---\n"
return log_text