Thanks to visit codestin.com
Credit goes to github.com

Skip to content

_repr_html_ in Jupyter fails for objects other than ImageWrapper #435

@Tom-TBT

Description

@Tom-TBT

Hello,
working with a recent version of omero-py, there is now a nicer looking output for images.

But for anything else than an image, this produces errors.
The issue in the issue is that they can easily be misinterpreted as mistakes of the user. But the error only comes from _repr_html_ when an object is shown in Jupyter.

image

The issue is that _repr_html_ here is implemented for the class BlitzObjectWrapper, but the function image_to_html only works for images:
https://github.com/ome/omero-py/pull/394/files#diff-a017e360f546e1f25f0118e5c18fd4b4842531636af7903c9c6556309c6d13fbR294-R300

 def _repr_html_(self):
      """
      Returns an HTML representation of the object. This is used by the
      IPython notebook to display the object in a cell.
      """
      return image_to_html(self)

I am in favor of using more HTML representations for other kinds of objects, but we should first fix that issue.

@jo-mueller

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions