Task #2177 (new)
Opened 9 years ago
Last modified 5 years ago
Add callback methods to omero.scripts.client
Reported by: | jamoore | Owned by: | jamoore |
---|---|---|---|
Priority: | critical | Milestone: | Unscheduled |
Component: | Scripting | Version: | 5.0.2 |
Keywords: | n.a. | Cc: | jburel, wmoore, crueden-x |
Resources: | n.a. | Referenced By: | n.a. |
References: | n.a. | Remaining Time: | 0.5d |
Sprint: | n.a. |
Description (last modified by jamoore)
After discussions (Apr 12), scripts should have a mechanism for requesting more information from the user and informing the user about the current status of the script ("0.5% finished", etc.)
This will require work on the notification system (#2169)
Proposal:
mainJobParams = omero.grid.JobParams() mainJobParams.name = "imageProjection" # Name of script mainJobParams.inputs = {"image" : omero.grid.Param(...)} secondaryJobParams = omero.grid.JobParams() secondaryJobParams.name = "z" # Name of step secondaryJobParams.input = {"z" : omero.grid.Param(...)} # Define a script which takes an image c = omero.scripts.client("name",\ mainJobParams, callbacks = [ secondaryJobParams ]) values = c.callback(index=0, timeout = 5) # or values = c.callback(name="z", timeout = 5) c.progress(percent = 0.5, step = "Downloading", index = 5, total = 100) c.exception(exception = ex) # Possible future additions: c.checkpoint() # saves all the session items
Suggestions welcome
See:
- https://www.openmicroscopy.org/community/viewtopic.php?f=6&t=7544 - user using Job.message for status.
Change History (8)
comment:1 Changed 9 years ago by wmoore
comment:2 Changed 9 years ago by jmoore
- Milestone changed from OMERO-Beta4.2 to Unscheduled
- Sprint 2010-04-02 (6) deleted
comment:3 Changed 6 years ago by spli
- Cc crueden-x added; dzmacdonald removed
Out of the tickets in story #1341 this is potentially the most useful for long running scripts, which is what we've settled on for doing feature calculation (at least in the short term). Progress information is almost essential, callbacks for client feedback/choices would make the scripting UI a lot nicer.
CC: Curtis, might be useful for ImageJ work.
comment:4 Changed 6 years ago by jmoore
This needs to be compared with the new(ish) omero.cmd.Handle interface: https://github.com/openmicroscopy/openmicroscopy/blob/v.4.4.6/components/blitz/resources/omero/cmd/API.ice#L89
That may mean that a script need only do (conceptually) getCallback().step(0,10) if a callback has been set.
comment:5 Changed 6 years ago by jamoore
Referencing ticket #1341 has changed sprint.
comment:6 Changed 5 years ago by jamoore
- Description modified (diff)
- Version set to 5.0.2
comment:7 Changed 5 years ago by crueden-x
This is a great idea. We'll be able to implement it easily in ImageJ-OMERO by leaning on the StatusService (and eventually the TaskService), once an API is in place on the OMERO side.
comment:8 Changed 5 years ago by crueden-x
One minor issue to consider is to ensure the progress reporting is lenient -- I can foresee situations with ImageJ plugins where there are bugs in the algorithm's status reporting, or new subtasks get spawned by parent tasks, so progress might appear to go backwards in some cases. As long as there are no assumptions about monotonically increasing progress, it should be fine.
Just saving these ideas from discussion...