-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
457 lines (307 loc) · 13.8 KB
/
Makefile
File metadata and controls
457 lines (307 loc) · 13.8 KB
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
.DEFAULT_GOAL := help
PYTHON := python
SEED ?= 123
OUT_SYN := data/synthetic
OUT_CH13 := outputs/ch13
OUT_CH14 := outputs/ch14
OUT_CH15 := outputs/ch15
OUT_TRACK_D := outputs/track_d
OUT_LEDGERLAB_CH01 := data/synthetic/ledgerlab_ch01
OUT_NSO_V1 := data/synthetic/nso_v1
.PHONY: help
help:
@echo "Available targets:"
@echo " ch13 - full Chapter 13 run (sim + analysis + plots)"
@echo " ch13-ci - tiny, fast CI smoke for Chapter 13"
@echo " ch14 - full Chapter 14 A/B t-test (sim + analysis + plots)"
@echo " ch14-ci - tiny, fast CI smoke for Chapter 14"
@echo " ch15 - full Chapter 15 reliability (sim + analysis + plots)"
@echo " ch15-ci - tiny, fast CI smoke for Chapter 15"
@echo " psych-ch06 - Track B Chapter 6 z-score lab"
@echo " psych-ch07 - Track B Chapter 7 sampling lab"
@echo " business-sim - Track D LedgerLab simulator (Chapter 1 core tables)"
@echo " business-ch01 - Track D Chapter 1 analysis (accounting as measurement)"
@echo " business-ch02 - Track D Chapter 2 analysis (double-entry & GL as database)"
@echo " business-nso-sim - Track D NSO v1 simulator (multi-month running case)"
@echo " business-validate - Validate Track D dataset schema + basic checks"
@echo " business-ch04 - Track D Chapter 4 analysis (assets: inventory + depreciation)"
@echo " business-ch05 - Track D Chapter 5 analysis (liabilities + payroll + taxes + debt + equity)"
@echo " business-ch06 - Track D Chapter 6 analysis (reconciliations as data validation)"
@echo " business-ch07 - Track D Chapter 7 analysis (prepare accounting data for analysis)"
@echo " business-ch08 - Track D Chapter 8 analysis (descriptive stats for financial performance)"
@echo " business-ch09 - Track D Chapter 9 analysis (plotting/reporting style contract + example figures)"
@echo " trackd-zip - rebuild Track D workbook ZIP from workbooks/track_d_template/"
@echo " lint - ruff check"
@echo " lint-fix - ruff check with fixes"
@echo " test - pytest"
@echo " docs - build Sphinx docs (html)"
@echo " docs-strict- build docs with warnings as errors (clean rebuild)"
@echo " clean - remove generated outputs"
.PHONY: docs docs-strict docs-workbook docs-workbook-strict
.PHONY: trackd-zip
trackd-zip:
$(PYTHON) tools/build_workbook_zip.py
docs:
$(PYTHON) -m sphinx -b html docs/source docs/build/html
# Full-site strict (NOT green yet in PyStatsV1; keep for later cleanup PR)
docs-strict:
# Force a clean rebuild so warnings can't be hidden by cached doctrees.
$(PYTHON) -m sphinx -a -E -W --keep-going -b html docs/source docs/build/html
# Workbook-only builds (this is what we enforce first, like LedgerLoom Workbook)
docs-workbook:
$(PYTHON) -m sphinx -c docs/source -b html docs/source/workbook docs/build/html-workbook
docs-workbook-strict:
# Clean rebuild of workbook subtree only; warnings are errors.
$(PYTHON) -m sphinx -c docs/source -E -W --keep-going -b html docs/source/workbook docs/build/html-workbook
# --- CI smokes (small, deterministic) ---
.PHONY: ch13-ci
ch13-ci:
$(PYTHON) -m scripts.sim_stroop --n-subjects 6 --n-trials 10 --seed $(SEED) --outdir $(OUT_SYN)
$(PYTHON) -m scripts.ch13_stroop_within --data $(OUT_SYN)/psych_stroop_trials.csv --outdir $(OUT_CH13) --save-plots --seed $(SEED)
$(PYTHON) -m scripts.sim_fitness_2x2 --n-per-group 10 --seed $(SEED) --outdir $(OUT_SYN)
$(PYTHON) -m scripts.ch13_fitness_mixed --data $(OUT_SYN)/fitness_long.csv --outdir $(OUT_CH13) --save-plots --seed $(SEED)
.PHONY: ch14-ci
ch14-ci:
$(PYTHON) -m scripts.sim_ch14_tutoring --n-per-group 10 --seed $(SEED) --outdir $(OUT_SYN)
$(PYTHON) -m scripts.ch14_tutoring_ab --datadir $(OUT_SYN) --outdir $(OUT_CH14) --seed $(SEED)
.PHONY: ch15-ci
ch15-ci:
$(PYTHON) -m scripts.sim_ch15_reliability --n-survey 20 --n-retest 10 --seed $(SEED) --outdir $(OUT_SYN)
$(PYTHON) -m scripts.ch15_reliability_analysis --datadir $(OUT_SYN) --outdir $(OUT_CH15) --seed $(SEED)
# --- Full demos ---
.PHONY: psych-ch06
psych-ch06:
$(PYTHON) -m scripts.psych_ch6_normal_zscores
.PHONY: psych-ch07
psych-ch07:
$(PYTHON) -m scripts.sim_psych_ch7_sampling
.PHONY: psych-ch08
psych-ch08:
$(PYTHON) -m scripts.psych_ch8_one_sample_test
.PHONY: psych-ch09
psych-ch09:
python -m scripts.psych_ch9_one_sample_ci
.PHONY: psych-ch10
psych-ch10:
python -m scripts.psych_ch10_independent_t
.PHONY: psych-ch11
psych-ch11:
python -m scripts.psych_ch11_paired_t
.PHONY: psych-ch12
psych-ch12:
python -m scripts.psych_ch12_one_way_anova
.PHONY: psych-ch13
psych-ch13:
python -m scripts.psych_ch13_two_way_anova
.PHONY: psych-ch14 test-psych-ch14
# Run the Chapter 14 repeated-measures ANOVA lab script
psych-ch14:
python -m scripts.psych_ch14_repeated_measures_anova
# Run the Chapter 14 unit tests only
test-psych-ch14:
pytest tests/test_psych_ch14_repeated_measures_anova.py
psych-ch15:
python -m scripts.psych_ch15_correlation
test-psych-ch15:
pytest tests/test_psych_ch15_correlation.py
psych-ch15a-pairwise:
python -m scripts.psych_ch15a_pingouin_pairwise_demo
test-psych-ch15a-pairwise:
pytest tests/test_psych_ch15a_pingouin_pairwise_demo.py
psych-ch15a-partial:
python -m scripts.psych_ch15a_pingouin_partial_demo
test-psych-ch15a-partial:
pytest tests/test_psych_ch15a_pingouin_partial_demo.py
psych-ch16:
python -m scripts.psych_ch16_regression
test-psych-ch16:
pytest tests/test_psych_ch16_regression.py
psych-ch16a:
python -m scripts.psych_ch16a_pingouin_regression_demo
test-psych-ch16a:
pytest tests/test_psych_ch16a_pingouin_regression_demo.py
psych-ch17:
python -m scripts.psych_ch17_mixed_models
test-psych-ch17:
pytest tests/test_psych_ch17_mixed_models.py
psych-ch18:
python -m scripts.psych_ch18_ancova
test-psych-ch18:
pytest tests/test_psych_ch18_ancova.py
.PHONY: psych-ch19
psych-ch19:
python -m scripts.psych_ch19_nonparametrics
.PHONY: test-psych-ch19
test-psych-ch19:
pytest tests/test_psych_ch19_nonparametrics.py
psych-ch19a:
python -m scripts.psych_ch19a_rank_nonparametrics
test-psych-ch19a:
pytest tests/test_psych_ch19a_rank_nonparametrics.py
psych-ch20:
python -m scripts.psych_ch20_responsible_researcher
test-psych-ch20:
pytest tests/test_psych_ch20_responsible_researcher.py
# Track C – Chapter 10 problem set (independent t)
psych-ch10-problems:
python -m scripts.psych_ch10_problem_set
test-psych-ch10-problems:
pytest tests/test_psych_ch10_problem_set.py
# Track C – Chapter 11 problem set (Paired-samples t tests)
psych-ch11-problems:
python -m scripts.psych_ch11_problem_set
test-psych-ch11-problems:
pytest tests/test_psych_ch11_problem_set.py
# Track C – Chapter 12 problem set (one-way ANOVA)
psych-ch12-problems:
python -m scripts.psych_ch12_problem_set
test-psych-ch12-problems:
pytest tests/test_psych_ch12_problem_set.py
psych-ch13-problems:
python -m scripts.psych_ch13_factorial_anova --n-per-cell 30 --seed 123 --outdir data/synthetic/psych_ch13
test-psych-ch13-problems:
pytest tests/test_psych_ch13_factorial_anova.py
# Track C – Chapter 14 problem set (Repeated-Measures ANOVA)
psych-ch14-problems:
python -m scripts.psych_ch14_problem_set
test-psych-ch14-problems:
pytest tests/test_psych_ch14_problem_set.py
# Track C – Chapter 15 problem set (Correlation)
psych-ch15-problems:
python -m scripts.psych_ch15_problem_set
test-psych-ch15-problems:
pytest tests/test_psych_ch15_problem_set.py
# Track C – Chapter 16 problem set (linear regression)
psych-ch16-problems:
python -m scripts.psych_ch16_problem_set
test-psych-ch16-problems:
pytest tests/test_psych_ch16_problem_set.py
psych-ch17-problems:
python -m scripts.psych_ch17_problem_set
test-psych-ch17-problems:
pytest tests/test_psych_ch17_problem_set.py
.PHONY: psych-ch18-problems test-psych-ch18-problems
psych-ch18-problems:
python -m scripts.psych_ch18_problem_set
test-psych-ch18-problems:
pytest -q tests/test_psych_ch18_problem_set.py
.PHONY: psych-ch19-problems test-psych-ch19-problems
psych-ch19-problems:
python -m scripts.psych_ch19_problem_set
test-psych-ch19-problems:
pytest -q tests/test_psych_ch19_problem_set.py
.PHONY: psych-ch20-problems test-psych-ch20-problems
psych-ch20-problems:
python scripts/psych_ch20_problem_set.py
test-psych-ch20-problems:
pytest -q tests/test_psych_ch20_problem_set.py
.PHONY: ch13
ch13:
$(PYTHON) -m scripts.sim_stroop --seed $(SEED) --outdir $(OUT_SYN)
$(PYTHON) -m scripts.ch13_stroop_within --data $(OUT_SYN)/psych_stroop_trials.csv --outdir $(OUT_CH13) --save-plots --seed $(SEED)
$(PYTHON) -m scripts.sim_fitness_2x2 --seed $(SEED) --outdir $(OUT_SYN)
$(PYTHON) -m scripts.ch13_fitness_mixed --data $(OUT_SYN)/fitness_long.csv --outdir $(OUT_CH13) --save-plots --seed $(SEED)
.PHONY: ch14
ch14:
$(PYTHON) -m scripts.sim_ch14_tutoring --n-per-group 50 --seed $(SEED) --outdir $(OUT_SYN)
$(PYTHON) -m scripts.ch14_tutoring_ab --datadir $(OUT_SYN) --outdir $(OUT_CH14) --seed $(SEED)
.PHONY: ch15
ch15:
$(PYTHON) -m scripts.sim_ch15_reliability --n-survey 150 --n-retest 40 --seed $(SEED) --outdir $(OUT_SYN)
$(PYTHON) -m scripts.ch15_reliability_analysis --datadir $(OUT_SYN) --outdir $(OUT_CH15) --seed $(SEED)
# --- Track D (Business Statistics & Forecasting for Accountants) ---
.PHONY: business-sim
business-sim:
$(PYTHON) -m scripts.sim_business_ledgerlab --outdir $(OUT_LEDGERLAB_CH01) --seed $(SEED) --month 2025-01 --n-sales 18
.PHONY: business-ch01
business-ch01:
$(PYTHON) -m scripts.business_ch01_accounting_measurement --datadir $(OUT_LEDGERLAB_CH01) --outdir $(OUT_TRACK_D) --seed $(SEED)
.PHONY: business-ch02
business-ch02:
$(PYTHON) -m scripts.business_ch02_double_entry_and_gl --datadir $(OUT_LEDGERLAB_CH01) --outdir $(OUT_TRACK_D) --seed $(SEED)
.PHONY: business-ch03
business-ch03:
$(PYTHON) -m scripts.business_ch03_statements_as_summaries --datadir $(OUT_LEDGERLAB_CH01) --outdir $(OUT_TRACK_D) --seed $(SEED)
.PHONY: business-nso-sim
business-nso-sim:
$(PYTHON) -m scripts.sim_business_nso_v1 --outdir $(OUT_NSO_V1) --seed $(SEED) --start-month 2025-01 --n-months 24
.PHONY: business-validate
business-validate:
$(PYTHON) -m scripts.business_validate_dataset --datadir $(OUT_NSO_V1) --outdir $(OUT_TRACK_D) --seed $(SEED)
.PHONY: business-ch04
business-ch04:
$(PYTHON) -m scripts.business_ch04_assets_inventory_fixed_assets --datadir $(OUT_NSO_V1) --outdir $(OUT_TRACK_D) --seed $(SEED)
.PHONY: business-ch05
business-ch05:
$(PYTHON) -m scripts.business_ch05_liabilities_payroll_taxes_equity --datadir $(OUT_NSO_V1) --outdir $(OUT_TRACK_D) --seed $(SEED)
.PHONY: business-ch06
business-ch06:
$(PYTHON) -m scripts.business_ch06_reconciliations_quality_control --datadir $(OUT_NSO_V1) --outdir $(OUT_TRACK_D) --seed $(SEED)
.PHONY: business-ch07
business-ch07:
$(PYTHON) -m scripts.business_ch07_preparing_accounting_data_for_analysis --datadir $(OUT_NSO_V1) --outdir $(OUT_TRACK_D) --seed $(SEED)
.PHONY: business-ch08
business-ch08:
$(PYTHON) -m scripts.business_ch08_descriptive_statistics_financial_performance --datadir $(OUT_NSO_V1) --outdir $(OUT_TRACK_D) --seed $(SEED)
.PHONY: business-ch09
business-ch09:
$(PYTHON) -m scripts.business_ch09_reporting_style_contract --datadir $(OUT_NSO_V1) --outdir $(OUT_TRACK_D) --seed $(SEED)
.PHONY: business-ch10
business-ch10:
$(PYTHON) -m scripts.business_ch10_probability_risk --datadir $(OUT_NSO_V1) --outdir $(OUT_TRACK_D) --seed $(SEED)
.PHONY: business-ch11
business-ch11:
$(PYTHON) -m scripts.business_ch11_sampling_estimation_audit_controls --datadir $(OUT_NSO_V1) --outdir $(OUT_TRACK_D) --seed $(SEED)
business-ch12: ## Run Track D Chapter 12 analysis
$(PYTHON) -m scripts.business_ch12_hypothesis_testing_decisions --datadir $(OUT_NSO_V1) --outdir $(OUT_TRACK_D) --seed $(SEED)
business-ch13:
$(PYTHON) -m scripts.business_ch13_correlation_causation_controlled_comparisons --datadir $(OUT_NSO_V1) --outdir $(OUT_TRACK_D) --seed $(SEED)
business-ch14:
$(PYTHON) -m scripts.business_ch14_regression_driver_analysis --datadir $(OUT_NSO_V1) --outdir $(OUT_TRACK_D) --seed $(SEED)
.PHONY: business-ch15
business-ch15:
$(PYTHON) -m scripts.business_ch15_forecasting_foundations --datadir $(OUT_NSO_V1) --outdir $(OUT_TRACK_D) --seed $(SEED)
.PHONY: business-ch16
business-ch16:
$(PYTHON) -m scripts.business_ch16_seasonality_baselines --datadir $(OUT_NSO_V1) --outdir $(OUT_TRACK_D) --seed $(SEED)
.PHONY: business-ch17
business-ch17:
$(PYTHON) -m scripts.business_ch17_revenue_forecasting_segmentation_drivers --datadir $(OUT_NSO_V1) --outdir $(OUT_TRACK_D) --seed $(SEED)
.PHONY: business-ch18
business-ch18:
$(PYTHON) -m scripts.business_ch18_expense_forecasting_fixed_variable_step_payroll --datadir $(OUT_NSO_V1) --outdir $(OUT_TRACK_D) --seed $(SEED)
.PHONY: business-ch19
business-ch19:
$(PYTHON) -m scripts.business_ch19_cash_flow_forecasting_direct_method_13_week --datadir $(OUT_NSO_V1) --outdir $(OUT_TRACK_D) --seed $(SEED)
.PHONY: business-ch20
business-ch20:
$(PYTHON) -m scripts.business_ch20_integrated_forecasting_three_statements --datadir $(OUT_NSO_V1) --outdir $(OUT_TRACK_D) --seed $(SEED)
.PHONY: business-ch21
business-ch21:
$(PYTHON) -m scripts.business_ch21_scenario_planning_sensitivity_stress --datadir $(OUT_NSO_V1) --outdir $(OUT_TRACK_D) --seed $(SEED)
.PHONY: business-ch22
business-ch22:
$(PYTHON) -m scripts.business_ch22_financial_statement_analysis_toolkit --datadir $(OUT_NSO_V1) --outdir $(OUT_TRACK_D) --seed $(SEED)
.PHONY: business-ch23
business-ch23:
$(PYTHON) -m scripts.business_ch23_communicating_results_governance --datadir $(OUT_NSO_V1) --outdir $(OUT_TRACK_D) --seed $(SEED)
# --- Quality gates ---
.PHONY: lint
lint:
ruff check .
.PHONY: lint-fix
lint-fix:
ruff check . --fix
.PHONY: test
test:
pytest -q
# --- Utilities ---
.PHONY: clean
clean:
@echo "Removing generated outputs in $(OUT_CH13), $(OUT_CH14), $(OUT_CH15) + packaging artifacts"
-@rm -rf $(OUT_CH13) $(OUT_CH14) $(OUT_CH15)
-@rm -rf dist build
.PHONY: clean-synth
clean-synth:
@echo "Removing synthetic data in $(OUT_SYN) (may remove tracked fixtures!)"
-@rm -rf $(OUT_SYN)