We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Bug summary
Cannot pickle ipycytoscape graph
Code for reproduction
ex_json = { "nodes": [ {"data": {"id": 0, "name": "A"}}, {"data": {"id": 1, "name": "B"}}, {"data": {"id": 2, "name": "C"}} ], "edges": [ {"data": {"id": 3, "source": 0, "target": 1}}, {"data": {"id": 4, "source": 0, "target": 2}}, ] } import ipycytoscape cyto = ipycytoscape.CytoscapeWidget() cyto.graph.add_graph_from_json(ex_json) # pickling code in "actual outcome" section below
Actual outcome
# import pickle # pickle.dumps(cyto) # PicklingError: Can't pickle <function <lambda> at 0x7fb6da6009d0>: attribute lookup <lambda> on jupyter_client.session failed # pickle.dumps(cyto.graph) # AttributeError: Can't pickle local object 'Mutable.instance_init.<locals>.callback' # pickle.dumps(cyto.graph.nodes[0]) # PicklingError: Can't pickle <function <lambda> at 0x7fb6da6009d0>: attribute lookup <lambda> on jupyter_client.session failed #pickle.dumps(cyto.graph.edges[0]) # PicklingError: Can't pickle <function <lambda> at 0x7fb6da6009d0>: attribute lookup <lambda> on jupyter_client.session failed #import dill #dill.dumps(cyto.graph.nodes[0]) # TypeError: cannot pickle '_hashlib.HASH' object #import cloudpickle #cloudpickle.dumps(cyto.graph.nodes[0]) # TypeError: cannot pickle '_hashlib.HASH' object
Expected outcome
Result of pickle
Version Info
import ipycytoscape; print(ipycytoscape.__version__)
!jupyter --version Selected Jupyter core packages... IPython : 7.27.0 ipykernel : 6.4.1 ipywidgets : 7.6.5 jupyter_client : 6.1.12 jupyter_core : 4.8.1 jupyter_server : 1.11.0 jupyterlab : not installed nbclient : 0.5.4 nbconvert : 6.1.0 nbformat : 5.1.3 notebook : 6.4.4 qtconsole : not installed traitlets : 5.1.0
The text was updated successfully, but these errors were encountered:
It's not possible to pickle a widget object, this probably needs to be solved upstream.
Sorry, something went wrong.
Ok, linking here for reference: jupyter-widgets/ipywidgets#2879
Thanks for pointing it to the right direction peeps. I personally didn't know that.
No branches or pull requests
Bug report
Bug summary
Cannot pickle ipycytoscape graph
Code for reproduction
Actual outcome
Expected outcome
Result of pickle
Version Info
import ipycytoscape; print(ipycytoscape.__version__)
) : 1.2.2The text was updated successfully, but these errors were encountered: