Skip to content

Commit 468fbec

Browse files
committed
Verify file creation for preprocessing
1 parent 1067982 commit 468fbec

5 files changed

Lines changed: 13 additions & 4 deletions

File tree

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
.DS_Store
2+
23
tests/TCGA-MR-A520-01Z-00-DX1.2F323BAC-56C9-4A0C-9C1B-2B4F776056B4.svs
4+
35
tests/inputs/21_5_mask.pkl
46
tests/inputs/21_5.zarr
7+
tests/patch_information.db
8+
9+
tests/output.pkl
10+
tests/output_zarr.zarr
511

612
# Byte-compiled / optimized / DLL files
713
__pycache__/

patch_information.db

-12 KB
Binary file not shown.

tests/inputs/21_5.npy

733 KB
Binary file not shown.

tests/inputs/21_5_mask.npy

977 KB
Binary file not shown.

tests/test_utils.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ def test_preprocessing_pipeline():
3131
tests_dir = get_tests_dir()
3232
npy_file = join(tests_dir, "inputs/21_5.npy")
3333
npy_mask = join(tests_dir, "inputs/21_5_mask.npy")
34-
out_zarr = join(tests_dir, "inputs/21_5.zarr")
35-
out_pkl = join(tests_dir, "inputs/21_5_mask.pkl")
34+
out_zarr = join(tests_dir, "output_zarr.zarr")
35+
out_pkl = join(tests_dir, "output.pkl")
3636

3737
utils.run_preprocessing_pipeline(
3838
npy_file, npy_mask=npy_mask, out_zarr=out_zarr, out_pkl=out_pkl
@@ -45,7 +45,6 @@ def test_preprocessing_pipeline():
4545
from numpy import load as load_numpy
4646

4747
img = zarr_to_da(open_zarr(out_zarr)).compute()
48-
4948
assert array_equal(img, load_numpy(npy_file))
5049

5150
def capture(command):
@@ -58,10 +57,11 @@ def capture(command):
5857
out, err = proc.communicate()
5958
return out, err, proc.returncode
6059

60+
odb = join(tests_dir, "patch_information.db")
6161
command = [
6262
"poetry", "run", "pathflowai-preprocess",
6363
"preprocess-pipeline",
64-
"-odb", "patch_information.db",
64+
"-odb", odb,
6565
"--preprocess",
6666
"--patches",
6767
"--basename", "21_5",
@@ -72,4 +72,7 @@ def capture(command):
7272
"-t", "0.05"
7373
]
7474
out, err, exitcode = capture(command)
75+
assert exists(out_zarr)
76+
assert exists(out_pkl)
77+
assert exists(odb)
7578
assert exitcode == 0

0 commit comments

Comments
 (0)