Skip to content

🌐 [translation-sync] [python_essentials.md] Update np.random → Generator API#117

Open
mmcky wants to merge 2 commits intomainfrom
translation-sync-2026-05-02T03-08-27-pr-544
Open

🌐 [translation-sync] [python_essentials.md] Update np.random → Generator API#117
mmcky wants to merge 2 commits intomainfrom
translation-sync-2026-05-02T03-08-27-pr-544

Conversation

@mmcky
Copy link
Copy Markdown
Contributor

@mmcky mmcky commented May 2, 2026

Automated Translation Sync

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

Source PR

#544 - [python_essentials.md] Update np.random → Generator API

Files Updated

  • ✏️ lectures/python_essentials.md
  • ✏️ .translate/state/python_essentials.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 2, 2026

Deploy Preview for majestic-griffin-10b166 ready!

Name Link
🔨 Latest commit beebb93
🔍 Latest deploy log https://app.netlify.com/projects/majestic-griffin-10b166/deploys/69f56ab00330970008596ab0
😎 Deploy Preview https://deploy-preview-117--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 2, 2026

✅ Translation Quality Review

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


📝 Translation Quality

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

Summary: The Exercises section translation is of high quality. All exercise instructions, hints, solutions, and mathematical content are accurately translated. The Persian reads naturally with appropriate academic register. Technical terms are consistently handled. Only minor stylistic refinements could improve the translation further, such as standardizing function notation style and minor phrasing adjustments for formal register. Exercise instructions are accurately translated with all technical details preserved, including mathematical notation and code references Solution labels like 'راه‌حل قسمت 1' and 'راه‌حل قسمت 2' are consistently and naturally translated throughout the Exercises section Hint sections are correctly translated with proper dropdown formatting preserved The term 'خلاصه لیست' for 'list comprehension' and 'ضرب داخلی' for 'inner product' are appropriate and consistent with the glossary conventions Mathematical expressions and LaTeX equations in exercise descriptions are fully preserved without alteration

Suggestions:

  • Exercise 1, Part 1 description: 'ضرب داخلی آن‌ها را با استفاده از ()zip محاسبه کنید' → The parentheses placement in '()zip' should be 'zip()' to match standard Persian technical writing convention used elsewhere in the document (e.g., '()sum' vs 'sum()'). The document inconsistently uses both styles; standardizing to 'zip()' would be more consistent with Persian RTL text flow.
  • Exercise 2 description: 'تابع p را بنویسید به طوری که p(x, coeff) مقدار را در {eq}polynom0 با توجه به نقطه x و لیست ضرایب coeff ($a_1, a_2, \cdots a_n$) محاسبه کند.' → The source says 'a list of coefficients coeff (a_1, a_2, ⋯ a_n)' implying a_0 through a_n. The Persian translation preserves this accurately but could note a_0 as the starting index for clarity, matching the formula above.
  • Exercise 5 description: 'بدون استفاده از هیچ import' → Consider 'بدون استفاده از هیچ‌گونه import' for more natural Persian phrasing in formal/academic register.
  • Exercise 6 intro: 'با استفاده از سینتکس خلاصه لیست، می‌توانیم حلقه در کد زیر را ساده کنیم.' → The source says 'we can simplify the loop in the following code.' The Persian translation is accurate but 'ساده کنیم' could be 'ساده‌سازی کنیم' or 'ساده‌تر کنیم' for slightly better fluency.

🔍 Diff Quality

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

Summary: The translation target document correctly mirrors the source changes in exercise 6, updating the deprecated np.random.randn() to rng = np.random.default_rng() / rng.standard_normal() pattern in both the exercise body and solution, 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

This automated translation-sync PR updates the Persian python_essentials lecture to match upstream source PR #544, which modernizes one exercise and its solution from the legacy global np.random API to NumPy’s Generator API. In this codebase, that keeps the translated lecture content aligned with the English source while also refreshing the translation state metadata.

Changes:

  • Replaced np.random.randn() with a local rng = np.random.default_rng() plus rng.standard_normal() in the affected exercise snippet.
  • Applied the same Generator-based update to the corresponding solution snippet.
  • Refreshed .translate/state/python_essentials.md.yml with the new source SHA, sync date, model, mode, and tool version.

Reviewed changes

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

File Description
lectures/python_essentials.md Syncs one exercise/solution pair to the upstream NumPy Generator API example.
.translate/state/python_essentials.md.yml Updates translation sync bookkeeping for this lecture.

💡 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 2, 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