From 94e7af8b0a0aaa95c62fabc3ea5728521bbae32f Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Wed, 19 Aug 2026 12:29:38 +1000 Subject: [PATCH] Port the numpy.md edits from source #595 that the resync regeneration dropped The batch's original sync PR here (#30) was closed unmerged and its regeneration (#34) silently omitted numpy.md, so the two #595 edits never arrived: the DiscreteRV seed docstring (kept in English verbatim, as this lecture's docstrings are) and the tic/toc sentence, now le gestionnaire de contexte qe.Timer(). Hand-ported rather than regenerated because numpy.md carries Emile's native review (#24) that a whole-file resync would discard. State advances to the batch commit d35eb831. Measurement and ledger: QuantEcon/action-translation#276. Co-Authored-By: Claude Fable 5 --- .translate/state/numpy.md.yml | 4 ++-- lectures/numpy.md | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.translate/state/numpy.md.yml b/.translate/state/numpy.md.yml index 977aa8f..3eb2e16 100644 --- a/.translate/state/numpy.md.yml +++ b/.translate/state/numpy.md.yml @@ -1,5 +1,5 @@ -source-sha: a2b929f15e703b6942e8b80a29011c51f234b1e0 -synced-at: "2026-07-14" +source-sha: d35eb831da23a763f43d403e96f20d43529cae53 +synced-at: "2026-08-19" model: claude-opus-4-8 mode: NEW section-count: 8 diff --git a/lectures/numpy.md b/lectures/numpy.md index 5c8bb32..a7f010c 100644 --- a/lectures/numpy.md +++ b/lectures/numpy.md @@ -1271,7 +1271,11 @@ class DiscreteRV: def __init__(self, q, seed=None): """ The argument q is a NumPy array, or array like, nonnegative and sums - to 1 + to 1. + + The argument seed sets the seed for the underlying random number + generator; with the default seed=None, draws are not reproducible + across runs. """ self.q = q self.Q = cumsum(q) @@ -1446,7 +1450,7 @@ print(A) **Partie 2** : Passez à la reproduction du résultat de l'opération de broadcasting suivante. Parallèlement, comparez les vitesses du broadcasting et de la boucle `for` que vous implémentez. -Pour cette partie de l'exercice, vous pouvez utiliser les fonctions `tic`/`toc` de la bibliothèque `quantecon` pour chronométrer l'exécution. +Pour cette partie de l'exercice, vous pouvez utiliser le gestionnaire de contexte `qe.Timer()` de la bibliothèque `quantecon` pour chronométrer l'exécution. Assurons-nous que cette bibliothèque est installée.