Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_repr_html_ in Jupyter fails for objects other than ImageWrapper #435

Open
Tom-TBT opened this issue Nov 27, 2024 · 1 comment
Open

_repr_html_ in Jupyter fails for objects other than ImageWrapper #435

Tom-TBT opened this issue Nov 27, 2024 · 1 comment

Comments

@Tom-TBT
Copy link

Tom-TBT commented Nov 27, 2024

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

@jo-mueller
Copy link
Contributor

jo-mueller commented Nov 27, 2024

Hi @Tom-TBT ,

I'm afraid that's something I introduced in a past PR ^^"
I already created a PR (#429) to fix it, but unfortunately it hasn't seen much attention since then 😬

Thanks for bringing it up!

Edit: duplicate of #428

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

No branches or pull requests

2 participants