Skip to content

Commit d40efb4

Browse files
committed
Update reproduction scripts and remove shell word count
Replaces shell-based word count with a Python script in reproduce.sh, updates test and build steps for clarity, and removes scripts/count_words.sh and its documentation. Also updates runtime to Python 3.12 and removes 'ruff' from dependencies.
1 parent 6fd75a8 commit d40efb4

File tree

6 files changed

+26
-312
lines changed

6 files changed

+26
-312
lines changed

reproduce.sh

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,44 +17,49 @@ echo ""
1717

1818
# Run tests to verify installation and code correctness
1919
echo "Step 2/5: Running test suite..."
20-
if uv run pytest -v 2>/dev/null; then
21-
echo "✓ All tests passed"
22-
else
23-
echo "⚠ No tests found or tests not configured yet"
24-
fi
20+
uv run pytest code/test_moderation.py -v
21+
echo "✓ All tests passed"
2522
echo ""
2623

2724
# Build the paper (HTML and PDF)
28-
echo "Step 3/5: Building paper..."
29-
uv run myst build --html
30-
echo "✓ HTML documentation built"
25+
echo "Step 3/5: Building paper and PDFs..."
26+
uv run myst build --all --pdf
27+
echo "✓ HTML documentation and PDFs built"
3128
echo ""
3229

33-
# Note: PDF build requires LaTeX installation
34-
# Uncomment the following line if you have LaTeX installed:
35-
# uv run myst build --pdf content/paper/moderation.md
36-
3730
# Execute computational notebook
3831
echo "Step 4/5: Executing computational notebook..."
3932
uv run jupyter nbconvert --to notebook --execute --inplace code/notebook.ipynb
4033
echo "✓ Notebook executed successfully"
4134
echo ""
4235

43-
# Generate figures (implicitly done during notebook execution)
36+
# Verify outputs
4437
echo "Step 5/5: Verifying outputs..."
4538
if [ -f "_build/html/index.html" ]; then
46-
echo "✓ HTML documentation available at: _build/html/index.html"
39+
echo "✓ HTML documentation: _build/html/index.html"
40+
fi
41+
if [ -f "content/exports/moderation_letters.pdf" ]; then
42+
echo "✓ Paper PDF: content/exports/moderation_letters.pdf"
43+
fi
44+
if [ -f "content/exports/moderation_with_appendix.pdf" ]; then
45+
echo "✓ Paper+Appendix PDF: content/exports/moderation_with_appendix.pdf"
4746
fi
4847
if [ -f "code/notebook.ipynb" ]; then
49-
echo "✓ Executed notebook available at: code/notebook.ipynb"
48+
echo "✓ Executed notebook: code/notebook.ipynb"
5049
fi
5150
echo ""
5251

52+
# Word count check
53+
echo "Word count for Economics Letters submission:"
54+
uv run python code/wordcount.py
55+
echo ""
56+
5357
echo "=========================================="
5458
echo "Reproduction complete!"
5559
echo "=========================================="
5660
echo ""
5761
echo "To view results:"
5862
echo " - Open _build/html/index.html in a browser"
5963
echo " - Open code/notebook.ipynb in Jupyter"
64+
echo " - PDFs are in content/exports/"
6065
echo ""

reproduce_min.sh

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,10 @@ uv sync
1515
echo "✓ Dependencies installed"
1616
echo ""
1717

18-
# Run minimal tests (skip slow tests)
19-
echo "Step 2/3: Running quick tests..."
20-
if uv run pytest -v -k "not slow" --maxfail=1 2>/dev/null; then
21-
echo "✓ Quick tests passed"
22-
else
23-
echo "⚠ No tests found or tests not configured yet"
24-
fi
18+
# Run tests
19+
echo "Step 2/3: Running test suite..."
20+
uv run pytest code/test_moderation.py -v --maxfail=3
21+
echo "✓ Tests passed"
2522
echo ""
2623

2724
# Build HTML documentation only (skip PDF and notebook execution)
@@ -37,6 +34,6 @@ echo ""
3734
echo "To view results:"
3835
echo " - Open _build/html/index.html in a browser"
3936
echo ""
40-
echo "For full reproduction including executed notebooks, run:"
37+
echo "For full reproduction including PDFs and executed notebooks, run:"
4138
echo " ./reproduce.sh"
4239
echo ""

runtime.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
python-3.11
1+
python-3.12

scripts/README_word_count.md

Lines changed: 0 additions & 147 deletions
This file was deleted.

scripts/count_words.sh

Lines changed: 0 additions & 139 deletions
This file was deleted.

uv.lock

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)