diff --git a/src/med_bench/utils/constants.py b/src/med_bench/utils/constants.py index c625ea5..a4d238e 100644 --- a/src/med_bench/utils/constants.py +++ b/src/med_bench/utils/constants.py @@ -1,5 +1,4 @@ import itertools -import os import numpy as np from numpy.random import default_rng @@ -7,46 +6,47 @@ # TOLERANCE THRESHOLDS -SMALL_ATE_TOLERANCE = 0.05 -SMALL_DIRECT_TOLERANCE = 0.05 -SMALL_INDIRECT_TOLERANCE = 0.2 - -MEDIUM_ATE_TOLERANCE = 0.10 -MEDIUM_DIRECT_TOLERANCE = 0.10 -MEDIUM_INDIRECT_TOLERANCE = 0.4 +TOLERANCE_THRESHOLDS = { + "SMALL_ATE_TOLERANCE": 0.05, + "SMALL_DIRECT_TOLERANCE": 0.05, + "SMALL_INDIRECT_TOLERANCE": 0.2, + "MEDIUM_ATE_TOLERANCE": 0.10, + "MEDIUM_DIRECT_TOLERANCE": 0.10, + "MEDIUM_INDIRECT_TOLERANCE": 0.4, + "LARGE_ATE_TOLERANCE": 0.15, + "LARGE_DIRECT_TOLERANCE": 0.15, + "LARGE_INDIRECT_TOLERANCE": 0.8 +} -LARGE_ATE_TOLERANCE = 0.15 -LARGE_DIRECT_TOLERANCE = 0.15 -LARGE_INDIRECT_TOLERANCE = 0.8 # indirect effect is weak, leading to a large relative error SMALL_TOLERANCE = np.array( [ - SMALL_ATE_TOLERANCE, - SMALL_DIRECT_TOLERANCE, - SMALL_DIRECT_TOLERANCE, - SMALL_INDIRECT_TOLERANCE, - SMALL_INDIRECT_TOLERANCE, + TOLERANCE_THRESHOLDS["SMALL_ATE_TOLERANCE"], + TOLERANCE_THRESHOLDS["SMALL_DIRECT_TOLERANCE"], + TOLERANCE_THRESHOLDS["SMALL_DIRECT_TOLERANCE"], + TOLERANCE_THRESHOLDS["SMALL_INDIRECT_TOLERANCE"], + TOLERANCE_THRESHOLDS["SMALL_INDIRECT_TOLERANCE"], ] ) MEDIUM_TOLERANCE = np.array( [ - MEDIUM_ATE_TOLERANCE, - MEDIUM_DIRECT_TOLERANCE, - MEDIUM_DIRECT_TOLERANCE, - MEDIUM_INDIRECT_TOLERANCE, - MEDIUM_INDIRECT_TOLERANCE, + TOLERANCE_THRESHOLDS["MEDIUM_ATE_TOLERANCE"], + TOLERANCE_THRESHOLDS["MEDIUM_DIRECT_TOLERANCE"], + TOLERANCE_THRESHOLDS["MEDIUM_DIRECT_TOLERANCE"], + TOLERANCE_THRESHOLDS["MEDIUM_INDIRECT_TOLERANCE"], + TOLERANCE_THRESHOLDS["MEDIUM_INDIRECT_TOLERANCE"], ] ) LARGE_TOLERANCE = np.array( [ - LARGE_ATE_TOLERANCE, - LARGE_DIRECT_TOLERANCE, - LARGE_DIRECT_TOLERANCE, - LARGE_INDIRECT_TOLERANCE, - LARGE_INDIRECT_TOLERANCE, + TOLERANCE_THRESHOLDS["LARGE_ATE_TOLERANCE"], + TOLERANCE_THRESHOLDS["LARGE_DIRECT_TOLERANCE"], + TOLERANCE_THRESHOLDS["LARGE_DIRECT_TOLERANCE"], + TOLERANCE_THRESHOLDS["LARGE_INDIRECT_TOLERANCE"], + TOLERANCE_THRESHOLDS["LARGE_INDIRECT_TOLERANCE"], ] )