You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking for a way to add the functionality to save/restore ipywidget state using nteract widget manager.
See the following implementation of set_state() in jupyter-widget and it needs _get_comm_info() but _get_comm_info() is not implemented in nteract.
My question is, can nteract add _get_comm_info implementation?
<set_state() in jupyter-widget>
set_state(state: IManagerState): Promise<WidgetModel[]> {
// Check to make sure that it's the same version we are parsing.
if (!(state.version_major && state.version_major <= 2)) {
throw 'Unsupported widget state format';
}
const models = state.state as any;
// Recreate all the widget models for the given widget manager state.
const all_models = this._get_comm_info().then((live_comms) => {
/* Note: It is currently safe to just loop over the models in any order,
given that the following holds (does at the time of writing):
1: any call to new_model with state registers the model promise (e.g. with register_model)
synchronously (before it's first await statement).
2: any calls to a model constructor or the set_state method on a model,
happens asynchronously (in a then clause, or after an await statement).
Without these assumptions, one risks trying to set model state with a reference
to another model that doesn't exist yet!
*/
<_get_comm_info() in nteract>
_get_comm_info(): Promise<{}> {
throw new Error("_get_comm_info is not implemented!");
}
The text was updated successfully, but these errors were encountered:
This felt oddly familiar so I took a look at this and noticed we had previously filed nteract/nteract#4675.
It looks like the lack of a __get_comm_info implementation was intentional based on the previous design and the way that that the ipywidgets implementation interacts with the state.
Was there a particular motivation for filing this issue?
Looking for a way to add the functionality to save/restore ipywidget state using nteract widget manager.
See the following implementation of set_state() in jupyter-widget and it needs _get_comm_info() but _get_comm_info() is not implemented in nteract.
My question is, can nteract add _get_comm_info implementation?
<set_state() in jupyter-widget>
set_state(state: IManagerState): Promise<WidgetModel[]> {
// Check to make sure that it's the same version we are parsing.
if (!(state.version_major && state.version_major <= 2)) {
throw 'Unsupported widget state format';
}
const models = state.state as any;
// Recreate all the widget models for the given widget manager state.
const all_models = this._get_comm_info().then((live_comms) => {
/* Note: It is currently safe to just loop over the models in any order,
given that the following holds (does at the time of writing):
1: any call to
new_model
with state registers the model promise (e.g. withregister_model
)synchronously (before it's first
await
statement).2: any calls to a model constructor or the
set_state
method on a model,happens asynchronously (in a
then
clause, or after anawait
statement).Without these assumptions, one risks trying to set model state with a reference
to another model that doesn't exist yet!
*/
<_get_comm_info() in nteract>
_get_comm_info(): Promise<{}> {
throw new Error("_get_comm_info is not implemented!");
}
The text was updated successfully, but these errors were encountered: