Skip to content
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

Models Did not Show Up in Workspace #32

Open
yilinxia opened this issue Jan 6, 2023 · 5 comments
Open

Models Did not Show Up in Workspace #32

yilinxia opened this issue Jan 6, 2023 · 5 comments

Comments

@yilinxia
Copy link
Member

yilinxia commented Jan 6, 2023

@matthewturk with creating the editor and the socket_types

import jupyterlab_nodeeditor as jlne
coll = jlne.SocketCollection(socket_types = ('Temperature', 'Rainfall', 'Delta Time', 'Results'))
editor = jlne.NodeEditor(socket_collection=coll)
editor

we start to build the instance with jlne.node_editor.NodeInstanceModel

in1 = jlne.InputSlot(title = "inputA", key = "in_1", sockets = coll,  multi_connection=True)
out1 = jlne.OutputSlot(title = "outputA", key = "out_1", sockets = coll,multi_connection=True)
contrl1=jlne.TextInputControlModel(key = 'my_key', editor = editor.node_editor, initial_value="./src/gs_lesson4_modelA.py")
in2 = jlne.InputSlot(title = "inputB", key = "in_1", sockets = coll,  multi_connection=True)
out2 = jlne.OutputSlot(title = "outputB", key = "out_1", sockets = coll,multi_connection=True)
contrl2=jlne.TextInputControlModel(key = 'my_key', editor = editor.node_editor, initial_value="./src/gs_lesson4_modelB.py")

new_node1=jlne.node_editor.NodeInstanceModel(title="ModelA",inputs=[in1], outputs=[out1], controls=[contrl1])
new_node2=jlne.node_editor.NodeInstanceModel(title="ModelB",inputs=[in2], outputs=[out2], controls=[contrl2])

editor.node_editor.nodes=editor.node_editor.nodes+[new_node1,new_node2]

which supposed to be show up in the interface but it did not

image

@matthewturk
Copy link
Member

@yilinxia Does this only happen on your branch with the yaml file loading? If not, can you provide an example that demonstrates it on the main branch?

@yilinxia
Copy link
Member Author

yilinxia commented Jan 6, 2023

@matthewturk hi matt, I have revised the code above. Sorry for the inconvenience

@matthewturk
Copy link
Member

Thanks! I'm able to replicate.

@matthewturk
Copy link
Member

matthewturk commented Jan 7, 2023

This seems to be the error:

rete.esm.js:1524 Uncaught (in promise) Error: Component ModelA not found
    at EditorView.addNode (rete.esm.js:1524:1)
    at NodeEditor.addNode (rete.esm.js:1759:1)
    at ReteEditorView.updateNodes (widget.js:361:1)
    at v (644.11f638668109f1562dd1.js?v=11f638668109f1562dd1:1:3143)
    at d (644.11f638668109f1562dd1.js?v=11f638668109f1562dd1:1:2817)
    at c (644.11f638668109f1562dd1.js?v=11f638668109f1562dd1:1:740)
    at a.trigger (644.11f638668109f1562dd1.js?v=11f638668109f1562dd1:1:2710)
    at ReteEditorModel.f (595.e3c9c115ecf5763f080b.js?v=e3c9c115ecf5763f080b:1:4257)
    at ReteEditorModel.set (595.e3c9c115ecf5763f080b.js?v=e3c9c115ecf5763f080b:1:9550)
    at ReteEditorModel.set_state (595.e3c9c115ecf5763f080b.js?v=e3c9c115ecf5763f080b:1:8656)

@matthewturk
Copy link
Member

So what I think is happening is that Rete expects that each node instance will be tied to a type of component it knows about. I'm trying to dig deeper in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants