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"

Bug #1245 (closed)

Opened 15 years ago

Closed 15 years ago

Not importing omero first leads to strange OmeroPy errors

Reported by: jamoore Owned by: jamoore
Priority: major Cc: cblackburn, carlos@…, jburel
Sprint: n.a.
Total Remaining Time: n.a.

Description

from omero_model_ImageI import ImageI as ImageI

print ImageI.NAME
print ImageI.DATASETLINKS                     

leads to the following error:

python OmeroClients/staticfields.py --Ice.Config=/Users/josh/GlencoeSoftware.git/git/omero.git/dist/etc/ice.config
Traceback (most recent call last):
  File "OmeroClients/staticfields.py", line 1, in <module>
    from omero_model_ImageI import ImageI as ImageI
  File "/Users/josh/GlencoeSoftware.git/git/omero.git/dist/lib/python/omero_model_ImageI.py", line 13, in <module>
    from omero.rtypes import rlong
ImportError: No module named rtypes
scons: *** [OmeroClients/staticfields.py] Error 1

Change History (8)

comment:1 Changed 15 years ago by jmoore

  • Summary changed from Not importing omero first to Not importing omero first leads to strange OmeroPy errors

comment:2 Changed 15 years ago by jmoore

Carlos, would adding all = rtypes? solve this?

comment:3 Changed 15 years ago by jmoore

  • Cc jburel added
  • Milestone changed from Unscheduled to OMERO-Beta4.1

A fix for this might also include other issues:

  • import omero shouldn't report PIL warnings (too much imported)
  • #1392 (too little imported)

comment:4 Changed 15 years ago by jmoore

After the addition of numpy and pytables imports (r4833 et al), several things broken (including bin/omero help !). import omero imports too much. This can be fixed by moving the client class to omero/clients.py (or similar), but how much user usage does this break?

For example:

import omero
omero.model.FooI()

won't work.

import omero
c = omero.client("localhost")
omero.model.FooI()

will.

import omero.clients
omero.model.FooI()

also works.

We could alternatively offer something like:

import omero_all # or similar

which does the whole startup, but it will need to be clear.

comment:5 Changed 15 years ago by jmoore

r4898. Doesn't yet include import omero_all, but does include import omero.clients

comment:6 Changed 15 years ago by cneves

r5480 moved UnloadedEntityException? and UnloadedCollectionException? back to the omero namespace, reverting that change from r4898 because that's where omero classes expect it to be.

comment:7 Changed 15 years ago by jmoore

comment:8 Changed 15 years ago by jmoore

  • Resolution set to fixed
  • Status changed from new to closed

The various commits have stopped the recursion, but in future releases (especially 4.2 with #1359) we will need to work on usability. E.g., sage uses:

 from sage.all import *
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.84936 sec.)

We're Hiring!