From 7e9d0828da14d80b7a4e2f2dd766a68c26aa7edf Mon Sep 17 00:00:00 2001 From: Mathieu Turgeon-Pelchat Date: Fri, 6 Sep 2024 15:25:37 -0400 Subject: [PATCH] tests correction for torchego extract --- tests/test_tiling_segmentation.py | 16 ++++++++-------- tests/test_verify_segmentation.py | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/test_tiling_segmentation.py b/tests/test_tiling_segmentation.py index f6bdf5ce..eca5939f 100644 --- a/tests/test_tiling_segmentation.py +++ b/tests/test_tiling_segmentation.py @@ -19,7 +19,7 @@ def test_outputted_chips(self): data_dir = f"data/patches" proj = f"tiling_output_test" Path(data_dir).mkdir(exist_ok=True, parents=True) - extract_archive(src="tests/data/massachusetts_buildings_kaggle.zip") + extract_archive(from_path="tests/data/massachusetts_buildings_kaggle.zip") cfg = { "general": {"project_name": proj}, "debug": True, @@ -49,7 +49,7 @@ def test_outputted_chips(self): def test_min_annotated_percent_filter(self): """Tests the minimum annotated percent filter""" - extract_archive(src="tests/data/new_brunswick_aerial.zip") + extract_archive(from_path="tests/data/new_brunswick_aerial.zip") data = read_csv("tests/tiling/tiling_segmentation_multiclass_ci.csv") iterator = iter(data) row = next(iterator) @@ -60,8 +60,8 @@ def test_val_percent(self): """Tests the trn/val sorting to ensure the result is close enough to requested val_percent""" data_dir = f"data/patches" Path(data_dir).mkdir(exist_ok=True, parents=True) - extract_archive(src="tests/data/spacenet.zip") - extract_archive(src="tests/data/new_brunswick_aerial.zip") + extract_archive(from_path="tests/data/spacenet.zip") + extract_archive(from_path="tests/data/new_brunswick_aerial.zip") proj_prefix = "test_val_percent" datasets = {"binary-multiband", "multiclass"} results = [] @@ -106,8 +106,8 @@ def test_annot_percent(self): """Tests the minimum annotated percentage to assert ground truth patches with mostly background are rejected""" data_dir = f"data/patches" Path(data_dir).mkdir(exist_ok=True, parents=True) - extract_archive(src="tests/data/spacenet.zip") - extract_archive(src="tests/data/new_brunswick_aerial.zip") + extract_archive(from_path="tests/data/spacenet.zip") + extract_archive(from_path="tests/data/new_brunswick_aerial.zip") proj_prefix = "test_annot_percent" datasets = {"binary-multiband", "multiclass"} results = [] @@ -151,7 +151,7 @@ def test_annot_percent(self): def test_tiling_segmentation_parallel(self): data_dir = "data/patches" Path(data_dir).mkdir(exist_ok=True, parents=True) - extract_archive(src="tests/data/new_brunswick_aerial.zip") + extract_archive(from_path="tests/data/new_brunswick_aerial.zip") proj = "test_parallel" cfg = { "general": {"project_name": proj}, @@ -190,7 +190,7 @@ def test_tiling_inference(self): """Tests tiling of imagery only for inference""" data_dir = "data/patches" Path(data_dir).mkdir(exist_ok=True, parents=True) - extract_archive(src="tests/data/new_brunswick_aerial.zip") + extract_archive(from_path="tests/data/new_brunswick_aerial.zip") project_name = "test_inference" cfg = { "general": {"project_name": project_name}, diff --git a/tests/test_verify_segmentation.py b/tests/test_verify_segmentation.py index 815f528f..78921648 100644 --- a/tests/test_verify_segmentation.py +++ b/tests/test_verify_segmentation.py @@ -11,7 +11,7 @@ class TestVerify(object): def test_verify_per_aoi(self): """Test stats outputs from an AOI""" - extract_archive(src="tests/data/new_brunswick_aerial.zip") + extract_archive(from_path="tests/data/new_brunswick_aerial.zip") data = read_csv("tests/tiling/tiling_segmentation_multiclass_ci.csv") aoi = AOI(raster=data[0]['tif'], label=data[0]['gpkg'], split=data[0]['split']) aoi_dict, error = verify_per_aoi(