From 581c0ae30a46b4fed689e7400edea985e9dfec49 Mon Sep 17 00:00:00 2001 From: Erick Martins Ratamero Date: Wed, 11 Sep 2024 09:38:25 -0400 Subject: [PATCH 1/3] dealing with empty `image.name` --- src/generate_xml.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/generate_xml.py b/src/generate_xml.py index 1444c29..7bb707d 100644 --- a/src/generate_xml.py +++ b/src/generate_xml.py @@ -613,7 +613,7 @@ def parse_showinf(text, counter_imgs, counter_plates, counter_ann, img_ref[image.id] = img_id_str pix = create_empty_pixels(image, img_id) if len(ome.images) > 1: # differentiating names - if image.name == "": + if not (image.name and image.name.isspace()): image_name = "0" else: image_name = image.name @@ -621,7 +621,11 @@ def parse_showinf(text, counter_imgs, counter_plates, counter_ann, img = Image(id=img_id_str, name=filename + " [" + image_name + "]", pixels=pix) else: - img = Image(id=img_id_str, name=image.name, pixels=pix) + if not (image.name and image.name.isspace()): + image_name = os.path.split(target)[1] + else: + image_name = image.name + img = Image(id=img_id_str, name=image_name, pixels=pix) img_id += 1 xml = create_path_xml(target) ns = 'openmicroscopy.org/cli/transfer' From 5523d5e7e6afb007db3492defd1209dbcae38d6d Mon Sep 17 00:00:00 2001 From: Erick Martins Ratamero Date: Wed, 11 Sep 2024 13:23:07 -0400 Subject: [PATCH 2/3] fixing the logic for names --- .omeroci/py-setup | 2 +- src/generate_xml.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.omeroci/py-setup b/.omeroci/py-setup index 17b2c08..4a8d2ca 100755 --- a/.omeroci/py-setup +++ b/.omeroci/py-setup @@ -19,7 +19,7 @@ conda init conda create -n omero python=3.9 conda activate omero pip install https://github.com/glencoesoftware/zeroc-ice-py-linux-x86_64/releases/download/20231130/zeroc_ice-3.6.5-cp39-cp39-manylinux_2_28_x86_64.whl -conda install -c bioconda bftools +conda install -y -c bioconda bftools pip install pytest restview mox3 cd $TARGET diff --git a/src/generate_xml.py b/src/generate_xml.py index 7bb707d..6af8e2d 100644 --- a/src/generate_xml.py +++ b/src/generate_xml.py @@ -613,7 +613,7 @@ def parse_showinf(text, counter_imgs, counter_plates, counter_ann, img_ref[image.id] = img_id_str pix = create_empty_pixels(image, img_id) if len(ome.images) > 1: # differentiating names - if not (image.name and image.name.isspace()): + if not (image.name and not (image.name.isspace())): image_name = "0" else: image_name = image.name @@ -621,7 +621,7 @@ def parse_showinf(text, counter_imgs, counter_plates, counter_ann, img = Image(id=img_id_str, name=filename + " [" + image_name + "]", pixels=pix) else: - if not (image.name and image.name.isspace()): + if not (image.name and not (image.name.isspace())): image_name = os.path.split(target)[1] else: image_name = image.name From a9c532946bfd1afc39c3854c145fe5661586374e Mon Sep 17 00:00:00 2001 From: Erick Martins Ratamero Date: Wed, 11 Sep 2024 15:02:57 -0400 Subject: [PATCH 3/3] sneaking in some dependency updates --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 21bdb3f..5f6a8a6 100755 --- a/setup.py +++ b/setup.py @@ -34,11 +34,11 @@ def read(fname): long_description_content_type="text/markdown", url="https://github.com/TheJacksonLaboratory/omero-cli-transfer", install_requires=[ - 'ezomero>=2.1.0, <3.0.0', + 'ezomero>=3.0.0, <4.0.0', 'ome-types==0.5.1.post1' ], extras_require={ - "rocrate": ["rocrate==0.7.0"], + "rocrate": ["rocrate>=0.7.0, <1.0.0"], }, python_requires='>=3.8',