mirror of
https://github.com/MLSysBook/TinyTorch.git
synced 2026-07-21 06:52:26 -05:00
- Ported all commands from bin/tito.py to new tito/ CLI architecture - Added InfoCommand with system info and module status - Added TestCommand with pytest integration - Added DoctorCommand with environment diagnosis - Added SyncCommand for nbdev export functionality - Added ResetCommand for package cleanup - Added JupyterCommand for notebook server - Added NbdevCommand for nbdev development tools - Added SubmitCommand and StatusCommand (placeholders) - Fixed missing imports in tinytorch/core/tensor.py - All commands now work with 'tito' command in shell - Maintains professional architecture while restoring full functionality Commands restored: ✅ info - System information and module status ✅ test - Run module tests with pytest ✅ doctor - Environment diagnosis ✅ sync - Export notebooks to package ✅ reset - Clean tinytorch package ✅ nbdev - nbdev development commands ✅ jupyter - Start Jupyter server ✅ submit - Module submission ✅ status - Module status ✅ notebooks - Build notebooks from Python files The CLI now has both the professional architecture and all original functionality.
33 lines
1.1 KiB
Python
33 lines
1.1 KiB
Python
"""
|
|
Submit command for TinyTorch CLI: submits module for grading.
|
|
"""
|
|
|
|
from argparse import ArgumentParser, Namespace
|
|
from rich.panel import Panel
|
|
from rich.text import Text
|
|
|
|
from .base import BaseCommand
|
|
|
|
class SubmitCommand(BaseCommand):
|
|
@property
|
|
def name(self) -> str:
|
|
return "submit"
|
|
|
|
@property
|
|
def description(self) -> str:
|
|
return "Submit module"
|
|
|
|
def add_arguments(self, parser: ArgumentParser) -> None:
|
|
parser.add_argument("--module", required=True, help="Module to submit")
|
|
|
|
def run(self, args: Namespace) -> int:
|
|
console = self.console
|
|
|
|
submit_text = Text()
|
|
submit_text.append(f"📤 Submitting module: {args.module}\n\n", style="bold cyan")
|
|
submit_text.append("🚧 Submission system not yet implemented.\n\n", style="yellow")
|
|
submit_text.append("For now, make sure all tests pass with:\n", style="dim")
|
|
submit_text.append(f" python -m pytest modules/{args.module}/tests/test_{args.module}.py -v", style="bold white")
|
|
|
|
console.print(Panel(submit_text, title="Module Submission", border_style="bright_yellow"))
|
|
return 0 |