Skip to content

🌐 [translation-sync] [numba.md] Update np.random β†’ Generator API#6

Merged
mmcky merged 2 commits into
mainfrom
translation-sync-2026-07-15T23-50-08-pr-550
Jul 16, 2026
Merged

🌐 [translation-sync] [numba.md] Update np.random β†’ Generator API#6
mmcky merged 2 commits into
mainfrom
translation-sync-2026-07-15T23-50-08-pr-550

Conversation

@mmcky

@mmcky mmcky commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Automated Translation Sync

This PR contains automated translations from QuantEcon/lecture-python-programming.

Source PR

#550 - [numba.md] Update np.random β†’ Generator API

Files Updated

  • ✏️ lectures/numba.md
  • ✏️ .translate/state/numba.md.yml

Details

  • Source Language: en
  • Target Language: fr
  • Model: claude-sonnet-5

This PR was created automatically by the translation action.

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown

βœ… Translation Quality Review

Verdict: PASS | Model: claude-sonnet-5 | Date: 2026-07-15


πŸ“ Translation Quality

Criterion Score
Accuracy 9/10
Fluency 9/10
Terminology 9/10
Formatting 10/10
Overall 9.2/10

Summary: The translation of the Exercises section is accurate, fluent, and terminologically consistent with the glossary and established Numba/French technical conventions. Minor issues include an escaped apostrophe in a code string that could cause a rendering artifact and a small punctuation omission, but these do not affect overall comprehension or document structure. Formatting and MyST directives are correctly preserved throughout. Highly consistent terminology for Numba/JIT-specific vocabulary (compilation à la volée, boucle parallèle, générateur, état interne) that aligns well with technical French conventions. Complex explanations of data races and reproducibility issues in the numba_ex_race exercise are rendered clearly and accurately, preserving nuance from the English source. Code comments within code cells are properly translated (e.g., 'Chronométrage de la version...', 'Pour chaque ménage') without breaking code functionality. Mathematical notation and LaTeX are fully preserved without alteration.

Suggestions:

  • Exercises section, speed_ex1 intro: 'afin de pouvoir les utiliser dans les deux exercices et comparer les rΓ©sultats' is missing a closing period after 'rΓ©sultats' β€” minor punctuation fix needed to match source sentence ending.
  • numba_ex_race solution, plot code: 'nombre d'Γ©chantillons' uses an escaped apostrophe inside a Python string that will render literally as backslash-apostrophe in the code cell; should use 'nombre d'Γ©chantillons' with a standard apostrophe or double quotes to avoid a visible backslash in the plotted x-axis label.
  • numba_ex_race solution: 'course aux donnΓ©es' is a reasonable rendering of 'data race', but keeping the English term in parentheses on first use, as done, is good practice β€” however consider being consistent by keeping '(data race)' attached the first time only and not just via the link markdown, since the term appears standalone later in 'course aux donnΓ©es' without the English gloss, which is fine but could be reinforced once more for clarity.

πŸ” Diff Quality

Check Status
Scope Correct βœ…
Position Correct βœ…
Structure Preserved βœ…
Heading-map Correct βœ…
Overall 10/10

Summary: The translation sync correctly mirrors all source changes including new exercises, renamed functions, and admonition blocks, with structure and heading metadata preserved appropriately.


This review was generated automatically by action-translation review mode.

@github-actions

Copy link
Copy Markdown

βœ… Translation Quality Review

Verdict: PASS | Model: claude-sonnet-5 | Date: 2026-07-15


πŸ“ Translation Quality

Criterion Score
Accuracy 9/10
Fluency 9/10
Terminology 9/10
Formatting 9/10
Overall 9/10

Summary: The French translation of the Exercises section is of high quality, accurately conveying complex technical content about Numba parallelization, random number generation, and data races while maintaining natural French academic style. Terminology is consistent and well-chosen, formatting is fully preserved, and no syntax errors were found. Minor stylistic points around punctuation and the translation of 'data race' are the only notable nitpicks. Excellent handling of technical Numba/JIT vocabulary (compilation Γ  la volΓ©e, dΓ©bogage de course aux donnΓ©es, prΓ©chauffage) with clear and consistent terminology throughout the Exercises section Code cells, LaTeX math, and MyST directive syntax are all preserved perfectly with no structural errors Natural, fluent French prose that maintains the pedagogical tone of the original, especially in nuanced explanations like the data race symptoms discussion

Suggestions:

  • Exercises section, speed_ex1 intro: 'Nous les gΓ©nΓ©rons ici et les stockons dans u_draws et v_draws afin de pouvoir les utiliser dans les deux exercices et comparer les rΓ©sultats' is missing a final period compared to the source sentence ending β€” minor punctuation inconsistency, add a period at the end.
  • Exercise numba_ex_race, plot labels: 'nombre d'Γ©chantillons' uses an escaped apostrophe inside a Python string literal within a code cell; verify this renders correctly in the notebook (should likely be 'nombre d’échantillons' or properly escaped as '), as escaped straight quotes in matplotlib labels are technically fine but stylistically inconsistent with typographic apostrophes used elsewhere in the prose.
  • Exercise numba_ex_race solution, methods list: 'gΓ©nΓ©rateur partagΓ© dans prange (course aux donnΓ©es)' is accurate but could be slightly clearer as 'gΓ©nΓ©rateur partagΓ© dans prange (situation de concurrence)' since 'course aux donnΓ©es' is a valid but less commonly used French rendering of 'data race' β€” current choice is acceptable but worth flagging for terminology consistency across QuantEcon lectures.

πŸ” Diff Quality

Check Status
Scope Correct βœ…
Position Correct βœ…
Structure Preserved βœ…
Heading-map Correct βœ…
Overall 10/10

Summary: The target document correctly mirrors all source changes including new exercises, renamed functions, the new note block, and list numbering fixes, with no unnecessary heading-map changes needed since no headings were altered.


This review was generated automatically by action-translation review mode.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Synchronisation automatique de la traduction franΓ§aise du cours numba.md avec la version source, en mettant Γ  jour le contenu autour de l’API alΓ©atoire NumPy (passage vers default_rng() / Generator) et en clarifiant certains Γ©lΓ©ments de chronomΓ©trage et de parallΓ©lisation Numba.

Changes:

  • Mise Γ  jour/clarification d’exemples Monte-Carlo utilisant np.random.default_rng() et ajustements associΓ©s (sΓ©quentiel vs parallΓ¨le, Generator non thread-safe sous prange).
  • Ajout d’un encadrΓ© {note} expliquant la non thread-safety des objets Generator sous exΓ©cution parallΓ¨le Numba et la motivation mΓ©moire.
  • Mise Γ  jour de l’état de synchronisation de traduction (SHA source, date, modΓ¨le, version d’outil).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
lectures/numba.md Met Γ  jour le contenu pΓ©dagogique FR sur RNG/Generator et Numba (timings, parallΓ©lisation, note sur thread-safety).
.translate/state/numba.md.yml Met à jour les métadonnées de sync (source SHA, date, modèle, mode, tool-version).

πŸ’‘ Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lectures/numba.md
Comment on lines +533 to +534
with qe.Timer():
calculate_pi_in_loop(rng, n)
Comment thread lectures/numba.md
Comment on lines +537 to +540
Les deux cellules chronométrant la première approche ne mesurent que la boucle --- ses points
alΓ©atoires sont tirΓ©s une seule fois dans le bloc de configuration partagΓ© ci-dessus et ne sont jamais chronomΓ©trΓ©s, alors que
la seconde approche paie pour ses tirages Γ  l'intΓ©rieur de la fonction chronomΓ©trΓ©e.

mmcky added a commit that referenced this pull request Jul 16, 2026
A single translation sync fires `opened` plus one `labeled` event per
label applied, all within a couple of seconds. Each starts its own run of
this workflow, and the review action's "update existing comment, else
create" logic is a check-then-act with no lock: concurrent runs all see
"no comment yet" and each create one.

On PR #6 that produced five concurrent runs and two independent review
comments with different scores (9.2 and 9.0), plus five full model calls
where one was intended.

Add a per-PR concurrency group so runs queue instead of racing β€” the
first creates the comment, any later run updates it. cancel-in-progress
is left false on purpose: the labels are applied in one API call so event
order is not guaranteed, and cancelling would let a `labeled` event for
'automated' kill the in-flight review and then skip its own job, leaving
no review at all.

Also ignore `labeled` events for labels other than 'action-translation',
which removes the redundant review triggered by the 'automated' label.

The underlying unsynchronised upsert is tracked in
QuantEcon/action-translation#96.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
mmcky added a commit that referenced this pull request Jul 16, 2026
A single translation sync fires `opened` plus one `labeled` event per
label applied, all within a couple of seconds. Each starts its own run of
this workflow, and the review action's "update existing comment, else
create" logic is a check-then-act with no lock: concurrent runs all see
"no comment yet" and each create one.

On PR #6 that produced five concurrent runs and two independent review
comments with different scores (9.2 and 9.0), plus five full model calls
where one was intended.

Add a per-PR concurrency group so runs queue instead of racing β€” the
first creates the comment, any later run updates it. cancel-in-progress
is left false on purpose: the labels are applied in one API call so event
order is not guaranteed, and cancelling would let a `labeled` event for
'automated' kill the in-flight review and then skip its own job, leaving
no review at all.

Also ignore `labeled` events for labels other than 'action-translation',
which removes the redundant review triggered by the 'automated' label.

The underlying unsynchronised upsert is tracked in
QuantEcon/action-translation#96.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mmcky mmcky merged commit 82d62aa into main Jul 16, 2026
6 checks passed
mmcky added a commit that referenced this pull request Jul 16, 2026
The v0.16.1 sync path did not apply deterministic typography, so PR #6
regressed 14 lines of numba.md from U+00A0 to plain spaces before high
punctuation (documented in QuantEcon/action-translation#97). This re-runs
scripts/typography/apply.mjs --lang fr, whose postcondition verifies the
only difference is spacing before ; : ! ?. One net-new non-breaking space
relative to the seed comes from a line #6 added.

The action-side fix so syncs stop stripping these landed in
QuantEcon/action-translation#99, with matching hardened in
QuantEcon/action-translation#100.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants