Spaces:
Sleeping
Sleeping
Commit ·
be196af
1
Parent(s): 5b886c6
fix image paths
Browse files
tests/test_generate_emr_csv.py
CHANGED
|
@@ -115,7 +115,7 @@ def test_emr_text_quality():
|
|
| 115 |
|
| 116 |
|
| 117 |
def test_image_path_format():
|
| 118 |
-
expected_path = DUMMY_IMAGES_DIR.relative_to(
|
| 119 |
with open(CSV_PATH, newline="") as f:
|
| 120 |
reader = csv.DictReader(f)
|
| 121 |
for row in reader:
|
|
@@ -140,9 +140,15 @@ def test_ambiguous_and_noise_injection():
|
|
| 140 |
if any(noise in text for noise in NOISE_SENTENCES):
|
| 141 |
noise_hits += 1
|
| 142 |
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 146 |
|
| 147 |
|
| 148 |
def test_label_validity():
|
|
|
|
| 115 |
|
| 116 |
|
| 117 |
def test_image_path_format():
|
| 118 |
+
expected_path = DUMMY_IMAGES_DIR.relative_to(DUMMY_IMAGES_DIR.parent) if IS_CI else REAL_IMAGES_DIR.relative_to(REAL_IMAGES_DIR.parent)
|
| 119 |
with open(CSV_PATH, newline="") as f:
|
| 120 |
reader = csv.DictReader(f)
|
| 121 |
for row in reader:
|
|
|
|
| 140 |
if any(noise in text for noise in NOISE_SENTENCES):
|
| 141 |
noise_hits += 1
|
| 142 |
|
| 143 |
+
if IS_CI:
|
| 144 |
+
assert ambiguous_hits >= 1
|
| 145 |
+
assert symptom_hits >= 1
|
| 146 |
+
assert noise_hits >= 1
|
| 147 |
+
|
| 148 |
+
else:
|
| 149 |
+
assert ambiguous_hits > 800, "Ambiguous phrases missing in too many EMRs"
|
| 150 |
+
assert symptom_hits > 800, "Shared symptom clues underrepresented"
|
| 151 |
+
assert noise_hits > 700, "Too few EMRs contain noise sentences"
|
| 152 |
|
| 153 |
|
| 154 |
def test_label_validity():
|
tests/test_triage_dataset.py
CHANGED
|
@@ -18,7 +18,7 @@ IS_CI = os.getenv("CI", "false").lower() == "true"
|
|
| 18 |
# Paths
|
| 19 |
DATA_DIR = BASE_DIR / "data"
|
| 20 |
CSV_PATH = DATA_DIR / ("test_emr_records.csv" if IS_CI else "emr_records.csv")
|
| 21 |
-
IMAGE_DIR = DATA_DIR /
|
| 22 |
EXPECTED_SAMPLES_PER_CLASS = 3 if IS_CI else 300
|
| 23 |
EXPECTED_TOTAL = 3 * 3 if IS_CI else 300 * 3 # 3 classes
|
| 24 |
|
|
|
|
| 18 |
# Paths
|
| 19 |
DATA_DIR = BASE_DIR / "data"
|
| 20 |
CSV_PATH = DATA_DIR / ("test_emr_records.csv" if IS_CI else "emr_records.csv")
|
| 21 |
+
IMAGE_DIR = (DATA_DIR / "dummy_images").resolve() if IS_CI else (DATA_DIR / "images").resolve()
|
| 22 |
EXPECTED_SAMPLES_PER_CLASS = 3 if IS_CI else 300
|
| 23 |
EXPECTED_TOTAL = 3 * 3 if IS_CI else 300 * 3 # 3 classes
|
| 24 |
|