Spaces:
Configuration error
Configuration error
File size: 3,818 Bytes
bec06d9 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# 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!") |