Skip to content

Fix and docs#29

Merged
sbesson merged 6 commits intoome:masterfrom
dominikl:fix_and_docs
May 29, 2019
Merged

Fix and docs#29
sbesson merged 6 commits intoome:masterfrom
dominikl:fix_and_docs

Conversation

@dominikl
Copy link
Member

@dominikl dominikl commented Feb 26, 2019

  • Make sure rendering engines are closed (set command). I wonder if that caused the render plugin to fall over if it was running repeatedly for a long time reusing the same session.
  • Simplify the copy command implementation a bit (was unnecessarily split over three different methods).
  • Improve the docs a little bit.

"Updated rendering settings for Image:%s" % img.id)
if not args.skipthumbs:
self._generate_thumbs([img])
img._closeRE()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, big 👍 for closing services, but:

  • if this needs to be here, probably best in a try/finally
  • I wonder though why your gateway_require decorators isn't handling this

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that the decorator will handle the closing of the gateway and its services at the end of the command. But I do not see anything here or in the gateway that would close each rendering enging within the loop.

As noticed by @dominikl and myself, this becomes especially important when using bin/omero render set against a large collection of objects e.g. a plate or a screen.

Copy link
Member

@sbesson sbesson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionally tested against a plate with 308 wells with 30 fields of view each. Without this PR, bin/omero render set Plate:<id> render.yml fails with an OOM after a number of iterations. With it included, the rendering generation is progressing steadily.

I would concur with #29 (comment). The only addition I would propose would be to have the rendering engine closed in a try/finally block. Once done, I propose we get this merged and tagged as a patch release.

or 0 if it cannot be determined.
"""
Returns the version of the rendering settings format.
Npte: Previously min/max was used to set the channel window start/end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

img._closeRE()
try:
img._closeRE()
except Exception as e:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@will-moore does _closeRE() handle exceptions internally?

In addition, I think the question of #29 (comment) was to handle any exception thrown in the previous calls e.g. in img.saveDefaults() to ensure the service would be closed

    try:
        ...
        img.saveDefaults()
        ...
    finally:
        img._closeRE()

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you actually know that saveDefaults() can throw an exception? I'll still find it unbelievabe difficult to do use the cli and/or BlitzGatway methods. E.g. https://downloads.openmicroscopy.org/omero/5.4.10/api/python/omero/omero.gateway.html#omero.gateway._ImageWrapper.saveDefaults doesn't mention any exception, it doesn't even say anything about what the method actually does.

@sbesson
Copy link
Member

sbesson commented May 29, 2019

Thanks @dominikl. Merging and releasing as 0.4.3 so that we can start consuming it as we render plates.

@sbesson sbesson merged commit dfa380a into ome:master May 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants