Skip to content

Commit

Permalink
dealing with empty image.name returned by showinf in prepare (a…
Browse files Browse the repository at this point in the history
…lso updating dependencies) (#91)

* dealing with empty `image.name`

* fixing the logic for names

* sneaking in some dependency updates
  • Loading branch information
erickmartins authored Sep 14, 2024
1 parent ca15d36 commit 2e13340
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .omeroci/py-setup
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',

Expand Down
8 changes: 6 additions & 2 deletions src/generate_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,15 +613,19 @@ 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 not (image.name.isspace())):
image_name = "0"
else:
image_name = image.name
filename = Path(target).name
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 not (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'
Expand Down

0 comments on commit 2e13340

Please sign in to comment.