Docker_Deploy / src /python /validate_chapter.py
Shaheryar Shah
Add backend files for RAG Chatbot Docker deployment
bec06d9
# Validation script for Physical AI Chapter
import os
def validate_chapter():
print("Validating Physical AI Chapter Implementation")
print("="*50)
# Check chapter content exists
chapter_path = "C:/Users/Shaheryar Gen AI/Desktop/Hackthone/Book/docs/01-physical-ai/index.md"
if os.path.exists(chapter_path):
with open(chapter_path, 'r', encoding='utf-8') as f:
content = f.read()
print(f"[OK] Chapter content exists: {len(content)} characters")
# Check for key sections
if "Physical AI & Embodied Intelligence" in content:
print("[OK] Chapter title found")
if "Perception-Action Loop" in content:
print("[OK] Key concept (Perception-Action Loop) found")
if "Summary" in content and "Key Vocabulary" in content:
print("[OK] Chapter summary and vocabulary found")
else:
print("[ERROR] Chapter content missing")
return False
# Check diagrams
img_dir = "C:/Users/Shaheryar Gen AI/Desktop/Hackthone/Book/static/img/physical-ai/"
if os.path.exists(img_dir):
images = os.listdir(img_dir)
print(f"[OK] Diagrams directory exists with {len(images)} images: {images}")
else:
print("[ERROR] Diagrams directory missing")
return False
# Check code examples
code_dir = "C:/Users/Shaheryar Gen AI/Desktop/Hackthone/Book/static/code/physical-ai/"
if os.path.exists(code_dir):
code_files = os.listdir(code_dir)
print(f"[OK] Code examples directory exists with {len(code_files)} files: {code_files}")
else:
print("[ERROR] Code examples directory missing")
return False
# Check lab exercise
lab_path = "C:/Users/Shaheryar Gen AI/Desktop/Hackthone/Book/docs/01-physical-ai/lab-exercise.md"
if os.path.exists(lab_path):
print("[OK] Lab exercise exists")
else:
print("[ERROR] Lab exercise missing")
return False
# Check assessment questions
question_path = "C:/Users/Shaheryar Gen AI/Desktop/Hackthone/Book/static/questions/physical-ai/questions.md"
if os.path.exists(question_path):
with open(question_path, 'r', encoding='utf-8') as f:
q_content = f.read()
print(f"[OK] Assessment questions exist: {len(q_content)} characters")
if "Multiple Choice" in q_content:
print("[OK] Multiple choice questions found")
if "Short Answer" in q_content:
print("[OK] Short answer questions found")
else:
print("[ERROR] Assessment questions missing")
return False
# Check navigation in sidebar
sidebar_path = "C:/Users/Shaheryar Gen AI/Desktop/Hackthone/Book/sidebars.js"
if os.path.exists(sidebar_path):
with open(sidebar_path, 'r', encoding='utf-8') as f:
sidebar_content = f.read()
if "01-physical-ai/index" in sidebar_content:
print("[OK] Navigation entry found in sidebar")
else:
print("[ERROR] Navigation entry missing from sidebar")
return False
else:
print("[ERROR] Sidebar file missing")
return False
print("\n[OK] All validations passed! Physical AI Chapter is complete.")
print("\nChapter Structure:")
print("- Theoretical concepts with mathematical foundations")
print("- Practical code examples")
print("- Hands-on lab exercise")
print("- Visual diagrams")
print("- Assessment questions")
print("- Proper navigation in Docusaurus sidebar")
return True
if __name__ == "__main__":
success = validate_chapter()
if success:
print("\nChapter implementation successfully validated!")
else:
print("\nValidation failed!")