Spaces:
Running
Running
Update NetworkX demo to be error-free. Sort keys in workspaces. Autoformat some files.
Browse files- examples/AIMO +1 -1
- examples/Graph RAG +1 -1
- examples/Image processing +1 -1
- examples/LynxScribe demo +1 -1
- examples/NetworkX demo +0 -0
- examples/PyTorch demo +1 -1
- examples/RAG chatbot app +1 -1
- lynxkite-app/web/src/workspace/nodes/NodeWithTableView.tsx +1 -1
- lynxkite-core/pyproject.toml +1 -1
- lynxkite-core/src/lynxkite/core/workspace.py +3 -1
- lynxkite-core/tests/test_ops.py +3 -1
- lynxkite-graph-analytics/src/lynxkite_graph_analytics/pytorch_model_ops.py +1 -1
examples/AIMO
CHANGED
|
@@ -1036,4 +1036,4 @@
|
|
| 1036 |
"targetHandle": "input"
|
| 1037 |
}
|
| 1038 |
]
|
| 1039 |
-
}
|
|
|
|
| 1036 |
"targetHandle": "input"
|
| 1037 |
}
|
| 1038 |
]
|
| 1039 |
+
}
|
examples/Graph RAG
CHANGED
|
@@ -872,4 +872,4 @@
|
|
| 872 |
"targetHandle": "edges"
|
| 873 |
}
|
| 874 |
]
|
| 875 |
-
}
|
|
|
|
| 872 |
"targetHandle": "edges"
|
| 873 |
}
|
| 874 |
]
|
| 875 |
+
}
|
examples/Image processing
CHANGED
|
@@ -281,4 +281,4 @@
|
|
| 281 |
"targetHandle": "image"
|
| 282 |
}
|
| 283 |
]
|
| 284 |
-
}
|
|
|
|
| 281 |
"targetHandle": "image"
|
| 282 |
}
|
| 283 |
]
|
| 284 |
+
}
|
examples/LynxScribe demo
CHANGED
|
@@ -966,4 +966,4 @@
|
|
| 966 |
"targetHandle": "chat_api"
|
| 967 |
}
|
| 968 |
]
|
| 969 |
-
}
|
|
|
|
| 966 |
"targetHandle": "chat_api"
|
| 967 |
}
|
| 968 |
]
|
| 969 |
+
}
|
examples/NetworkX demo
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
examples/PyTorch demo
CHANGED
|
@@ -620,4 +620,4 @@
|
|
| 620 |
"targetHandle": "x"
|
| 621 |
}
|
| 622 |
]
|
| 623 |
-
}
|
|
|
|
| 620 |
"targetHandle": "x"
|
| 621 |
}
|
| 622 |
]
|
| 623 |
+
}
|
examples/RAG chatbot app
CHANGED
|
@@ -605,4 +605,4 @@
|
|
| 605 |
"targetHandle": "rag_graph"
|
| 606 |
}
|
| 607 |
]
|
| 608 |
-
}
|
|
|
|
| 605 |
"targetHandle": "rag_graph"
|
| 606 |
}
|
| 607 |
]
|
| 608 |
+
}
|
lynxkite-app/web/src/workspace/nodes/NodeWithTableView.tsx
CHANGED
|
@@ -19,7 +19,7 @@ export default function NodeWithTableView(props: any) {
|
|
| 19 |
const display = props.data.display?.value;
|
| 20 |
const single =
|
| 21 |
display?.dataframes && Object.keys(display?.dataframes).length === 1;
|
| 22 |
-
const dfs = Object.entries(display
|
| 23 |
dfs.sort();
|
| 24 |
return (
|
| 25 |
<LynxKiteNode {...props}>
|
|
|
|
| 19 |
const display = props.data.display?.value;
|
| 20 |
const single =
|
| 21 |
display?.dataframes && Object.keys(display?.dataframes).length === 1;
|
| 22 |
+
const dfs = Object.entries(display?.dataframes || {});
|
| 23 |
dfs.sort();
|
| 24 |
return (
|
| 25 |
<LynxKiteNode {...props}>
|
lynxkite-core/pyproject.toml
CHANGED
|
@@ -10,4 +10,4 @@ dependencies = [
|
|
| 10 |
[project.optional-dependencies]
|
| 11 |
dev = [
|
| 12 |
"pytest",
|
| 13 |
-
]
|
|
|
|
| 10 |
[project.optional-dependencies]
|
| 11 |
dev = [
|
| 12 |
"pytest",
|
| 13 |
+
]
|
lynxkite-core/src/lynxkite/core/workspace.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
"""For working with LynxKite workspaces."""
|
| 2 |
|
|
|
|
| 3 |
from typing import Optional
|
| 4 |
import dataclasses
|
| 5 |
import os
|
|
@@ -65,7 +66,8 @@ async def execute(ws: Workspace):
|
|
| 65 |
|
| 66 |
def save(ws: Workspace, path: str):
|
| 67 |
"""Persist a workspace to a local file in JSON format."""
|
| 68 |
-
j = ws.
|
|
|
|
| 69 |
dirname, basename = os.path.split(path)
|
| 70 |
os.makedirs(dirname, exist_ok=True)
|
| 71 |
# Create temp file in the same directory to make sure it's on the same filesystem.
|
|
|
|
| 1 |
"""For working with LynxKite workspaces."""
|
| 2 |
|
| 3 |
+
import json
|
| 4 |
from typing import Optional
|
| 5 |
import dataclasses
|
| 6 |
import os
|
|
|
|
| 66 |
|
| 67 |
def save(ws: Workspace, path: str):
|
| 68 |
"""Persist a workspace to a local file in JSON format."""
|
| 69 |
+
j = ws.model_dump()
|
| 70 |
+
j = json.dumps(j, indent=2, sort_keys=True) + "\n"
|
| 71 |
dirname, basename = os.path.split(path)
|
| 72 |
os.makedirs(dirname, exist_ok=True)
|
| 73 |
# Create temp file in the same directory to make sure it's on the same filesystem.
|
lynxkite-core/tests/test_ops.py
CHANGED
|
@@ -76,7 +76,9 @@ def test_op_decorator_with_complex_types():
|
|
| 76 |
assert complex_op.__op__.inputs == {
|
| 77 |
"color": ops.Input(name="color", type=Color, position="left"),
|
| 78 |
"color_list": ops.Input(name="color_list", type=list[Color], position="left"),
|
| 79 |
-
"color_dict": ops.Input(
|
|
|
|
|
|
|
| 80 |
}
|
| 81 |
assert complex_op.__op__.type == "basic"
|
| 82 |
assert complex_op.__op__.outputs == {
|
|
|
|
| 76 |
assert complex_op.__op__.inputs == {
|
| 77 |
"color": ops.Input(name="color", type=Color, position="left"),
|
| 78 |
"color_list": ops.Input(name="color_list", type=list[Color], position="left"),
|
| 79 |
+
"color_dict": ops.Input(
|
| 80 |
+
name="color_dict", type=dict[str, Color], position="left"
|
| 81 |
+
),
|
| 82 |
}
|
| 83 |
assert complex_op.__op__.type == "basic"
|
| 84 |
assert complex_op.__op__.outputs == {
|
lynxkite-graph-analytics/src/lynxkite_graph_analytics/pytorch_model_ops.py
CHANGED
|
@@ -72,4 +72,4 @@ ops.register_passive_op(
|
|
| 72 |
inputs=[ops.Input(name="input", position="top", type="tensor")],
|
| 73 |
outputs=[ops.Output(name="output", position="bottom", type="tensor")],
|
| 74 |
params=[ops.Parameter.basic("times", 1, int)],
|
| 75 |
-
)
|
|
|
|
| 72 |
inputs=[ops.Input(name="input", position="top", type="tensor")],
|
| 73 |
outputs=[ops.Output(name="output", position="bottom", type="tensor")],
|
| 74 |
params=[ops.Parameter.basic("times", 1, int)],
|
| 75 |
+
)
|