-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add extinfo command #167
base: master
Are you sure you want to change the base?
Add extinfo command #167
Conversation
💯 As a part of this I can imagine wanting to |
|
Interesting... is this a python version thing? I use 3.12.9. |
It could be, I'm on an old env python 3.9.15. |
Yes, looks like it's supported from 3.10 on. As we still recommend 3.9 I'll remove that stuff again. |
src/omero_zarr/extinfo.py
Outdated
select e from ExternalInfo as e | ||
where e.id = :id | ||
""" | ||
extinfo = conn.getQueryService().findByQuery(query, params) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In think this needs to be a cross-group query findByQuery(query, params, conn.SERVICE_OPTS)
otherwise you won't see it if the extinfo isn't in your default group.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still outstanding. Same for the other conn.getQueryService().findByQuery
below too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I do that one line above conn.SERVICE_OPTS.setOmeroGroup("-1")
, is that not enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok, then you have to pass conn.SERVICE_OPTS
that into the function call again. Ok, i'll fix that.
src/omero_zarr/extinfo.py
Outdated
join fetch usedFile.originalFile as f | ||
join fetch f.hasher where image.id = :id | ||
""" | ||
fs = conn.getQueryService().findByQuery(query, params) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cross-group query here too
@@ -108,6 +109,12 @@ | |||
|
|||
POLYGONS_HELP = """Export ROI Polygons on the Image or Plate in zarr format""" | |||
|
|||
EXTINFO_HELP = """Get the ExternalInfo path of an ome.zarr image. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get or set...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get, because that's the default action.
I was trying to test this on a non-zarr image, by specifying the
It seems that there's something strange about |
There's a check if it is a ome.zarr: https://github.com/ome/omero-cli-zarr/pull/167/files#diff-2d64f99479103ff3050c633344ddf895f61491094e9dab65218a3ec17cbfcb59R177 As that's actually only intended to be used with zarr. Otherwise it wouldn't make sense to have it as omero-cli-zarr plugin!? |
The point is that you have a
but it doesn't work for me. Does it work for you? |
ec042a0
to
b379cdf
Compare
a6c74e7
to
e922f47
Compare
3cc6c05
to
ad4a5b2
Compare
hooks: | ||
- id: flake8 | ||
additional_dependencies: [ | ||
flake8-blind-except, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too re-enable, we'll probably need help from @will-moore on knowing what exceptions can be thrown.
flake8-builtins, | ||
flake8-rst-docstrings, | ||
flake8-logging-format, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it broke in Python 3.12: pytest-dev/pytest-testinfra#765
Thanks Josh for fixing the precommit stuff! So this now suppports single image ome.zarrs, multi-series zarrs, and plates. Did I forget another use case? |
src/omero_zarr/extinfo.py
Outdated
""" | ||
if extinfo is not None: | ||
return ( | ||
f"[entityType={_checkNone(extinfo.entityType)}\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: wondering why the [
here and ]
on the line below?
ExternalInfo for image (2856) 438CTR_01_4_R3D_D3D.dv_1:
[entityType=com.glencoesoftware.ngff:multiscales
entityId=3
lsid=test_extinfo_path]
When working with images that are not in your default group, you need to specify the group when saving (and use This is what I have to get
|
That's odd. You have to explicitely set the |
for more information, see https://pre-commit.ci
This command will automatically set the ExternalInfo for ome.zarr images imported using the omero-zarr-pixel-buffer, if the
--set
option is specified. Default is to just print the ExternalInfo.I takes the path from the Fileset "usedFiles", which is assumed to only have one entry
..../SOME.ome.zarr/OME/METADATA.ome.xml
and then set the ExternalInfo lsid to the full path of the multiscale 5d image;..../SOME.ome.zarr/0
for an image..../SOME.ome.zarr/A/1/1
etc. for plates.Limitations: Only works for ome.zarr imported from the filesystem.