Skip to content

🌐 [translation-sync] [scipy.md] Update np.random → Generator API#120

Open
mmcky wants to merge 2 commits intomainfrom
translation-sync-2026-05-08T09-34-53-pr-547
Open

🌐 [translation-sync] [scipy.md] Update np.random → Generator API#120
mmcky wants to merge 2 commits intomainfrom
translation-sync-2026-05-08T09-34-53-pr-547

Conversation

@mmcky
Copy link
Copy Markdown
Contributor

@mmcky mmcky commented May 8, 2026

Automated Translation Sync

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

Source PR

#547 - [scipy.md] Update np.random → Generator API

Files Updated

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

Deploy Preview for majestic-griffin-10b166 ready!

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

✅ Translation Quality Review

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


📝 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 three modified sections (Random Variables and Distributions, Other Goodies in scipy.stats, and Exercises) is of high quality. Accuracy is strong with correct rendering of statistical and financial concepts. Formatting and MyST structure are fully preserved. Minor improvements include translating 'cdf' with its Persian glossary equivalent in running text, using 'مونت‌کارلو' consistently per the glossary, and slightly strengthening phrasing in 'Other Goodies'. No syntax errors were found. Mathematical notation and LaTeX equations are perfectly preserved throughout the changed sections Technical terms such as 'چندک' (quantile), 'چگالی' (density), 'رگرسیون خطی ساده' (simple linear regression), and 'امید ریاضی' (expectation) are used accurately and consistently with the reference glossary The exercise descriptions (sp_ex01, sp_ex02, sp_ex03) are translated with high accuracy, preserving all mathematical and financial concepts such as 'اختیار خرید اروپایی', 'توزیع لگاریتم نرمال', and 'قانون اعداد بزرگ' Code cells, hints, and solution blocks retain correct MyST directive syntax throughout the modified sections The sentence structure flows naturally in Persian academic register, avoiding overly literal constructions

Suggestions:

  • Other Goodies in scipy.stats - 'There are a variety of statistical functions' → 'انواع توابع آماری در scipy.stats وجود دارد' is slightly vague; a more precise rendering would be 'طیف گسترده‌ای از توابع آماری در scipy.stats وجود دارد' to better capture 'a variety of'

  • Random Variables and Distributions - 'Sometimes we need access to the density itself, or the cdf, the quantiles, etc.' → 'گاهی اوقات ما نیاز به دسترسی به خود چگالی، یا cdf، چندک‌ها و غیره داریم' — the use of 'ما' (we) is grammatically acceptable but slightly formal; dropping it ('گاهی اوقات نیاز به دسترسی به خود چگالی، تابع توزیع تجمعی (cdf)، چندک‌ها و غیره داریم') and translating 'cdf' parenthetically would improve fluency and consistency with the glossary term 'تابع توزیع تجمعی'

  • Exercises - sp_ex03: 'سعی کنید با استفاده از Monte Carlo برای محاسبه عبارت امید ریاضی در قیمت اختیار، به جای quad، به نتیجه مشابهی برسید' — 'Monte Carlo' should follow the glossary and be rendered as 'مونت‌کارلو'


🔍 Diff Quality

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

Summary: All translation changes are correctly applied: code cells updated to use rng-based API in the same positions as the source, translated prose adjusted accordingly, and the frontmatter heading-map is unchanged and still valid.


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 translation-sync PR updates the Persian scipy.md lecture to match upstream changes that move examples from the legacy np.random.* global RNG API to the newer np.random.default_rng() Generator-based API.

Changes:

  • Replaced np.random.beta and np.random.randn usage with a Generator instance (rng) and rng.beta / rng.standard_normal.
  • Added rng = np.random.default_rng() in relevant sections.
  • Updated translation sync state metadata (source-sha, synced-at, model, tool version).

Reviewed changes

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

File Description
lectures/scipy.md Updates random-number examples to use default_rng() / Generator API.
.translate/state/scipy.md.yml Updates translation sync metadata to reflect the new upstream source and tooling.

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

Comment thread lectures/scipy.md
Comment on lines 209 to 211
```{code-cell} python3
from scipy.stats import linregress

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 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