-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
We want MolSysView to display automatically in Jupyter when the object is the last expression in a cell, without requiring an explicit .show() call. This is to keep molsysmt.basic.view() returning the MolSysView object (no forced show) while still giving a good notebook UX.
Proposed options:
- Implement
_repr_mimebundle_(or_repr_html_) in MolSysView to delegate toself.show()or return the widget’s mimebundle. This would make MolSysView render automatically when evaluated in a notebook cell. - Alternative: expose a
.widgetattribute and implement__repr__/_ipython_display_to forward to the widget’s display.
Constraints:
- Must not trigger display on object creation (only when evaluated as the last expression).
- Keep
.show()behavior unchanged (first call returns widget, subsequent calls return None). - Do not add extra dependencies.
Expected outcome:
MolSysView renders automatically in Jupyter when it’s the last expression, while still being a plain Python object in scripts.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request