-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from graphbookai/dev
Release v0.5
- Loading branch information
Showing
58 changed files
with
2,542 additions
and
851 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from textwrap import dedent | ||
|
||
|
||
def convert_to_md(docstring: str) -> str: | ||
# docstring = docstring.strip() | ||
docstring = dedent(docstring) | ||
lines = docstring.split("\n") | ||
md = "" | ||
bold_key = False | ||
for line in lines: | ||
if line.strip() == "Args:": | ||
md += "**Parameters**" | ||
bold_key = True | ||
elif line.strip() == "Returns:": | ||
md += "**Returns**" | ||
bold_key = False | ||
elif line.strip() == "Raises:": | ||
md += "**Raises**" | ||
bold_key = False | ||
else: | ||
if bold_key: | ||
entry = line.split(":") | ||
if len(entry) > 1: | ||
key = entry[0].strip() | ||
value = entry[1].strip() | ||
md += f"- **{key}**: {value}" | ||
else: | ||
md += line | ||
md += "\n" | ||
md = md.strip() | ||
|
||
return md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#!/usr/bin/env python | ||
import argparse | ||
from graphbook.web import start_web | ||
import os.path as osp | ||
|
||
DESCRIPTION = """ | ||
Graphbook | ML Workflow Framework | ||
""" | ||
|
||
workflow_dir = "./workflow" | ||
nodes_dir = "custom_nodes" | ||
docs_dir = "docs" | ||
|
||
|
||
def get_args(): | ||
parser = argparse.ArgumentParser( | ||
description=DESCRIPTION, formatter_class=argparse.RawTextHelpFormatter | ||
) | ||
parser.add_argument("--num_workers", type=int, default=1) | ||
parser.add_argument("--continue_on_failure", action="store_true") | ||
parser.add_argument("--copy_outputs", action="store_true") | ||
|
||
# Web subcommand | ||
parser.add_argument("--media_dir", type=str, default="/") | ||
parser.add_argument("--web_dir", type=str) | ||
parser.add_argument("--host", type=str, default="0.0.0.0") | ||
parser.add_argument("--port", type=int, default=8005) | ||
parser.add_argument("--start_media_server", action="store_true") | ||
parser.add_argument("--media_port", type=int, default=8006) | ||
parser.add_argument( | ||
"--root_dir", | ||
type=str, | ||
help="If setting this directory, workflow_dir, nodes_dir, and docs_dir will be ignored", | ||
) | ||
parser.add_argument( | ||
"--workflow_dir", | ||
type=str, | ||
default=workflow_dir, | ||
help="Path to the workflow directory", | ||
) | ||
parser.add_argument( | ||
"--nodes_dir", | ||
type=str, | ||
default=osp.join(workflow_dir, nodes_dir), | ||
help="Path to the custom nodes directory", | ||
) | ||
parser.add_argument( | ||
"--docs_dir", | ||
type=str, | ||
default=osp.join(workflow_dir, docs_dir), | ||
help="Path to the docs directory", | ||
) | ||
|
||
return parser.parse_args() | ||
|
||
|
||
def resolve_paths(args): | ||
if args.root_dir: | ||
args.workflow_dir = args.root_dir | ||
args.nodes_dir = osp.join(args.root_dir, nodes_dir) | ||
args.docs_dir = osp.join(args.root_dir, docs_dir) | ||
return args | ||
|
||
|
||
def main(): | ||
args = get_args() | ||
args = resolve_paths(args) | ||
|
||
start_web(args) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.