From f92f32ee7b0cd9753a6999f244cf0143067b289d Mon Sep 17 00:00:00 2001 From: Constantin Pape Date: Fri, 30 Jan 2026 13:22:50 +0100 Subject: [PATCH 1/3] Fix ome ngff schmea location and bump version --- mobie/__version__.py | 2 +- mobie/validation/utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mobie/__version__.py b/mobie/__version__.py index 926ac24..79e25a5 100644 --- a/mobie/__version__.py +++ b/mobie/__version__.py @@ -1,2 +1,2 @@ -__version__ = "0.5.3" +__version__ = "0.5.4" SPEC_VERSION = "0.3.0" diff --git a/mobie/validation/utils.py b/mobie/validation/utils.py index dd008a1..555c5d2 100644 --- a/mobie/validation/utils.py +++ b/mobie/validation/utils.py @@ -13,7 +13,7 @@ "source": "https://raw.githubusercontent.com/mobie/mobie.github.io/master/schema/source.schema.json", "view": "https://raw.githubusercontent.com/mobie/mobie.github.io/master/schema/view.schema.json", "views": "https://raw.githubusercontent.com/mobie/mobie.github.io/master/schema/views.schema.json", - "NGFF": "https://raw.githubusercontent.com/ome/ngff/main/0.4/schemas/image.schema" + "NGFF": "https://raw.githubusercontent.com/ome/ngff/7ac3430c74a66e5bcf53e41c429143172d68c0a4/schemas/image.schema" } From ac336ce43390b1690c54ecb5ebde77749de6309f Mon Sep 17 00:00:00 2001 From: Constantin Pape Date: Fri, 30 Jan 2026 13:42:59 +0100 Subject: [PATCH 2/3] Fix tests --- mobie/import_data/traces.py | 2 +- mobie/xml_utils.py | 2 +- test/import_data/test_image.py | 8 ++++---- test/test_image_data.py | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mobie/import_data/traces.py b/mobie/import_data/traces.py index 5a3b8d3..752d49c 100644 --- a/mobie/import_data/traces.py +++ b/mobie/import_data/traces.py @@ -118,7 +118,7 @@ def traces_to_volume(traces, out_path, key, shape, resolution, chunks, radius, n_threads, crop_overhanging=True): # write temporary h5 dataset # and write coordinates (with some radius) to it - with open_file(out_path) as f: + with open_file(out_path, mode="a") as f: ds = f.require_dataset(key, shape=shape, dtype='int16', compression='gzip', chunks=chunks) ds.n_threads = n_threads diff --git a/mobie/xml_utils.py b/mobie/xml_utils.py index 18d2273..3a90a27 100644 --- a/mobie/xml_utils.py +++ b/mobie/xml_utils.py @@ -123,7 +123,7 @@ def update_xml_transformation_parameter(xml_path, parameter): else: raise ValueError(f"Invalid affine transformation {parameter}") resolution = get_resolution(xml_path, setup_id=0) - if np.product(resolution) != 1: + if np.prod(resolution) != 1: warnings.warn( f"The xml file at {xml_path} has the resolution {resolution}." "The corresponding transformation will be over-written," diff --git a/test/import_data/test_image.py b/test/import_data/test_image.py index c9911d6..57b1ce5 100644 --- a/test/import_data/test_image.py +++ b/test/import_data/test_image.py @@ -92,7 +92,7 @@ def create_h5_input_data(self, shape=3*(64,)): data = np.random.rand(*shape) test_path = os.path.join(self.test_folder, "data-h5.h5") key = "data" - with open_file(test_path) as f: + with open_file(test_path, mode="a") as f: f.create_dataset(key, data=data) return test_path, key, data @@ -108,11 +108,11 @@ def test_import_tif(self): im_folder = os.path.join(self.test_folder, "im-stack") os.makedirs(im_folder, exist_ok=True) - resolution=(0.25, 1, 1) + resolution = (0.25, 1, 1) for z in range(shape[0]): path = os.path.join(im_folder, "z_%03i.tif" % z) - imageio.imsave(path, data[z]) + imageio.imwrite(path, data[z]) scales = [[1, 2, 2], [1, 2, 2], [2, 2, 2]] import_image_data(im_folder, "*.tif", self.out_path, @@ -126,7 +126,7 @@ def test_import_hdf5(self): from mobie.import_data import import_image_data test_path, key, data = self.create_h5_input_data() scales = [[2, 2, 2], [2, 2, 2], [2, 2, 2]] - resolution=(1, 1, 1) + resolution = (1, 1, 1) import_image_data(test_path, key, self.out_path, resolution=resolution, chunks=(32, 32, 32), scale_factors=scales, tmp_folder=self.tmp_folder, diff --git a/test/test_image_data.py b/test/test_image_data.py index 02e20d1..23a15e9 100644 --- a/test/test_image_data.py +++ b/test/test_image_data.py @@ -46,7 +46,7 @@ def make_tif_data(self, im_folder, shape): os.makedirs(im_folder, exist_ok=True) for z in range(shape[0]): path = os.path.join(im_folder, "z_%03i.tif" % z) - imageio.imsave(path, np.random.rand(*shape[1:])) + imageio.imwrite(path, np.random.rand(*shape[1:])) def test_init_from_tif(self): shape = (32, 128, 128) From 29cd45ef376328fb6328b188ad3ed43754f88e08 Mon Sep 17 00:00:00 2001 From: Constantin Pape Date: Fri, 30 Jan 2026 14:17:54 +0100 Subject: [PATCH 3/3] More test fixes --- test/import_data/test_segmentation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/import_data/test_segmentation.py b/test/import_data/test_segmentation.py index 58934e8..ce53da9 100644 --- a/test/import_data/test_segmentation.py +++ b/test/import_data/test_segmentation.py @@ -46,7 +46,7 @@ def test_import_segmentation(self): test_path = os.path.join(self.test_folder, 'data.h5') key = 'data' - with open_file(test_path) as f: + with open_file(test_path, mode="a") as f: f.create_dataset(key, data=data) scales = [[1, 2, 2], [2, 2, 2], [2, 2, 2]]