From 2cb887e9e4efd4260a3e37a124a20baad69a89e7 Mon Sep 17 00:00:00 2001 From: Vijay Janapa Reddi Date: Thu, 10 Jul 2025 21:59:14 -0400 Subject: [PATCH] Move py_to_notebook.py to bin/ directory for better organization - Moved tools/py_to_notebook.py to bin/py_to_notebook.py - Updated tito.py to reference the new location - Made py_to_notebook.py executable for direct invocation - Removed empty tools/ directory - Updated documentation to reflect new location - All tools now consolidated in bin/ directory for consistency Benefits: - Conventional organization (bin/ for executables) - Can invoke tools directly: ./bin/py_to_notebook.py - Cleaner project structure - Consistent with other tools (tito.py, generate_student_notebooks.py) --- {tools => bin}/py_to_notebook.py | 4 ++-- bin/tito.py | 2 +- docs/development/module-development-guide.md | 2 +- docs/development/quick-module-reference.md | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) rename {tools => bin}/py_to_notebook.py (95%) mode change 100644 => 100755 diff --git a/tools/py_to_notebook.py b/bin/py_to_notebook.py old mode 100644 new mode 100755 similarity index 95% rename from tools/py_to_notebook.py rename to bin/py_to_notebook.py index 475337aa..61357509 --- a/tools/py_to_notebook.py +++ b/bin/py_to_notebook.py @@ -3,8 +3,8 @@ Convert Python files with cell markers to Jupyter notebooks. Usage: - python3 tools/py_to_notebook.py modules/tensor/tensor_dev.py - python3 tools/py_to_notebook.py modules/tensor/tensor_dev.py --output custom_name.ipynb + python3 bin/py_to_notebook.py modules/tensor/tensor_dev.py + python3 bin/py_to_notebook.py modules/tensor/tensor_dev.py --output custom_name.ipynb """ import argparse diff --git a/bin/tito.py b/bin/tito.py index b41ed294..acd0e737 100755 --- a/bin/tito.py +++ b/bin/tito.py @@ -824,7 +824,7 @@ def cmd_notebooks(args): try: # Use the separate py_to_notebook.py tool result = subprocess.run([ - sys.executable, "tools/py_to_notebook.py", str(dev_file) + sys.executable, "bin/py_to_notebook.py", str(dev_file) ], capture_output=True, text=True) module_name = dev_file.parent.name diff --git a/docs/development/module-development-guide.md b/docs/development/module-development-guide.md index c1bc41f0..25258efc 100644 --- a/docs/development/module-development-guide.md +++ b/docs/development/module-development-guide.md @@ -208,7 +208,7 @@ python bin/tito.py notebooks --module {module} ### Generate Student Version ```bash -python3 bin/generate_student_notebooks.py --module {module} +python bin/generate_student_notebooks.py --module {module} ``` ### Test Complete Workflow diff --git a/docs/development/quick-module-reference.md b/docs/development/quick-module-reference.md index 7af87a1a..41abc9c3 100644 --- a/docs/development/quick-module-reference.md +++ b/docs/development/quick-module-reference.md @@ -106,7 +106,7 @@ cp modules/example/example_dev.py modules/{module}/{module}_dev.py # Full workflow python bin/tito.py notebooks --module {module} -python3 bin/generate_student_notebooks.py --module {module} +python bin/generate_student_notebooks.py --module {module} # Test everything python bin/tito.py test --module {module}