Skip to content

Commit f99f326

Browse files
committed
unit: null now gives [-] as the unit
1 parent dc333c1 commit f99f326

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

ml_peg/analysis/surfaces/OC157/metrics.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ metrics:
88
Ranking Error:
99
good: 0.0
1010
bad: 1.0
11-
unit: "-"
11+
unit: null
1212
tooltip: Error in ranking stability across triplets
1313
level_of_theory: PBE

ml_peg/analysis/utils/utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ def load_metrics_config(config_path: Path) -> tuple[Thresholds, dict[str, str]]:
5757
f"Metric '{metric_name}' must define a 'unit' entry in {config_path}"
5858
)
5959

60-
unit_value = str(metric_config["unit"]).strip()
60+
if unit_value := metric_config["unit"] is not None:
61+
unit_value = str(metric_config["unit"]).strip()
62+
else:
63+
unit_value = "-"
6164

6265
metric_threshold: ThresholdEntry = {
6366
"good": good_value,

0 commit comments

Comments
 (0)