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
[BUGFIX] Serialization logic - additional fixes. #1420
Conversation
…display api unification;
if file is None: | ||
file = 'output.html' | ||
if isinstance(file, str): | ||
file = create_new_file_name(file) | ||
|
||
if as_widget is True: | ||
widget_to_html( | ||
widget=self.to_widget(unique_id=output_id), | ||
widget=self.to_widget(unique_id=unique_id or get_random_string(n=25)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why the change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
previously output_id
was declared above if file is None:
now I just replaced it with one statement/
it means that if a user did not pass a unique_id
we need to generate it by ourselves in order to make sure that navigation links will be rendered
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check.show doesn't work in jupyter lab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check.show doesn't work in jupyter lab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did a mistake while checking :)
resolves #1392 but contains much more modifications
List of changes:
== 1 ==
added a new type of serialization protocol, called
IPythonSerializer
.Serializers that implement this kind of protocol must return a list of objects that implements
IPython.core.formatters
traits.For more info please refer to the IPython documentation
We need this type of protocol in order to make sure that the check/suite result display works properly in different environments like JupyterLab/Classical Notebooks, especially when widgets are not enabled or not supported.
== 2 ==
added
display_check
,show
,save_as_html
methods to theCheckFailure
type.== 3 ==
now, 'Widgets UI' is also used in the colab env.