From faae666d2a27c35aed64398824fdf6af8ea64fae Mon Sep 17 00:00:00 2001 From: Christopher Rhodes <christopher.rhodes@embl.de> Date: Fri, 29 Sep 2023 14:26:03 +0200 Subject: [PATCH] Removed success flag, which was non-informative and causing problems when no boxes were sent for export --- extensions/chaeo/products.py | 4 ++-- extensions/chaeo/tests/test_zstack.py | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/extensions/chaeo/products.py b/extensions/chaeo/products.py index 88d8f3fa..d2a372b0 100644 --- a/extensions/chaeo/products.py +++ b/extensions/chaeo/products.py @@ -77,6 +77,6 @@ def export_patches_from_zstack( ext = 'tif' if make_3d else 'png' fname = f'{prefix}-la{obj.label:04d}-zi{obj.zi:04d}.{ext}' - success = _write_patch_to_file(where, fname, resample_to_8bit(patch)) + _write_patch_to_file(where, fname, resample_to_8bit(patch)) exported.append(fname) - return success, exported + return exported diff --git a/extensions/chaeo/tests/test_zstack.py b/extensions/chaeo/tests/test_zstack.py index 8ea85d79..6c398d24 100644 --- a/extensions/chaeo/tests/test_zstack.py +++ b/extensions/chaeo/tests/test_zstack.py @@ -67,13 +67,12 @@ class TestZStackDerivedDataProducts(unittest.TestCase): filters={'area': (1e3, 1e4)}, expand_box_by=(64, 2) ) - success, files = export_patches_from_zstack( + files = export_patches_from_zstack( output_path / '2d_patches', self.stack.get_one_channel_data(channel=1), meta, draw_bounding_box=True, ) - self.assertTrue(success) self.assertGreaterEqual(len(files), 1) def test_make_3d_patches_from_zmask(self): @@ -81,11 +80,10 @@ class TestZStackDerivedDataProducts(unittest.TestCase): filters={'area': (1e3, 1e4)}, expand_box_by=(64, 2), ) - success, files = export_patches_from_zstack( + files = export_patches_from_zstack( output_path / '3d_patches', self.stack.get_one_channel_data(channel=1), meta, make_3d=True) - self.assertTrue(success) self.assertGreaterEqual(len(files), 1) -- GitLab