Skip to content

[need_for_speed.md] Update np.random → Generator API#545

Merged
HumphreyYang merged 2 commits intomainfrom
update-need-for-speed-rng
May 5, 2026
Merged

[need_for_speed.md] Update np.random → Generator API#545
HumphreyYang merged 2 commits intomainfrom
update-need-for-speed-rng

Conversation

@Chihiro2000GitHub
Copy link
Copy Markdown
Collaborator

This PR updates lectures/need_for_speed.md as part of the NumPy random API migration described in QuantEcon/meta#299.

The change is limited to one remaining legacy NumPy random API usage in the vectorized NumPy example ("9.4.2. Vectorization vs pure Python loops").

The rng generator is initialized outside the with qe.Timer(): block, so the timing comparison continues to measure only the vectorized NumPy operation itself.

I also checked the rendered lecture with a local build. The relative timing difference between the non-vectorized Python loop and the vectorized NumPy version remains essentially unchanged, so the speed comparison in the lecture is not affected by this update.

@HumphreyYang, I'd be grateful if you could take a look when you have time!

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 3, 2026

@github-actions github-actions Bot temporarily deployed to pull request May 3, 2026 12:05 Inactive
Copy link
Copy Markdown
Member

@HumphreyYang HumphreyYang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks @Chihiro2000GitHub, it looks great to me. Merging

@HumphreyYang HumphreyYang merged commit 06af1a9 into main May 5, 2026
5 checks passed
@HumphreyYang HumphreyYang deleted the update-need-for-speed-rng branch May 5, 2026 13:04
@mmcky
Copy link
Copy Markdown
Contributor

mmcky commented May 5, 2026

✅ Translation sync completed (zh-cn)

Target repo: QuantEcon/lecture-python-programming.zh-cn
Translation PR: QuantEcon/lecture-python-programming.zh-cn#62
Files synced (1):

  • lectures/need_for_speed.md

@mmcky
Copy link
Copy Markdown
Contributor

mmcky commented May 5, 2026

✅ Translation sync completed (fa)

Target repo: QuantEcon/lecture-python-programming.fa
Translation PR: QuantEcon/lecture-python-programming.fa#119
Files synced (1):

  • lectures/need_for_speed.md

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.

3 participants