yt-project / widgyts

Widgets for yt
https://widgyts.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
10 stars 10 forks source link

Use IPython built-in registration instead of monkey patching #48

Closed matthewturk closed 3 years ago

matthewturk commented 4 years ago

Instead of monkey-patching for display, we should make a registered representation method:

https://ipython.readthedocs.io/en/stable/config/integrating.html#formatters-for-third-party-types

munkm commented 4 years ago

👍 I definitely support this.

matthewturk commented 3 years ago

On reviewing, I'm not sure that this actually will work. It lets you register formatters, but we actually are registering display hooks. We don't want to actually output HTML, but instead widgets, and so I'm not completely sure that it applies. I'd like to see _ipython_display_ get used more for our objects, but this seems to be a different direction.