Skip to content

Commit 97af81c

Browse files
committed
more sims
1 parent 80c1254 commit 97af81c

File tree

8 files changed

+1624
-702
lines changed

8 files changed

+1624
-702
lines changed

workshops/2025-07-16/CLAUDE.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
## Testing Commands
5555

5656
• Generate notebook: `uv run python hack/walkthroughgen_py.py hack/walkthrough_python.yaml -o hack/test.ipynb`
57-
• Test locally: `uv run python hack/test_notebook.py hack/test.ipynb`
5857
• Full Colab sim: `cd hack && ./test_notebook_colab_sim.sh`
5958
• Run BAML tests: `baml-cli test` (from directory with baml_src)
6059

@@ -64,6 +63,5 @@
6463
`walkthrough/*.baml` - BAML files fetched from GitHub during notebook execution
6564
`hack/walkthroughgen_py.py` - Main conversion tool
6665
`hack/walkthrough_python.yaml` - Notebook definition with all chapters
67-
`hack/test_notebook.py` - Local testing script (skips pip/baml-cli init)
6866
`hack/test_notebook_colab_sim.sh` - Full Colab environment simulation
6967
`hack/workshop_final.ipynb` - Final generated notebook ready for workshop

workshops/2025-07-16/hack/test_baml_logging.ipynb

Lines changed: 0 additions & 279 deletions
This file was deleted.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/usr/bin/env python3
2+
"""Test script to verify BAML logging capture."""
3+
4+
import os
5+
import sys
6+
from contextlib import redirect_stderr
7+
from io import StringIO
8+
9+
# Set BAML log level
10+
os.environ['BAML_LOG'] = 'info'
11+
12+
print("Testing BAML logging capture methods...")
13+
print("=" * 60)
14+
15+
# Method 1: Using sys.stderr redirection
16+
print("\nMethod 1: Direct stderr redirection")
17+
old_stderr = sys.stderr
18+
sys.stderr = sys.stdout
19+
20+
# Simulate BAML logging to stderr
21+
print("This would be a BAML log message", file=old_stderr)
22+
print("BAML logs should appear here if redirected properly")
23+
24+
# Restore stderr
25+
sys.stderr = old_stderr
26+
27+
# Method 2: Using context manager
28+
print("\nMethod 2: Context manager with StringIO")
29+
stderr_capture = StringIO()
30+
31+
with redirect_stderr(stderr_capture):
32+
# Simulate BAML logging
33+
print("This is a BAML log to stderr", file=sys.stderr)
34+
print("Another BAML log message", file=sys.stderr)
35+
36+
# Get captured content
37+
captured = stderr_capture.getvalue()
38+
if captured:
39+
print("Captured stderr content:")
40+
print(captured)
41+
else:
42+
print("No stderr content captured")
43+
44+
print("\n" + "=" * 60)
45+
print("Test complete!")

0 commit comments

Comments
 (0)