Warning: Can't synchronize with repository "(default)" (/home/git/ome.git does not appear to be a Git repository.). Look in the Trac log for more information.
Notice: In order to edit this ticket you need to be either: a Product Owner, The owner or the reporter of the ticket, or, in case of a Task not yet assigned, a team_member"

Task #8143 (closed)

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

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

I think we should go for:

  • Document that this isn't improper; wrapper objects can't just be passed to omero.client methods

Not sure where omero.client methods are documented?

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?

Note: See TracTickets for help on using tickets. You may also have a look at Agilo extensions to the ticket.

1.3.13-PRO © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.67367 sec.)

We're Hiring!