Skip to content

[mccall_q.md] Update np.random → Generator API#959

Open
Chihiro2000GitHub wants to merge 1 commit into
mainfrom
update-rng-mccall-q
Open

[mccall_q.md] Update np.random → Generator API#959
Chihiro2000GitHub wants to merge 1 commit into
mainfrom
update-rng-mccall-q

Conversation

@Chihiro2000GitHub

Copy link
Copy Markdown
Contributor

Summary

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

np.random.seed(123) is replaced by an explicit rng = np.random.default_rng(123) (keeping the original fixed seed), and the np.random.random() calls inside the Qlearning_McCall jitclass are migrated to rng.random(). Following the style guide for jitclass code, rng is passed in as a method argument rather than stored as a class attribute, and threaded through run_epochs and its call sites. The notebook executes successfully under Numba.

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-959--sunny-cactus-210e3e.netlify.app

Commit: 2af7e1b

📚 Changed Lectures


Build Info

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.

1 participant