Skip to content

Commit

Permalink
Merge pull request #114 from graphbookai/dev
Browse files Browse the repository at this point in the history
Release 0.9
  • Loading branch information
rsamf authored Oct 18, 2024
2 parents 6fd35a8 + 08e7da3 commit 7bebeb0
Show file tree
Hide file tree
Showing 9 changed files with 1,035 additions and 638 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
pipx install poetry
- uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.10'
- name: Build and Publish
run: |
make package
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ jobs:
run: pipx install poetry
- uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.10'
cache: 'poetry'
- name: Build Graphbook Docs
run: |
poetry install --with dev
poetry install --with dev --with peer
poetry run make docs
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
pipx install poetry
- uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.10'
- name: Set up Test PyPI Repository
run: |
poetry config repositories.test-pypi https://test.pypi.org/legacy/
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ENV PATH=$PATH:/root/.local/bin
# Setup app
WORKDIR /app
COPY pyproject.toml poetry.lock ./
RUN poetry install --no-root --no-directory
RUN poetry install --no-root --no-directory --with peer
COPY . .
RUN make web

Expand Down
256 changes: 255 additions & 1 deletion graphbook/sample_assets/SampleWorkflow.json
Original file line number Diff line number Diff line change
@@ -1 +1,255 @@
{"version": "0", "type": "workflow", "nodes": [{"id": "1", "type": "step", "position": {"x": 583.4070722675033, "y": 307.30402857209594}, "data": {"name": "CalcMean", "parameters": {}, "inputs": ["in"], "outputs": ["out"], "category": "", "label": "CalcMean", "key": 31, "isCollapsed": false}, "width": 150, "height": 107, "positionAbsolute": {"x": 583.4070722675033, "y": 307.30402857209594}, "selected": false, "dragging": true}, {"id": "2", "type": "step", "position": {"x": 585.5262378436905, "y": 430.5629360957575}, "data": {"name": "CalcRunningMean", "parameters": {}, "inputs": ["in"], "outputs": ["out"], "category": "", "label": "CalcRunningMean", "key": 32, "isCollapsed": false}, "width": 150, "height": 107, "selected": false, "positionAbsolute": {"x": 585.5262378436905, "y": 430.5629360957575}, "dragging": true}, {"id": "3", "type": "step", "position": {"x": 924.5511397425128, "y": 306.8951569327104}, "data": {"name": "Split", "parameters": {"split_fn": {"type": "resource"}}, "inputs": ["in"], "outputs": ["A", "B"], "category": "Filtering", "label": "Split", "key": 2, "isCollapsed": false}, "width": 150, "height": 120, "selected": false, "positionAbsolute": {"x": 924.5511397425128, "y": 306.8951569327104}, "dragging": true}, {"id": "4", "type": "resource", "position": {"x": 753.7478523416509, "y": 360.9425229173932}, "data": {"name": "Function", "parameters": {"val": {"type": "function", "value": "def split_fn(note):\n return note[\"mean\"] > 0"}}, "category": "Util", "label": "Function", "key": 37, "isCollapsed": true}, "width": 150, "height": 24, "selected": false, "positionAbsolute": {"x": 753.7478523416509, "y": 360.9425229173932}, "dragging": false}, {"id": "7", "type": "step", "position": {"x": 392.76540599258135, "y": 307.35784194806917}, "data": {"name": "Transform", "parameters": {"scale": {"type": "number", "default": 1, "required": true, "description": "Multiplicative factor", "value": 1}, "shift": {"type": "number", "default": 0, "required": true, "description": "Additive factor", "value": 0}}, "inputs": ["in"], "outputs": ["out"], "category": "", "label": "Transform", "key": 22, "isCollapsed": false}, "width": 154, "height": 144, "selected": false, "positionAbsolute": {"x": 392.76540599258135, "y": 307.35784194806917}, "dragging": true}, {"id": "8", "type": "step", "position": {"x": 185, "y": 307.5}, "data": {"name": "GenerateTensors", "parameters": {"num_notes": {"type": "number", "default": 1000, "required": true, "description": "Number of Notes to generate", "value": 1000}}, "inputs": [], "outputs": ["out"], "category": "", "label": "GenerateTensors", "key": 20, "isCollapsed": false}, "width": 175, "height": 127, "selected": false, "positionAbsolute": {"x": 185, "y": 307.5}, "dragging": true}], "edges": [{"source": "4", "sourceHandle": "resource", "target": "3", "targetHandle": "split_fn", "data": {}, "id": "reactflow__edge-4resource-3split_fn", "selected": false}, {"source": "1", "sourceHandle": "out", "target": "3", "targetHandle": "in", "data": {}, "id": "reactflow__edge-1out-3in", "selected": false}, {"source": "7", "sourceHandle": "out", "target": "1", "targetHandle": "in", "data": {}, "id": "reactflow__edge-7out-1in"}, {"source": "7", "sourceHandle": "out", "target": "2", "targetHandle": "in", "data": {}, "id": "reactflow__edge-7out-2in"}, {"source": "8", "sourceHandle": "out", "target": "7", "targetHandle": "in", "data": {}, "id": "reactflow__edge-8out-7in"}]}
{
"version": "0",
"type": "workflow",
"nodes": [
{
"id": "1",
"type": "step",
"position": {
"x": 583.4070722675033,
"y": 307.30402857209594
},
"data": {
"name": "CalcMean",
"parameters": {},
"inputs": [
"in"
],
"outputs": [
"out"
],
"category": "",
"label": "CalcMean",
"key": 31,
"isCollapsed": false
},
"width": 150,
"height": 107,
"positionAbsolute": {
"x": 583.4070722675033,
"y": 307.30402857209594
},
"selected": false,
"dragging": true
},
{
"id": "2",
"type": "step",
"position": {
"x": 585.5262378436905,
"y": 430.5629360957575
},
"data": {
"name": "CalcRunningMean",
"parameters": {},
"inputs": [
"in"
],
"outputs": [
"out"
],
"category": "",
"label": "CalcRunningMean",
"key": 32,
"isCollapsed": false
},
"width": 150,
"height": 107,
"selected": false,
"positionAbsolute": {
"x": 585.5262378436905,
"y": 430.5629360957575
},
"dragging": true
},
{
"id": "3",
"type": "step",
"position": {
"x": 924.5511397425128,
"y": 306.8951569327104
},
"data": {
"name": "Split",
"parameters": {
"split_fn": {
"type": "resource"
}
},
"inputs": [
"in"
],
"outputs": [
"A",
"B"
],
"category": "Filtering",
"label": "Split",
"key": 2,
"isCollapsed": false
},
"width": 150,
"height": 120,
"selected": false,
"positionAbsolute": {
"x": 924.5511397425128,
"y": 306.8951569327104
},
"dragging": true
},
{
"id": "4",
"type": "resource",
"position": {
"x": 753.7478523416509,
"y": 360.9425229173932
},
"data": {
"name": "Function",
"parameters": {
"val": {
"type": "function",
"value": "def split_fn(note):\n return note[\"mean\"] > 0"
}
},
"category": "Util",
"label": "Function",
"key": 37,
"isCollapsed": true
},
"width": 150,
"height": 24,
"selected": false,
"positionAbsolute": {
"x": 753.7478523416509,
"y": 360.9425229173932
},
"dragging": false
},
{
"id": "7",
"type": "step",
"position": {
"x": 392.76540599258135,
"y": 307.35784194806917
},
"data": {
"name": "Transform",
"parameters": {
"scale": {
"type": "number",
"default": 1,
"required": true,
"description": "Multiplicative factor",
"value": 1
},
"shift": {
"type": "number",
"default": 0,
"required": true,
"description": "Additive factor",
"value": 0
}
},
"inputs": [
"in"
],
"outputs": [
"out"
],
"category": "",
"label": "Transform",
"key": 22,
"isCollapsed": false
},
"width": 154,
"height": 144,
"selected": false,
"positionAbsolute": {
"x": 392.76540599258135,
"y": 307.35784194806917
},
"dragging": true
},
{
"id": "8",
"type": "step",
"position": {
"x": 185,
"y": 307.5
},
"data": {
"name": "GenerateTensors",
"parameters": {
"num_notes": {
"type": "number",
"default": 1000,
"required": true,
"description": "Number of Notes to generate",
"value": 20000
}
},
"inputs": [],
"outputs": [
"out"
],
"category": "",
"label": "GenerateTensors",
"key": 20,
"isCollapsed": false
},
"width": 175,
"height": 127,
"selected": false,
"positionAbsolute": {
"x": 185,
"y": 307.5
},
"dragging": true
}
],
"edges": [
{
"source": "4",
"sourceHandle": "resource",
"target": "3",
"targetHandle": "split_fn",
"data": {},
"id": "reactflow__edge-4resource-3split_fn",
"selected": false
},
{
"source": "1",
"sourceHandle": "out",
"target": "3",
"targetHandle": "in",
"data": {},
"id": "reactflow__edge-1out-3in",
"selected": false
},
{
"source": "7",
"sourceHandle": "out",
"target": "1",
"targetHandle": "in",
"data": {},
"id": "reactflow__edge-7out-1in"
},
{
"source": "7",
"sourceHandle": "out",
"target": "2",
"targetHandle": "in",
"data": {},
"id": "reactflow__edge-7out-2in"
},
{
"source": "8",
"sourceHandle": "out",
"target": "7",
"targetHandle": "in",
"data": {},
"id": "reactflow__edge-8out-7in"
}
]
}
17 changes: 1 addition & 16 deletions graphbook/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,6 @@
from graphbook.shm import SharedMemoryManager


try:
import magic
except ImportError:
magic = None
print(
"Warn: Optional libmagic library not found. Filesystem will not be able to determine MIME types."
)


@web.middleware
async def cors_middleware(request: web.Request, handler):
if request.method == "OPTIONS":
Expand Down Expand Up @@ -310,13 +301,7 @@ def get_stat(path):

if not osp.isdir(path):
st["size"] = int(stat.st_size)
if magic is not None:
mime = magic.from_file(path, mime=True)
if mime is None:
mime = "application/octet-stream"
else:
mime = mime.replace(" [ [", "")
st["mime"] = mime

return st

if osp.exists(fullpath):
Expand Down
Loading

0 comments on commit 7bebeb0

Please sign in to comment.