Skip to content

Update business cycle data to latest available (#364)#770

Open
jstac wants to merge 3 commits into
mainfrom
update-business-cycle-data-364
Open

Update business cycle data to latest available (#364)#770
jstac wants to merge 3 commits into
mainfrom
update-business-cycle-data-364

Conversation

@jstac

@jstac jstac commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Closes #364.

What

The World Bank series in business_cycle.md already auto-fetch the most recent year. The FRED pulls, however, had end_date = datetime.datetime(2022, 12, 31) hardcoded in four places, capping the unemployment, NBER-recession, consumer-sentiment/CPI, and industrial-output series at 2022.

  • Switch the FRED data window to the latest available data, and define the cutoff once as a shared end_date variable with a documented one-line switch to pin it for reproducible builds (instead of repeating datetime.now() across cells).
  • Rename the unemployment cell's fixed 1942 cutoff to hist_end_date so it no longer clobbers the shared end_date.
  • Update the consumer-sentiment plot's end_date_graph to track the dynamic end date instead of a hardcoded 2023.
  • Update prose that hardcoded "2022" to read "the present", and reword the post-pandemic labour-market sentence to be anchored to the 2020 shock rather than the moving right edge of the chart.

Narrative check

I re-read the prose against what the extended data shows:

  • The consumer sentiment / CPI section is reinforced — it now captures the 2021–2023 inflation surge and matching sentiment drop.
  • The "unprecedented post-pandemic labour-market recovery" and US "trending slightly downward" claims still hold with the fuller series.
  • The GDP charts' recession highlight bands remain a curated set of four reference recessions (Oil Crisis, 1990s, GFC, Covid); they are intentionally not exhaustive.

Note

An earlier revision pinned the final year as an explicit x-axis tick, but it crowded the existing 2020 ("Covid-19") tick, so it was reverted — the charts use matplotlib's default ticks.

🤖 Generated with Claude Code

FRED series had hardcoded end dates of 2022-12-31, capping the
unemployment, NBER recession, consumer sentiment/CPI and industrial
output series. Switch these to datetime.now() so the lecture always
pulls the most recent data, matching the auto-updating World Bank
series.

Also pin the most recent year as an explicit x-axis tick in
plot_series and plot_comparison, so the extended GDP series read as
intentional rather than trailing off past the last labelled tick.

Update prose that referenced fixed end years (2022) to "the present".

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@netlify

netlify Bot commented Jun 15, 2026

Copy link
Copy Markdown

Deploy Preview for taupe-gaufre-c4e660 ready!

Name Link
🔨 Latest commit aafdd93
🔍 Latest deploy log https://app.netlify.com/projects/taupe-gaufre-c4e660/deploys/6a306968033cb600082870b6
😎 Deploy Preview https://deploy-preview-770--taupe-gaufre-c4e660.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown

@github-actions github-actions Bot temporarily deployed to pull request June 15, 2026 20:43 Inactive
Address narrative-drift risk from dynamic data dates:

- Define the data cutoff once (end_date) with a documented one-line
  switch to pin it for reproducible builds, instead of repeating
  datetime.now() across four FRED cells.
- Rename the 1942 historical cutoff to hist_end_date so it no longer
  clobbers the shared end_date in the unemployment cell.
- Reword the post-pandemic labour-market sentence to be anchored to
  the 2020 shock rather than to the moving right edge of the chart.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot temporarily deployed to pull request June 15, 2026 20:55 Inactive
The added final-year tick crowded the existing 2020 ("Covid-19") tick
and looked worse than the gap it was meant to address. Revert to
matplotlib's default x-axis ticks in plot_series and plot_comparison.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot temporarily deployed to pull request June 15, 2026 21:15 Inactive
@jstac

jstac commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

@mmcky Would you mind checking why the Colab build is failing?

(PS Colab rather than Collab)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[business_cycle] Update data for longest time series available

1 participant