Skip to content

🌐 [translation-sync] [need_for_speed.md] Update np.random → Generator API#119

Open
mmcky wants to merge 2 commits intomainfrom
translation-sync-2026-05-05T13-05-00-pr-545
Open

🌐 [translation-sync] [need_for_speed.md] Update np.random → Generator API#119
mmcky wants to merge 2 commits intomainfrom
translation-sync-2026-05-05T13-05-00-pr-545

Conversation

@mmcky
Copy link
Copy Markdown
Contributor

@mmcky mmcky commented May 5, 2026

Automated Translation Sync

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

Source PR

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

Files Updated

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

Details

  • Source Language: en
  • Target Language: fa
  • Model: claude-sonnet-4-6

This PR was created automatically by the translation action.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 5, 2026

Deploy Preview for majestic-griffin-10b166 ready!

Name Link
🔨 Latest commit 4d7f1b2
🔍 Latest deploy log https://app.netlify.com/projects/majestic-griffin-10b166/deploys/69f9eb0298a6c800085fa98d
😎 Deploy Preview https://deploy-preview-119--majestic-griffin-10b166.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

✅ Translation Quality Review

Verdict: PASS | Model: claude-sonnet-4-6 | Date: 2026-05-05


📝 Translation Quality

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

Summary: The translation of the 'Vectorization vs pure Python loops' section is generally accurate and well-formatted. Terminology follows the reference glossary correctly. Minor fluency issues exist around the phrasing of 'non-vectorized code' and the step description 'draw n uniforms', which could be expressed more naturally in Persian. The inline English code comment is left untranslated, which may be intentional but is worth flagging for consistency. Technical terminology is consistently and correctly applied throughout the changed section, matching the reference glossary (e.g., 'برداری‌سازی' for Vectorization, 'حلقه' for loop). The MyST/Markdown formatting, including code cells, directives, and list structures, is fully preserved in the changed section. The overall structure and meaning of the 'Vectorization vs pure Python loops' section is accurately conveyed, including the three-step breakdown of the vectorized operation.

Suggestions:

  • Section 'برداری‌سازی در مقابل حلقه‌های پایتون خالص', code comment: 'y = 0 # Will accumulate and store sum' — The inline code comment is left in English. Consider translating to '# مقدار جمع را ذخیره و انباشت می‌کند' for consistency with a Persian-language document.
  • Section 'برداری‌سازی در مقابل حلقه‌های پایتون خالص', step list: '1. n uniform را بکشید' — The phrase 'بکشید' (draw/pull) is an unusual rendering of 'draw n uniforms'. A clearer phrasing would be '1. n عدد تصادفی یکنواخت تولید کنید' to match the technical meaning.
  • Section 'برداری‌سازی در مقابل حلقه‌های پایتون خالص': 'در اینجا مقداری کد غیر برداری شده وجود دارد که از یک حلقه بومی پایتون برای تولید، مجذور کردن و سپس جمع کردن تعداد زیادی متغیر تصادفی استفاده می‌کند' — 'کد غیر برداری شده' is slightly awkward; 'کد بدون برداری‌سازی' or 'کد غیربرداری‌سازی‌شده' would be more natural.
  • Section 'برداری‌سازی در مقابل حلقه‌های پایتون خالص': 'کد برداری شده زیر از NumPy استفاده می‌کند که به زودی آن را به تفصیل بررسی خواهیم کرد، تا همان کار را انجام دهد.' — This sentence is awkward due to the embedded relative clause. Suggested: 'کد برداری‌سازی‌شده زیر از NumPy—که به زودی آن را به تفصیل بررسی خواهیم کرد—برای انجام همان کار استفاده می‌کند.'

🔍 Diff Quality

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

Summary: The translation correctly mirrors the source change, replacing the old vectorized code block with the new RNG-based implementation in the same position, with no structural or metadata issues.


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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Syncs the Persian translation of need_for_speed.md with upstream changes that migrate an example from the legacy np.random API to the newer numpy.random.Generator API, keeping the translated lecture aligned with the source repository.

Changes:

  • Updated the NumPy vectorization example to create a rng = np.random.default_rng() and use rng.uniform(...) instead of np.random.uniform(...).
  • Updated translation sync state metadata (source-sha, synced-at) for need_for_speed.md.

Reviewed changes

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

File Description
lectures/need_for_speed.md Updates the random sampling example to use NumPy’s Generator API (default_rng + rng.uniform).
.translate/state/need_for_speed.md.yml Updates translation sync tracking metadata to reflect the new upstream source revision and sync date.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

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