Task #8143 (closed)
Bug/Doc: confusion over passing object wrappers
Reported by: | jamoore | Owned by: | wmoore |
---|---|---|---|
Priority: | major | Milestone: | OMERO-4.4.7 |
Component: | OmeroPy | Version: | n.a. |
Keywords: | n.a. | Cc: | python-team@… |
Resources: | n.a. | Referenced By: | n.a. |
References: | n.a. | Remaining Time: | n.a. |
Sprint: | n.a. |
Description
I'm not sure if this should count as a documentation issue or if we need to handle it at the API level, but there is some confusion now over how to pass objects to various methods.
First, see: https://www.openmicroscopy.org/community/viewtopic.php?f=6&t=1047
The problem is that BK has an original file wrapper from conn.getObject, and then passes it to conn.c.download. download expects an omero.model.IObject instead of a wrapper.
A few ways of handling it:
- Document that this isn't improper; wrapper objects can't just be passed to omero.client methods
- Duplicate all omero.client methods which handle the unwrapping of the wrappers
- Wrap the internal omero.client with a decorator that detects the wrappers and unwraps them.
Change History (4)
comment:1 Changed 12 years ago by wmoore
- Milestone changed from OMERO-Beta4.4 to OMERO-Beta4.4.1
comment:2 Changed 12 years ago by wmoore
- Resolution set to invalid
- Status changed from new to closed
I think the confusion in the case above is due to the use of conn.c methods when using the Blitz Gateway. I think that the functionality required (in the forum post) is actually supported by Blitz Gateway methods. If there are other methods of the underlying client object that are generally useful to users of the Blitz Gateway then we should expose them on the Blitz Gateway itself.
comment:3 Changed 12 years ago by jmoore
Will: where is the work for exposing those methods then tracked if not here?
comment:4 Changed 12 years ago by wmoore
We currently have these methods on Blitz Gateway for upload from local files (using rawFileStore):
def createOriginalFileFromLocalFile (self, localPath, origFilePathAndName=None, mimetype=None, ns=None) def createFileAnnfromLocalFile (self, localPath, origFilePathAndName=None, mimetype=None, ns=None, desc=None): def createOriginalFileFromFileObj (self, fo, path, name, fileSize, mimetype=None, ns=None):
And both FileAnnotationWrapper? and OriginalFileWrapper? use rawFileStore to provide:
def getFileInChunks(self, buf=2621440)
These don't use conn.c.upload / download. Would we get some benefit from using these under the hood?
Not sure where omero.client methods are documented?