aiida-core icon indicating copy to clipboard operation
aiida-core copied to clipboard

Implement _repr_html_ representation for base orm types

Open danielhollas opened this issue 2 months ago • 2 comments

Pretty-printing ORM objects in jupyter notebooks

Jupyter notebooks / ipython allow objects to define special methods for rich display, see:

https://ipython.readthedocs.io/en/stable/config/integrating.html#rich-display

Specifically, it would be nice to implement HTML representation (_repr_html_) for a nice printing in HTML notebooks. And we could then reuse this in AiiDAlab (which is where my motivation comes from).

Describe the solution you'd like

Display something nicer than this:

image

Describe alternatives you've considered

We could implement this as viewer widgets in aiidalab-widgets-base (and we already do for some types such as Dict) but I don't see a good reason why not integrate it to aiida-core so it can be easily used elsewhere as well.

danielhollas avatar May 02 '24 01:05 danielhollas