Commit Graph

101 Commits

Author SHA1 Message Date
Vijay Janapa Reddi
ca8ec10427 Simplify module.yaml and enhance export command with real export targets
- Remove redundant fields from module.yaml files: exports_to, files, components
- Keep only essential system metadata: name, title, description, dependencies
- Export command now reads actual export targets from dev files (#| default_exp directive)
- Status command updated to use dev files as source of truth for export targets
- Export command shows detailed source → target mapping for better clarity
- Dependencies field retained as it's useful for CLI module ordering and prerequisites
- Eliminates duplication between YAML and dev files - dev files are the real truth
2025-07-12 00:05:45 -04:00
Vijay Janapa Reddi
2a4bbc6a09 Rename sync command to export for clarity
- Rename SyncCommand to ExportCommand and sync.py to export.py
- Update all CLI references from 'tito package sync' to 'tito package export'
- Update help text and internal messages to use 'Export' terminology
- Update imports across all command files
- Update help text in main CLI, reset, clean, info, and notebooks commands
- Command now clearly communicates that it exports notebook code to Python package
- Maintains same functionality but with clearer naming for user experience
2025-07-11 23:59:25 -04:00
Vijay Janapa Reddi
72597fbf13 Add difficulty ratings to all module README files
- Add Module Info sections with difficulty ratings to all README.md files
- Use consistent 4-star difficulty scale:  Beginner,  Intermediate,  Advanced,  Expert
- Include time estimates, prerequisites, and next steps for each module
- Maintain clear separation: README.md = student experience, module.yaml = system metadata
- Difficulty progression: Setup () → Tensor/Activations/Layers () → Networks/CNN/DataLoader () → Transformer ()
- Help students plan their learning journey and set appropriate expectations
2025-07-11 23:53:43 -04:00
Vijay Janapa Reddi
74ec7e482c Add module clean command
- Add new CleanCommand for cleaning up module directories
- Supports cleaning notebooks (*.ipynb) and cache files (__pycache__, *.pyc)
- Can clean specific modules or all modules
- Provides preview of files to be cleaned with confirmation
- Includes --force flag to skip confirmation
- Integrates with module command group as 'tito module clean'
- Preserves Python source files (*_dev.py) and other important files
- Fixes issue with duplicate file removal from __pycache__ directories
2025-07-11 23:48:26 -04:00
Vijay Janapa Reddi
71607f70e8 Clean up and modernize documentation
- Remove outdated documentation files (cli-reorganization, command-cleanup-summary, module-metadata-system, testing-separation)
- Update all CLI commands to use current hierarchical structure (tito system/module/package)
- Align documentation with simplified metadata system
- Update student project guide with current module structure
- Modernize development guides and quick reference
- Remove references to removed features (py_to_notebook, complex metadata)
- Ensure all documentation reflects current system state

Documentation now focuses on:
- Current CLI structure and commands
- Simplified module development workflow
- Real data and production patterns
- Clean educational progression
2025-07-11 23:36:33 -04:00
Vijay Janapa Reddi
b2794273f6 Remove redundant py_to_notebook tool in favor of Jupytext
- Delete bin/py_to_notebook.py and tito/tools/py_to_notebook.py
- Update notebooks command to use Jupytext directly
- Jupytext is already configured in all *_dev.py files
- Simpler, more standard workflow using established tools
- Better integration with NBDev ecosystem

Benefits:
- Eliminates duplicate conversion tools
- Uses industry-standard Jupytext instead of custom tool
- Reduces maintenance burden
- Better error handling and compatibility
2025-07-11 23:31:55 -04:00
Vijay Janapa Reddi
3198100eb9 Fix doctor command environment validation
- Skip environment validation for 'tito system doctor' command
- Fix dependency detection in doctor command for packages without __version__
- Doctor command now works correctly and shows comprehensive system diagnosis
2025-07-11 23:28:41 -04:00
Vijay Janapa Reddi
0307662fbc Remove version field from module metadata
- Remove version field from all module.yaml files
- Update template generator to exclude version field
- Further simplify metadata to focus on system information only
- Status remains dynamically determined by test results
2025-07-11 23:23:10 -04:00
Vijay Janapa Reddi
c62515a920 Simplify module metadata to focus on essential system information
- Reduce module.yaml files from 100+ lines to ~25 lines focused on system needs
- Remove pedagogical details (learning objectives, difficulty, time estimates)
- Keep only essential fields: name, title, description, status, dependencies, exports, files, components
- Update status command to work with simplified metadata format
- Update metadata generation script to create simplified templates
- Focus on system metadata for CLI tools and build systems, not educational content

Before: Verbose pedagogical metadata with 20+ fields
After: Concise system metadata with 8 core fields

This aligns with the principle that module.yaml should be for systems, not pedagogy.
2025-07-11 23:02:10 -04:00
Vijay Janapa Reddi
69a51dfe11 Fix doctor command to check for correct CLI script path
- Change doctor command check from 'bin/tito.py' to 'bin/tito'
- The actual CLI script is 'bin/tito' (without .py extension)
- Doctor command now correctly shows CLI script as found instead of missing
- Resolves false positive error in environment diagnosis
2025-07-11 22:57:10 -04:00
Vijay Janapa Reddi
3ba0873979 Clean up CLI by removing legacy flat commands
- Remove legacy flat commands (info, test, sync, etc.) from main parser
- Keep only hierarchical command groups (system, module, package)
- Eliminate confusing positional arguments showing both flat and hierarchical commands
- Update help text to remove references to deprecated commands
- CLI now shows clean 3-command structure: system, module, package
- Old flat commands like 'tito info' now properly error with helpful message
- Maintains all functionality through hierarchical structure:
  - tito info → tito system info
  - tito status → tito module status
  - tito sync → tito package sync

Result: Clean, focused CLI with clear command organization
2025-07-11 22:54:39 -04:00
Vijay Janapa Reddi
391b0a8999 Refactor rules into focused, non-redundant set
- Eliminate redundancy across rule files
- Keep all rules under 500 lines (largest is 187 lines)
- Create focused, actionable rules scoped to specific concerns
- Extract 'Real Data, Real Systems' principles to dedicated file
- Streamline testing patterns to core requirements only
- Fix corrupted development-workflow.mdc file
- Remove duplicate content between files
- Add comprehensive rules overview documentation

Rule organization:
- Core Context: ml-systems-course-context, tinytorch-project-structure, user-preferences
- Development Workflow: development-workflow, git-workflow, cli-patterns
- Module Development: module-development-best-practices, nbdev-educational-pattern, real-data-principles
- Testing: testing-patterns

Each rule is now focused, actionable, and composable without redundancy.
2025-07-11 22:51:49 -04:00
Vijay Janapa Reddi
39a85fb455 Add descriptions to all .cursor/rules files
- Add brief descriptions to YAML frontmatter for all rule files
- Descriptions explain the purpose and content of each rule
- Follow consistent format matching ml-systems-course-context.mdc
- Improve rule discoverability and understanding

Files updated:
- user-preferences.mdc: User preferences and development conventions
- tinytorch-project-structure.mdc: Dual-structure architecture guide
- testing-patterns.mdc: Testing standards with pytest and real data
- nbdev-educational-pattern.mdc: Educational NBDev patterns
- module-development-best-practices.mdc: Real Data, Real Systems principles
- git-workflow.mdc: Git workflow guidelines for incremental commits
- development-workflow.mdc: Complete development workflow with tito CLI
- cli-patterns.mdc: CLI development patterns for tito tool
2025-07-11 22:47:03 -04:00
Vijay Janapa Reddi
466f1f79f4 Implement module metadata system and hierarchical CLI structure
- Add comprehensive module.yaml metadata files for setup, tensor, activations, layers, and autograd modules
- Create module metadata generation script (bin/generate_module_metadata.py)
- Implement hierarchical CLI structure with system/module/package command groups
- Enhance status command with rich metadata display and --metadata flag
- Update module titles to be concise (e.g., 'Autograd' instead of 'Autograd - Automatic Differentiation')
- Maintain backward compatibility with legacy flat CLI commands
- Add comprehensive documentation for module metadata system

Features:
- Rich module metadata with learning objectives, dependencies, and status tracking
- Clear CLI organization: tito system/module/package commands
- Enhanced status reporting with difficulty levels and time estimates
- Automated metadata template generation
- Comprehensive module documentation system
2025-07-11 22:41:50 -04:00
Vijay Janapa Reddi
c5f7a10d5c fix: Use concise module titles instead of verbose ones
- Changed all module titles to be short and clean (e.g., 'Autograd' not 'Autograd - Automatic Differentiation')
- Updated metadata generation template to use concise titles by default
- Fixed CLI reference in metadata generator to use new hierarchical structure
- Titles are now consistent: just the module name capitalized
- Detailed descriptions remain in the description field where they belong
2025-07-11 22:40:30 -04:00
Vijay Janapa Reddi
19bb551004 feat: Reorganize CLI into hierarchical command structure
- Add system, module, and package command groups for clear subsystem separation
- Create SystemCommand, ModuleCommand, and PackageCommand classes
- Maintain backward compatibility with existing flat commands
- Enhanced help system with contextual guidance at each level
- Updated main CLI to show organized command groups
- Added comprehensive documentation for CLI reorganization

New structure:
- tito system (info, doctor, jupyter)
- tito module (status, test, notebooks)
- tito package (sync, reset, nbdev)

Benefits:
- Clear subsystem separation
- Intuitive command discovery
- Better extensibility for future commands
- Reduced cognitive load for users
2025-07-11 22:37:35 -04:00
Vijay Janapa Reddi
341b10969c feat: Add comprehensive module metadata system
- Add module.yaml files for setup, tensor, activations, layers, and autograd modules
- Enhanced tito status command with --metadata flag for rich information display
- Created metadata schema with learning objectives, dependencies, components, and more
- Added metadata generation script (bin/generate_module_metadata.py)
- Comprehensive documentation in docs/development/module-metadata-system.md
- Status command now shows module status, difficulty, time estimates, and detailed metadata
- Supports dependency tracking, component-level status, and educational information
- Enables rich CLI experience with structured module information
2025-07-11 22:33:24 -04:00
Vijay Janapa Reddi
de03be4f70 refactor: Reorganize CLI commands for clear separation of concerns
- Rename 'modules' command to 'status' for intuitive module status checking
- Consolidate all testing functionality into 'test' command:
  - 'tito test --module X' for individual module testing with detailed output
  - 'tito test --all' for all modules with progress bar
  - Remove confusing redirection from test to modules
- Simplify 'info' command to focus on system information and course navigation:
  - Remove module implementation status table (moved to status command)
  - Add quick command reference panel
  - Clean separation between system info and module status
- Update all imports and registrations for renamed command

Result: Clean, intuitive CLI with no duplication:
- 'tito status' → Module development status
- 'tito test' → All testing functionality
- 'tito info' → System info and navigation

No more confusing overlaps or redirections between commands.
2025-07-11 22:25:19 -04:00
Vijay Janapa Reddi
39a04bbe65 feat: Add modules command and clean up CLI duplication
- Add new 'tito modules' command for comprehensive module status checking
  - Scans all modules in modules/ directory automatically
  - Shows file structure (dev file, tests, README)
  - Runs tests with --test flag
  - Provides detailed breakdown with --details flag

- Remove duplicate/stub commands:
  - Remove 'tito status' (unimplemented stub)
  - Remove 'tito submit' (unimplemented stub)

- Update 'tito test' command:
  - Focus on individual module testing with detailed output
  - Redirect 'tito test --all' to 'tito modules --test' with recommendation
  - Better error handling with available modules list

- Add comprehensive documentation:
  - docs/development/testing-separation.md - explains module vs package checking
  - docs/development/command-cleanup-summary.md - documents CLI cleanup

Key benefit: Clear separation between module development status (tito modules)
and TinyTorch package functionality (tito info) with no confusing overlaps.
2025-07-11 22:14:53 -04:00
Vijay Janapa Reddi
a3f8487357 fix: update status checks to focus on functionality over module organization
- Fix Networks and MLP status checks to use actual available components
- Networks: test Sequential composition with layers
- MLP: test multi-layer perceptron using Sequential + Dense + ReLU
- CNN: simplified test for convolution concepts
- Focus on functional capabilities rather than specific package organization

This addresses the fundamental issue that status checks were trying to match
pedagogical module organization with production package structure.
2025-07-11 22:02:17 -04:00
Vijay Janapa Reddi
10a4969abd fix: correct DataLoader status check in CLI
- Fix CLI test to use Tensor objects instead of raw integers
- DataLoader now correctly shows as  Implemented in status
- Test creates proper Tensor data for DataLoader compatibility
2025-07-11 21:56:19 -04:00
Vijay Janapa Reddi
5cafca003c docs: update documentation for dataloader module rename
- Update module → package mapping in pedagogy/vision.md
- Update project guide module references
- Update cursor rules for testing patterns
- Update all documentation paths and references

Ensures all documentation is consistent with the new module name.
2025-07-11 18:59:33 -04:00
Vijay Janapa Reddi
c7a82b400c feat: update CLI tools for dataloader module
- Update valid modules list in test command: data → dataloader
- Update module display name in info command: Data → DataLoader
- Update CLI references to use new module name
- All CLI commands now recognize 'dataloader' instead of 'data'

Ensures CLI tools work seamlessly with the renamed module.
2025-07-11 18:59:19 -04:00
Vijay Janapa Reddi
7c2b98a2b9 refactor: rename data module to dataloader
- Rename modules/data/ → modules/dataloader/
- Rename data_dev.py → dataloader_dev.py
- Update NBDev export target: core.data → core.dataloader
- Rename test files: test_data.py → test_dataloader.py
- Update package exports to tinytorch.core.dataloader
- Update module imports and internal references

This makes the module name more descriptive and aligned with ML industry standards.
2025-07-11 18:59:09 -04:00
Vijay Janapa Reddi
a1a3e0f9e4 Add test timeouts and local test data for data module
- Added pytest-timeout configuration with 5-minute timeout for all tests
- Added timeout handling to test command with proper error messages
- Created small local test dataset (50 train + 20 test samples) that mimics CIFAR-10 structure
- Updated data module tests to use local test data instead of downloading CIFAR-10
- Tests now run much faster (~0.1s vs ~30s) and don't require internet connection
- Added TestCIFAR10Dataset class that loads from local pickle files
- All test functionality preserved but using local data for speed and reliability
2025-07-11 18:50:05 -04:00
Vijay Janapa Reddi
f2529d9497 Fix blocking plt.show() calls during testing
- Fixed plt.show() call in data module to respect _should_show_plots() check
- Protected test code that calls visualization functions in data module
- Protected test code that calls visualization functions in networks module
- All visualization functions now properly skip during testing
- Tests should no longer block waiting for user interaction
2025-07-11 18:44:34 -04:00
Vijay Janapa Reddi
121287fc39 Adds module development documentation
Introduces documentation for TinyTorch module development, including guides for developers and AI assistants.

Provides comprehensive resources for creating high-quality, educational modules, focusing on real-world applications and systems thinking.
2025-07-11 18:38:48 -04:00
Vijay Janapa Reddi
53fb514918 Evolve pedagogical framework: Build → Use → [Engage] patterns
- Updated pedagogical principles with refined engagement patterns:
  - Build → Use → Reflect (design & systems thinking)
  - Build → Use → Analyze (technical depth & debugging)
  - Build → Use → Optimize (systems iteration & performance)

- Added pattern selection guide for module developers
- Updated development workflow to choose pattern first
- Created specific module assignments for each pattern
- Enhanced quick reference with pattern-specific activities

This evolution moves beyond passive 'understanding' to active,
specific engagement that matches professional ML engineering skills.
2025-07-11 18:37:00 -04:00
Vijay Janapa Reddi
576ed42a41 Implements neural network architectures module
Initializes the networks module, enabling the composition of layers into complete neural network architectures.

It introduces sequential networks, MLP creation, and network visualization tools to facilitate architecture understanding and analysis.

Adds practical classification and regression network implementations and network behavior analysis capabilities.
2025-07-11 15:30:21 -04:00
Vijay Janapa Reddi
dcbdcc55f9 Implements activation functions
Adds ReLU, Sigmoid, and Tanh activation functions, enabling
non-linearity in neural networks.

Includes testing and visualization of each function to ensure
correct behavior and understanding of their properties.
2025-07-11 15:25:27 -04:00
Vijay Janapa Reddi
ec71669519 Implements 2D Convolutional Neural Network module
Introduces a comprehensive module for 2D Convolutional Neural Networks.

This module provides a foundational understanding of CNNs through:
- Implementation of a naive Conv2D layer with sliding window convolution
- Visualization of kernel operations and feature map construction
- Composition of Conv2D layers with other layers to build a simple ConvNet

This structure provides a step-by-step guide to building and understanding CNNs, with clear examples and tests.
2025-07-11 15:21:58 -04:00
Vijay Janapa Reddi
fa918d9643 Implements core neural network layers
This commit introduces the core building blocks for neural networks,
including a naive matrix multiplication implementation and a Dense layer.

It provides a foundation for constructing and experimenting with
neural networks, emphasizing the concept of layers as tensor
transformations and function composition.

The module includes thorough testing and performance comparisons
to demonstrate the importance of optimized operations.
2025-07-11 15:07:54 -04:00
Vijay Janapa Reddi
7b08bcaace Adds initial Tensor class implementation
Implements the core Tensor class with data handling and properties, including initialization, shape, size, dtype, and string representation.

Adds element-wise addition and multiplication functions for tensors.

Implements tensor addition and multiplication as methods within the Tensor class.
2025-07-11 15:01:28 -04:00
Vijay Janapa Reddi
70209631d3 Adds educational pattern for TinyTorch
Defines the structure and guidelines for creating educational modules in TinyTorch using NBDev.

This includes file format, key NBDev directives, educational structure, implementation guidance, testing, naming conventions, and educational principles to promote effective learning.
2025-07-11 15:01:20 -04:00
Vijay Janapa Reddi
fbea010cdb Improves clarity in CNN notebook
Enhances the notebook by replacing some unicode characters with more standard and universally compatible symbols, improving the overall readability and user experience.
2025-07-11 15:01:16 -04:00
Vijay Janapa Reddi
eebb22ebdb feat: Add consistent 'Where This Code Lives' template across modules
- Add template section to tensor, layers, activations, and cnn modules
- Create docs/development/module-template.md for future reference
- Clarify learning vs building structure consistently
- Show students where their code will live in the final package
- Decouple learning modules from production organization
2025-07-10 23:48:49 -04:00
Vijay Janapa Reddi
38cac60aff feat: Scaffold CNN module for students
- Add cnn_dev.py with NBDev educational pattern, Conv2D for-loop TODO, and all scaffolding
- Add README.md explaining learning goals, what is implemented vs provided, and rationale
- Add tests/test_cnn.py for basic correctness and shape tests
- Generate cnn_dev.ipynb for notebook workflow
2025-07-10 23:34:35 -04:00
Vijay Janapa Reddi
c483426008 docs: Clarify MLP is a use case, not a fundamental module; remove empty mlp/ dir
- Added note to Networks README explaining MLP is a pattern of composition, not a new primitive
- Removed empty modules/mlp/ directory for clarity
2025-07-10 23:29:47 -04:00
Vijay Janapa Reddi
0ee3efd45e feat: Add matrix multiplication scaffolding to Layers module
- Add matmul_naive function with for-loop implementation for learning
- Update Dense layer to support both NumPy (@) and naive matrix multiplication
- Add comprehensive tests comparing both implementations (correctness & performance)
- Include step-by-step computation visualization for 2x2 matrices
- Fix missing imports in tensor.py and activations.py
- Export both tensor and activations modules to package

This provides students with immediate success using NumPy while allowing them to
understand the underlying computation through explicit for-loops. The scaffolding
includes performance comparisons and educational insights about why NumPy is faster.
2025-07-10 23:27:02 -04:00
Vijay Janapa Reddi
b155dec4fc feat: add Networks module with forward-pass and visualizations
- Add modules/networks/networks_dev.py and networks_dev.ipynb (Jupytext/nbdev educational pattern)
- Add comprehensive visualizations: architecture, data flow, layer analysis, network comparison
- Add modules/networks/README.md with learning goals, usage, and visualization docs
- Add modules/networks/tests/test_networks.py with thorough tests for composition, MLPs, and visualizations
- Register 'networks' in CLI info and test commands
- Update CLI info command to check layers/networks status
- This module focuses on forward pass only (no training yet)
2025-07-10 23:16:12 -04:00
Vijay Janapa Reddi
62aace8718 cleanup: remove empty tinytorch package directories
- Remove 14 empty/unused directories from tinytorch/ package
- Keep only essential directories: core/, datasets/, configs/
- All directories removed contained only empty __init__.py files or were completely empty
- CLI functionality preserved and tested working
- Cleaner package structure for development
2025-07-10 22:59:32 -04:00
Vijay Janapa Reddi
553d6e6d8b cleanup: remove redundant files and directories
- Delete _proc/ directory (duplicate of modules/ with processed files)
- Delete bin/tito.py (old CLI implementation, replaced by tito/ structure)
- Delete temporary log files (tito-cli.log, tinytorch-cli.log)
- Update bin/tito wrapper to use new CLI structure
- All CLI functionality preserved with new architecture
2025-07-10 22:58:22 -04:00
Vijay Janapa Reddi
a8b5055a57 RULES: Optimize Cursor rules for better AI guidance
- Updated git-workflow.mdc with proper metadata and focused content
- Updated development-workflow.mdc with proper metadata
- Added cli-patterns.mdc for CLI development best practices
- Followed Cursor's best practices: focused, actionable, scoped
- Added proper globs for auto-attachment to relevant files
- Improved rule descriptions for better AI context

Key improvements:
- Proper metadata structure with description, globs, alwaysApply
- Focused content under 500 lines per rule
- Concrete examples and patterns
- Clear, actionable guidance for AI
- Better scoping for when rules should apply
2025-07-10 22:45:52 -04:00
Vijay Janapa Reddi
e85fb97b64 DOCS: Add Git workflow guidelines for incremental commits
- Created comprehensive Git workflow guidelines for ad-hoc development
- Focus on small, focused commits for easy reverts
- Added practical examples for different development scenarios
- Updated development workflow to reference new Git guidelines
- Updated CLI commands to use 'tito' instead of 'python bin/tito.py'
- Includes commit message format, branch strategies, and revert procedures

Key principles:
- Incremental commits for easy reverts
- Test before committing to avoid broken commits
- Use feature branches for larger changes
- Descriptive commit messages that explain what changed
2025-07-10 22:44:23 -04:00
Vijay Janapa Reddi
15f5a84863 RESTORE: Complete CLI functionality in new architecture
- 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.
2025-07-10 22:39:23 -04:00
Vijay Janapa Reddi
a92a5530ef MAJOR: Separate CLI from framework - proper architectural separation
BREAKING CHANGE: CLI moved from tinytorch/cli/ to tito/

Perfect Senior Engineer Architecture:
- tinytorch/ = Pure ML framework (production)
- tito/ = Development/management CLI tool
- modules/ = Educational content

Benefits:
 Clean separation of concerns
 Framework stays lightweight (no CLI dependencies)
 Clear mental model for users
 Professional project organization
 Proper dependency management

Structure:
tinytorch/          # 🧠 Core ML Framework
├── core/          # Tensors, layers, operations
├── training/      # Training loops, optimizers
├── models/        # Model architectures
└── ...           # Pure ML functionality

tito/              # 🔧 Development CLI Tool
├── main.py        # CLI entry point
├── core/          # CLI configuration & console
├── commands/      # Command implementations
└── tools/         # CLI utilities

Key Changes:
- Moved all CLI code from tinytorch/cli/ to tito/
- Updated imports and entry points
- Separated dependencies (Rich only for dev tools)
- Updated documentation to reflect proper separation
- Maintained backward compatibility with bin/tito wrapper

This demonstrates how senior engineers separate:
- Production code (framework) from development tools (CLI)
- Core functionality from management utilities
- User-facing APIs from internal tooling

Educational Value:
- Shows proper software architecture
- Teaches separation of concerns
- Demonstrates dependency management
- Models real-world project organization
2025-07-10 22:08:56 -04:00
Vijay Janapa Reddi
13eb0e4009 Add comprehensive CLI architecture documentation
- Documents senior-level design patterns and principles
- Explains Command Pattern, Dependency Injection, and other patterns
- Shows testing strategies and extensibility approach
- Provides examples for developers and users
- Demonstrates professional software engineering practices
2025-07-10 22:05:56 -04:00
Vijay Janapa Reddi
05379c8570 Refactor CLI to senior software engineer standards
BREAKING CHANGE: Major architectural refactoring of CLI system

New Professional Architecture:
- Clean separation of concerns with proper package structure
- Command pattern implementation with base classes
- Centralized configuration management
- Proper exception hierarchy and error handling
- Logging framework integration
- Type hints throughout
- Dependency injection pattern

Structure:
tinytorch/cli/
├── __init__.py              # Package initialization
├── main.py                  # Professional CLI entry point
├── core/                    # Core CLI functionality
│   ├── __init__.py
│   ├── config.py           # Configuration management
│   ├── console.py          # Centralized console output
│   └── exceptions.py       # Exception hierarchy
├── commands/               # Command implementations
│   ├── __init__.py
│   ├── base.py            # Base command class
│   └── notebooks.py       # Notebooks command
└── tools/                 # CLI tools
    ├── __init__.py
    └── py_to_notebook.py  # Conversion tool

Features Added:
- Proper entry points in pyproject.toml
- Professional logging with file output
- Environment validation with detailed error messages
- Dry-run mode for notebooks command
- Force rebuild option
- Timeout protection for subprocess calls
- Backward compatibility wrapper (bin/tito)
- Extensible command registration system

Benefits:
- Maintainable: Single responsibility per module
- Testable: Clean interfaces and dependency injection
- Extensible: Easy to add new commands
- Professional: Industry-standard patterns
- Robust: Proper error handling and validation
- Installable: Proper package structure with entry points
2025-07-10 22:05:10 -04:00
Vijay Janapa Reddi
2cb887e9e4 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)
2025-07-10 21:59:14 -04:00
Vijay Janapa Reddi
82defeafd3 Refactor notebook generation to use separate files for better architecture
- Restored tools/py_to_notebook.py as a focused, standalone tool
- Updated tito notebooks command to use subprocess to call the separate tool
- Maintains clean separation of concerns: tito.py for CLI orchestration, py_to_notebook.py for conversion logic
- Updated documentation to use 'tito notebooks' command instead of direct tool calls
- Benefits: easier debugging, better maintainability, focused single-responsibility modules
2025-07-10 21:57:09 -04:00