From 10a2dc32953cfd140b68d384c8f46f294ce7843d Mon Sep 17 00:00:00 2001 From: ktsitsi Date: Mon, 3 Apr 2023 22:42:44 +0300 Subject: [PATCH 1/2] Fix registration --- tiledb/bioimg/converters/base.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tiledb/bioimg/converters/base.py b/tiledb/bioimg/converters/base.py index 264cf40d..51620cb5 100644 --- a/tiledb/bioimg/converters/base.py +++ b/tiledb/bioimg/converters/base.py @@ -281,8 +281,10 @@ def to_tiledb( ), ) - if register_group is not None and urlparse(output_path).scheme == "tiledb": - register_group(name=os.path.basename(output_path), **register_kwargs) + if register_group is not None and urlparse(output_path).scheme != "tiledb": + # When the scheme is `tiledb` the group has already been registered upon creation + if bool(register_kwargs): + register_group(name=os.path.basename(output_path), **register_kwargs) def _convert_level_to_tiledb( From 43da22eed6466e785548311f2b204ff4533d5d8c Mon Sep 17 00:00:00 2001 From: ktsitsi Date: Wed, 5 Apr 2023 16:37:15 +0300 Subject: [PATCH 2/2] Completely removing post-create registration --- tiledb/bioimg/converters/base.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/tiledb/bioimg/converters/base.py b/tiledb/bioimg/converters/base.py index 51620cb5..4f2b0b9a 100644 --- a/tiledb/bioimg/converters/base.py +++ b/tiledb/bioimg/converters/base.py @@ -1,13 +1,11 @@ from __future__ import annotations import json -import os import warnings from abc import ABC, abstractmethod from concurrent.futures import ThreadPoolExecutor from operator import itemgetter from typing import Any, Dict, Mapping, Optional, Sequence, Tuple, Type, Union -from urllib.parse import urlparse import numpy as np from tqdm import tqdm @@ -173,7 +171,6 @@ def to_tiledb( chunked: bool = False, max_workers: int = 0, compressor: tiledb.Filter = tiledb.ZstdFilter(level=0), - register_kwargs: Mapping[str, Any] = {}, reader_kwargs: Mapping[str, Any] = {}, pyramid_kwargs: Optional[Mapping[str, Any]] = None, ) -> None: @@ -194,8 +191,6 @@ def to_tiledb( :param max_workers: Maximum number of threads that can be used for conversion. Applicable only if chunked=True. :param compressor: TileDB compression filter - :param register_kwargs: Cloud group registration optional args e.g namespace, - parent_uri, storage_uri, credentials_name :param reader_kwargs: Keyword arguments passed to the _ImageReaderType constructor. :param pyramid_kwargs: Keyword arguments passed to the scaler constructor for generating downsampled versions of the base level. Valid keyword arguments are: @@ -281,11 +276,6 @@ def to_tiledb( ), ) - if register_group is not None and urlparse(output_path).scheme != "tiledb": - # When the scheme is `tiledb` the group has already been registered upon creation - if bool(register_kwargs): - register_group(name=os.path.basename(output_path), **register_kwargs) - def _convert_level_to_tiledb( level: int,