Skip to content

🌐 [translation-sync] Read test_pwt.csv from data-lectures (Track D) - #153

Merged
mmcky merged 4 commits into
mainfrom
translation-sync-2026-08-18T01-15-21-pr-612
Aug 18, 2026
Merged

🌐 [translation-sync] Read test_pwt.csv from data-lectures (Track D)#153
mmcky merged 4 commits into
mainfrom
translation-sync-2026-08-18T01-15-21-pr-612

Conversation

@mmcky

@mmcky mmcky commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Automated Translation Sync

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

Source PR

#612 - Read test_pwt.csv from data-lectures (Track D)

Files Updated

  • ✏️ lectures/pandas.md
  • ✏️ .translate/state/pandas.md.yml
  • ✏️ lectures/polars.md
  • ✏️ .translate/state/polars.md.yml

Details

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

This PR was created automatically by the translation action.

Copilot AI lite review requested due to automatic review settings August 18, 2026 01:15
@mmcky mmcky added action-translation PRs created by QuantEcon/action-translation automated Automated sync PR opened by action-translation labels Aug 18, 2026
@netlify

netlify Bot commented Aug 18, 2026

Copy link
Copy Markdown

Deploy Preview for majestic-griffin-10b166 ready!

Name Link
🔨 Latest commit b81ad41
🔍 Latest deploy log https://app.netlify.com/projects/majestic-griffin-10b166/deploys/6a83d0b11317040008f2c9e5
😎 Deploy Preview https://deploy-preview-153--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

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown

✅ Translation Quality Review

Verdict: PASS | Model: claude-sonnet-5 | Date: 2026-08-18
Routing: editor — 4 major finding(s); 1 minor finding(s) in gating categories (accuracy/terminology/syntax/diff-check/other); accuracy 6 below floor 9; terminology 7 below floor 9
Shadow gate: would NOT auto-merge (recorded only; no action taken)


📝 Translation Quality

Criterion Score
Accuracy 6/10
Fluency 8/10
Terminology 7/10
Formatting 9/10
Overall 7.2/10

Summary: The prose translation in the modified sections is fluent, accurate, and well-formatted, with correct MyST syntax throughout. However, there are several code-cell discrepancies where the Persian translation did not update code to match the modified English source: the pandas.md and polars.md Series sections still use the old np.random.randn(4) pattern instead of the new rng.standard_normal(4) pattern (missing the rng = np.random.default_rng() line in pandas.md), and the polars.md pl_ex1 solution omits .drop_nulls() calls present in the source. These are functional/accuracy issues in code that a technical reader would notice, and should be corrected to match the source exactly. The prose/explanatory text in the modified sections (Overview, Series, DataFrames, On-Line Data Sources, Exercises, Eager vs lazy, Performance comparison) is translated fluently and accurately, with correct rendering of technical concepts like lazy evaluation, predicate pushdown, and projection pushdown. MyST/Markdown structure, code fences, directives, and links are fully preserved with no syntax errors. Terminology is largely consistent with the glossary and Polars-specific concepts (ارزیابی تنبل، بهینه‌سازی پرس‌وجو) are handled well and consistently across headings and body text.

Suggestions:

  • [major · accuracy] lectures/pandas.md — ## Series: The English source uses rng = np.random.default_rng() followed by s = pd.Series(rng.standard_normal(4), name='daily returns'), but the Persian translation reverted to the old code s = pd.Series(np.random.randn(4), name='daily returns') and omitted the rng = np.random.default_rng() line entirely. This is a code accuracy error in a section explicitly marked as modified. → Restore the modified code cell exactly as in the English source: include rng = np.random.default_rng() and use rng.standard_normal(4).
  • [major · accuracy] lectures/polars.md — ## Series: The English source code cell reads s = pl.Series(name='daily returns', values=rng.standard_normal(4)), relying on a previously created rng object, but the Persian translation uses s = pl.Series(name='daily returns', values=np.random.randn(4)), diverging from the modified source code. → Use values=rng.standard_normal(4) to match the English source's updated code.
  • [major · accuracy] lectures/polars.md — ## DataFrames (Series example) — 'company': ... 'daily returns': np.random.randn(4): Similarly, the DataFrame creation example in the English source uses rng.standard_normal(4) for the 'daily returns' column, but the Persian translation uses np.random.randn(4), which is inconsistent with the modified source and does not use the rng generator introduced earlier in the section. → Change to 'daily returns': rng.standard_normal(4) to match the source exactly.
  • [major · accuracy] lectures/polars.md — solution pl_ex1 — price_change calculation: The English source solution uses pl.col(tick).drop_nulls().last() / pl.col(tick).drop_nulls().first() (accounting for potential nulls from full outer joins), but the Persian translation's code cell uses pl.col(tick).last() / pl.col(tick).first() without .drop_nulls(), which changes the logic and could produce incorrect/null results if any ticker has missing values at the join boundaries. → Restore .drop_nulls() calls: (pl.col(tick).drop_nulls().last() / pl.col(tick).drop_nulls().first() - 1) * 100.
  • [minor · terminology] lectures/polars.md — ### Performance comparison: The English source phrase 'a grouped weighted average' is not explicitly translated as a standalone term in the Persian text; the translation paraphrases correctly but readers looking for a direct terminological anchor (e.g., 'میانگین وزنی گروه‌بندی‌شده') may find it slightly buried in the sentence. This is a very minor style point, not an error.

🔍 Diff Quality

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

Summary: All source changes (URL updates and RNG-related code reverts) were correctly and precisely mirrored in the target document at matching positions, with document structure and heading metadata preserved.


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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 (fa) versions of the Pandas and Polars lectures to match upstream changes from QuantEcon/lecture-python-programming, primarily switching the test_pwt.csv dataset source to the QuantEcon/data-lectures repository and aligning a few code examples.

Changes:

  • Update Pandas and Polars lecture examples to read test_pwt.csv from https://github.com/QuantEcon/data-lectures/raw/main/lectures/test_pwt.csv.
  • Refresh a few code snippets (e.g., NumPy RNG usage in the Polars lecture; isinstance / pd.isna usage in Pandas lecture).
  • Update translation state metadata (source SHA, sync date, model/tool versions).

Reviewed changes

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

File Description
lectures/pandas.md Switches test_pwt.csv read to data-lectures URL and aligns a couple Pandas mapping/NA-handling examples.
lectures/polars.md Switches test_pwt.csv read to data-lectures URL, updates RNG example to default_rng, and minor formatting alignment.
.translate/state/pandas.md.yml Updates translation sync state metadata for pandas.md.
.translate/state/polars.md.yml Updates translation sync state metadata for polars.md.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@mmcky
mmcky force-pushed the translation-sync-2026-08-18T01-15-21-pr-612 branch from 2d113fd to 7a5c3ab Compare August 18, 2026 03:13
@mmcky

mmcky commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

♻️ Automatically rebased after #147 was merged.

Overlapping files: lectures/polars.md

The translation content is preserved; only unchanged sections were updated to match the current main branch. Please re-review if needed.

@mmcky mmcky closed this Aug 18, 2026
@mmcky
mmcky force-pushed the translation-sync-2026-08-18T01-15-21-pr-612 branch from 740c738 to b0dcc5a Compare August 18, 2026 03:17
@mmcky

mmcky commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

♻️ Automatically rebased after #149 was merged.

Overlapping files: lectures/pandas.md

The translation content is preserved; only unchanged sections were updated to match the current main branch. Please re-review if needed.

@mmcky mmcky reopened this Aug 18, 2026
@github-actions

Copy link
Copy Markdown

@github-actions
github-actions Bot temporarily deployed to pull request August 18, 2026 03:32 Inactive
@mmcky
mmcky merged commit 39f9f7d into main Aug 18, 2026
7 checks passed
@mmcky
mmcky deleted the translation-sync-2026-08-18T01-15-21-pr-612 branch August 18, 2026 03:37
mmcky added a commit that referenced this pull request Aug 18, 2026
The #154 sync was regenerated from its source PR's merge-time snapshot,
which predates the test_pwt repoint synced here in #153 — so it
reverted two polars.md reads to the source repo's old own-repo URL (a
path scheduled for deletion) and rewrote three pandas_panel.md reads
to the raw.githubusercontent host form. This restores all five reads
to the canonical data-lectures form the English source uses. URL-only;
no translated text changes. The underlying regeneration defect is
recorded in QuantEcon/action-translation#276.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
mmcky added a commit that referenced this pull request Aug 19, 2026
…URL form (#158)

Restore .translate/state/{pandas,polars}.md.yml to the versions #153 wrote (source-sha 55c87c9f, the Track D repoint) — #154 overwrote them with the stale snapshot's SHA (d35eb831), making isSourceChanged over-report both lectures as pending. Also revert the pandas_panel.md half of #155: the three data reads return to the raw.githubusercontent form, which is what source main itself serves at its last touch of that file — the regeneration's rewrite there was correct sync content, not stale damage.

Measurement and ledger: QuantEcon/action-translation#276.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action-translation PRs created by QuantEcon/action-translation automated Automated sync PR opened by action-translation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants