Skip to content

Commit

Permalink
use a dictionary for tolerance thresholds
Browse files Browse the repository at this point in the history
  • Loading branch information
brash6 committed Mar 19, 2024
1 parent 35726c5 commit bab06f3
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions src/med_bench/utils/constants.py
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
import itertools
import os
import numpy as np
from numpy.random import default_rng

# CONSTANTS USED FOR TESTS

# 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"],
]
)

Expand Down

0 comments on commit bab06f3

Please sign in to comment.