Skip to content

jupyter.widget.control update_states schema #3685

Open
@AntoinePrv

Description

@AntoinePrv

Problem

According to the Control Widget messaging protocol, kernels should reply to request_states request with a message like

{
  'comm_id' : 'u-u-i-d',
  'data' : {
    'method': 'update_states',
    'states': {
      <widget1 u-u-i-d>: <widget1 state>,
      <widget2 u-u-i-d>: <widget2 state>,
      [...]
    },
    'buffer_paths': [ <list with paths corresponding to the binary buffers> ]
  }

But it is unclear what <widget1 state> is. Intuitively, it looks like this would be some dictionary like

{
    "some_property": "some_value",
    [...]
}

However, from the IPyWidgets implementation, and from trying to implement this protocol for XWidget, it looks like the <widget1 state> should rather be:

{
    "model_name": "...",
    "model_module": "...",
    "model_module_version": "...",
    "state": {
        "some_property": "some_value",
        [...]
    }
}

Suggested Improvement

It looks like the actual implementation has redundant information that exists in the state's _model_name.
But the point here is rather to clarify what is the expected schema, and possibly adapt the documentation,

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions