Files
TinyTorch/nbgrader_config.py
Vijay Janapa Reddi f1d47330b3 Simplify export workflow: remove module_paths.txt, use dynamic discovery
- Remove unnecessary module_paths.txt file for cleaner architecture
- Update export command to discover modules dynamically from modules/source/
- Simplify nbdev command to support --all and module-specific exports
- Use single source of truth: nbdev settings.ini for module paths
- Clean up import structure in setup module for proper nbdev export
- Maintain clean separation between module discovery and export logic

This implements a proper software engineering approach with:
- Single source of truth (settings.ini)
- Dynamic discovery (no hardcoded paths)
- Clean CLI interface (tito package nbdev --export [--all|module])
- Robust error handling with helpful feedback
2025-07-12 17:19:22 -04:00

57 lines
1.9 KiB
Python

# NBGrader Configuration for TinyTorch ML Systems Course
c = get_config()
# Course Information
c.CourseDirectory.course_id = "tinytorch-ml-systems"
# Directory Structure
c.CourseDirectory.source_directory = "modules/source"
c.CourseDirectory.release_directory = "modules/release"
c.CourseDirectory.submitted_directory = "modules/submitted"
c.CourseDirectory.autograded_directory = "modules/autograded"
c.CourseDirectory.feedback_directory = "modules/feedback"
# Solution Removal Configuration
c.ClearSolutions.code_stub = {
"python": "# YOUR CODE HERE\nraise NotImplementedError()"
}
# Text Stub for written responses
c.ClearSolutions.text_stub = "YOUR ANSWER HERE"
c.ClearSolutions.begin_solution_delimeter = "### BEGIN SOLUTION"
c.ClearSolutions.end_solution_delimeter = "### END SOLUTION"
c.ClearSolutions.begin_text_delimeter = "### BEGIN TEXT SOLUTION"
c.ClearSolutions.end_text_delimeter = "### END TEXT SOLUTION"
# Enforce Metadata (require proper cell metadata for grading)
c.ClearSolutions.enforce_metadata = True
# Validation Configuration
c.Validate.ignore_checksums = False
# Logging Configuration
c.NbGrader.log_level = "INFO"
# Assignment and Student Configuration
c.AssignApp.generate_unique_ids = True # Ensure uniqueness of cell IDs
c.AssignApp.create_assignment = True
# Autograder Configuration
c.AutogradeApp.update = True # Update existing autograded notebooks
c.AutogradeApp.create = True # Create new entries if they don't exist
# Feedback Configuration
c.FeedbackApp.generate_feedback = True
c.FeedbackApp.output_dir = "modules/feedback"
# Student IDs (optional: helps when testing locally or in custom workflows)
c.Gradebook.db_url = "sqlite:///gradebook.db"
# Hide hidden test cells in release notebooks
c.ClearSolutions.remove_hidden_tests = True
# Set default language for code cells (if mixed notebooks used)
c.ClearSolutions.language = "python"