From 15711d92708df04ef1074d50d624375dbb506b2d Mon Sep 17 00:00:00 2001 From: Xiao Gui Date: Thu, 24 Oct 2024 09:53:55 +0200 Subject: [PATCH] fix(test): update expected number of images fix(test): preconf bbox ng format should not overwrite clip flag --- e2e/features/image/test_image.py | 52 ++++++++++++++----- e2e/volumes/test_preconfigured_boundingbox.py | 1 - 2 files changed, 38 insertions(+), 15 deletions(-) diff --git a/e2e/features/image/test_image.py b/e2e/features/image/test_image.py index f0b9789b..75c81da3 100644 --- a/e2e/features/image/test_image.py +++ b/e2e/features/image/test_image.py @@ -5,12 +5,40 @@ # Update this as new configs are added results = [ - (siibra.features.get(siibra.get_template("big brain"), "CellbodyStainedSection"), 145), - (siibra.features.get(siibra.get_template("big brain"), "CellBodyStainedVolumeOfInterest"), 2), - (siibra.features.get(siibra.get_template("mni152"), "image", restrict_space=True), 4), - (siibra.features.get(siibra.get_template("mni152"), "image", restrict_space=False), 13), - (siibra.features.get(siibra.get_region('julich 3.1', 'hoc1 left'), "CellbodyStainedSection"), 45), - (siibra.features.get(siibra.get_region('julich 2.9', 'hoc1 left'), "CellbodyStainedSection"), 41) + ( + siibra.features.get(siibra.get_template("big brain"), "CellbodyStainedSection"), + 145, + ), + ( + siibra.features.get( + siibra.get_template("big brain"), "CellBodyStainedVolumeOfInterest" + ), + 2, + ), + ( + siibra.features.get( + siibra.get_template("mni152"), "image", restrict_space=True + ), + 4, + ), + ( + siibra.features.get( + siibra.get_template("mni152"), "image", restrict_space=False + ), + 14, + ), + ( + siibra.features.get( + siibra.get_region("julich 3.1", "hoc1 left"), "CellbodyStainedSection" + ), + 45, + ), + ( + siibra.features.get( + siibra.get_region("julich 2.9", "hoc1 left"), "CellbodyStainedSection" + ), + 41, + ), ] features = [f for fts, _ in results for f in fts] @@ -21,10 +49,7 @@ def test_feature_has_datasets(feature: Image): @pytest.mark.parametrize("features, result_len", results) -def test_image_query_results( - features: Image, - result_len: int -): +def test_image_query_results(features: Image, result_len: int): assert len(features) == result_len @@ -33,7 +58,7 @@ def test_images_datasets_names(): all_ds_names = {ds.name for f in features for ds in f.datasets} end = time.time() duration = start - end - assert len(all_ds_names) == 9, "expected 9 distinct names" + assert len(all_ds_names) == 10, "expected 9 distinct names" assert duration < 1, "Expected getting dataset names to be less than 1s" @@ -41,10 +66,9 @@ def test_color_channel_fetching(): dti_rgb_vol = [ f for f in siibra.features.get( - siibra.get_template('mni152'), - siibra.features.fibres.DTIVolumeOfInterest + siibra.get_template("mni152"), siibra.features.fibres.DTIVolumeOfInterest ) - if 'rgb' in f.name + if "rgb" in f.name ][0] _ = dti_rgb_vol.fetch(channel=0) _ = dti_rgb_vol.fetch(channel=1) diff --git a/e2e/volumes/test_preconfigured_boundingbox.py b/e2e/volumes/test_preconfigured_boundingbox.py index b450b1b7..033da3b3 100644 --- a/e2e/volumes/test_preconfigured_boundingbox.py +++ b/e2e/volumes/test_preconfigured_boundingbox.py @@ -23,7 +23,6 @@ def test_onthefly_and_preconfig_bboxes(volume: Volume, clip_flag: bool): if "neuroglancer/precomputed" in volume.providers: kwargs.update( { - "clip": False, "resolution_mm": -1, "format": "neuroglancer/precomputed", "max_bytes": 2 * 1024**3,