iris
iris copied to clipboard
Catch failed html_repr for cube
In jupyter, if an enhanced repr (such as _repr_html_) fails, the exception is raised but the execution continues, also returning the standard repr. This is useful for noting that there's a problem with the _repr_html_, but very bad for UX (as reflected in #3351).
As such, here we catch exceptions raised by constructing the html repr and explicitly return None so that the default repr is returned instead.
@DPeterK Fancy doing a rebase?
This seems to have gone stale. We still have ambitions for better HTML, particularly given @pp-mo's work turning the Cube summary into actual objects, which would make for much better HTML creation. But that would need a different PR, so I'm going to close this one. @DPeterK feel free to re-open if you disagree.