Skip to content

[two_auctions.md] Update np.random → Generator API - #960

Merged
jstac merged 1 commit into
mainfrom
update-rng-two-auctions
Jul 28, 2026
Merged

[two_auctions.md] Update np.random → Generator API#960
jstac merged 1 commit into
mainfrom
update-rng-two-auctions

Conversation

@Chihiro2000GitHub

Copy link
Copy Markdown
Contributor

Summary

This PR migrates legacy NumPy random API usage in two_auctions.md as part of QuantEcon/meta#299.

The np.random.seed(1337) / np.random.uniform(...) / np.random.chisquare(...) calls are replaced with an explicit rng = np.random.default_rng(1337) and the corresponding rng.uniform(...) / rng.chisquare(...) methods. The lecture intentionally re-seeds to reproduce the same valuations across blocks, so rng is re-created with the same seed at those points, preserving the original reproducibility. There are no Numba-related concerns in this file.

Hi @mmcky and @HumphreyYang, I'd be grateful if you could take a look when you have time.

@github-actions

Copy link
Copy Markdown

📖 Netlify Preview Ready!

Preview URL: https://pr-960--sunny-cactus-210e3e.netlify.app

Commit: ac9edc1

📚 Changed Lectures


Build Info

@jstac

jstac commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Perfect, many thanks @Chihiro2000GitHub .

@HumphreyYang @mmcky No need to review, I'll go ahead and merge.

@jstac
jstac merged commit 364f150 into main Jul 28, 2026
1 check passed
@jstac
jstac deleted the update-rng-two-auctions branch July 28, 2026 20:34
@mmcky

mmcky commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

✅ Translation sync completed (zh-cn)

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

  • lectures/two_auctions.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