business_cycle#

  • Series: lecture-python-intro

  • File: lectures/business_cycle.md

  • Audit date: 2026-08-26

  • Corpus snapshot: a12d17c0ef

  • Categories audited: writing, code, figures, links (JAX out of scope)

  • Overall score: 7.5 / 10

  • Priority: LOW

Score breakdown#

Category

Score

One-line note

Writing

6/10

qe-writing-005 ×2; qe-writing-004 ×1; qe-writing-001 ×1, +2 more.

Math

N/A

no mathematical content.

Code

7/10

qe-code-001 ×15.

JAX

out of scope

JAX rules target lecture-jax.

Figures

7/10

qe-fig-004 ×2; qe-fig-006 ×1; qe-fig-008 ×2, +1 more.

References

N/A

no citations in this lecture.

Links

10/10

no mechanical violations detected.

Admonitions

N/A

no admonitions, exercises or solutions.

Issues#

Critical#

None found.

High severity#

  • [qe-code-001] (reviewer) — Follow PEP8 unless closer to mathematical notation. Count: 15. Lines: 84, 110, 193, 194, 195, 339, 386, 499, 500, 501, …. Example: three distinct PEP8 spacing patterns. (a) Missing space after the colon in dict literals, inconsistent within a single line - {'color':'grey', 'alpha': 0.2} at lines 193, 194, 195 and the duplicated block at 499, 500, 501. (b) nber['USREC']==1 with no spaces around the comparison at lines 386, 652, 673, 730. © Continuation lines that do not reach the visual-indent column - 12 spaces instead of 31 for wb.data.DataFrame( at lines 84, 110, 513, 4 spaces at 587, and 16 instead of 22 at line 339.

Medium severity#

  • [qe-fig-004] — Caption formatting conventions. Count: 2. Lines: 628, 756. Example: caption of 8 words.

  • [qe-fig-008] — Use lw=2 for line charts. Count: 2. Lines: 162, 471. Example: plot() without lw=.

  • [qe-writing-001] — Use one sentence per paragraph. Count: 1. Lines: 601. Example: 2 sentences in one paragraph.

  • [qe-writing-004] — Avoid unnecessary capitalization in narrative text. Count: 1. Lines: 623. Example: mid-sentence ‘Consumer’.

  • [qe-writing-005] (reviewer) — Use bold for definitions, italic for emphasis. Count: 2. Lines: 20, 22. Example: the lecture’s central terms are defined in plain text: ‘Business cycles are fluctuations in economic activity over time’ (line 20) and the four names introduced at line 22 - expansions, booms, contractions, recessions - all of which are used throughout. No bold appears anywhere in the file.

Low severity#

  • [qe-fig-001] — Do not set figure size unless necessary. Count: 1. Lines: 53. Example: style override.

  • [qe-fig-006] — Lowercase axis labels. Count: 1. Lines: 736. Example: axis label YoY real output change (%).

  • [qe-writing-002] (reviewer) — Keep writing clear, concise, and valuable. Count: 1. Lines: 601. Example: line 601 is a single 64-word paragraph holding two sentences: a 36-word causal claim about French labour unions, employment protection, firing costs and wage rigidity, then a 28-word consequence clause. It is also the only unsourced institutional argument in a lecture that is otherwise purely descriptive.

  • [qe-writing-003] (reviewer) — Maintain logical flow. Count: 1. Lines: 417. Example: line 417 says ‘In our previous discussion, we found that developed economies have had relatively synchronized periods of recession’, and line 420 adds that this synchronization did not appear in Argentina until the 2000s. The GDP growth section it points to (lines 101-321) plots the five countries in five separate figures on separate axes and never makes either claim, so the Synchronization section opens by treating an unstated conclusion as established.

Strengths#

  • The plotting helper defined at line 129 carries a full numpy-style docstring (Parameters and Returns sections, lines 131-158) and is reused for every country panel, which is why all twelve figures share one axis convention and one recession-shading treatment.

  • NBER recession bands are shaded on every US series (lines 384-390, 653, 674, 731) and the 1974/1991/2008/2020 episodes are labelled in-axes, so the reader reads the cyclical timing off the figure instead of being told it.

  • The data cutoff at lines 59-61 is a single named variable with a comment explaining how to freeze it for a reproducible build - unusual and genuinely useful hygiene in a lecture that pulls live FRED and World Bank series.

  • Every series is linked to its source page - the two FRED unemployment series at line 328, the Michigan sentiment index at line 620, core CPI at line 625, the World Bank API at line 24 - so the numbers can be verified or refreshed.

  • The developed-versus-developing comparison at lines 504-561 puts both groups through the same function on the same axes, which is what makes the synchronization claim at line 562 readable rather than asserted.