From 290b2b38b1b38ab842e19b0205c02088e2cea72d Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Fri, 20 Mar 2026 16:12:43 +1100 Subject: [PATCH 1/3] Resync stale translations to current source via forward - status.md: added missing GPU access and JAX backend sections - python_by_example.md: restored missing index directives and doc links --- lectures/python_by_example.md | 52 +++++++++++++++++++++++++++++------ lectures/status.md | 14 ++++++++++ 2 files changed, 57 insertions(+), 9 deletions(-) diff --git a/lectures/python_by_example.md b/lectures/python_by_example.md index 1b50fdf..54219df 100644 --- a/lectures/python_by_example.md +++ b/lectures/python_by_example.md @@ -10,8 +10,19 @@ kernelspec: --- (python_by_example)= +```{raw} jupyter +
+ + QuantEcon + +
+``` + # یک مثال مقدماتی +```{index} single: Python; Introductory Example +``` + ## مقدمه حال ما آماده ایم تا یادگیری زبان برنامه نویسی پایتون را آغاز کنیم. @@ -22,15 +33,14 @@ kernelspec: پیش از شروع این درس، باید جلسه ی قبل را مطالعه کرده باشید. + ## هدف:رسم یک فرآیند نویز سفید فرض کنید می‌خواهیم فرآیند نویز سفید $\epsilon_0, \epsilon_1, \ldots, \epsilon_T$ را شبیه‌سازی و رسم کنیم، که در آن هر نقطه $\epsilon_t$ مستقل و نرمال استاندارد است. به بیان دیگر، می خواهیم نمودارهایی همانند نمودار زیر تولید کنیم: -```{figure} _static/lecture_specific/python_by_example/test_program_1_updated.png -:name: pbe_white_noise -:figclass: auto +```{figure} /_static/lecture_specific/python_by_example/test_program_1_updated.png :scale: 120 ``` @@ -81,6 +91,7 @@ np.sqrt(4) np.log(4) ``` + #### چرا در برنامه نویسی پایتون، از Importهای متعددی استفاده می شود؟ برنامه های پایتون معمولا به چندین دستور `import` نیاز دارند. @@ -89,8 +100,12 @@ np.log(4) وقتی بخواهید کارهای جالب تر و پیشرفته تری با پایتون انجام دهید، تقریبا همیشه باید قابلیت های اضافی را با استفاده از `import` به برنامه اضافه کنید. + #### پکیج ها(Packages) +```{index} single: Python; Packages +``` + همانطور که پیشتر گفته شد، NumPy یک پکیج پایتونی است. پکیج ها ابزاری هستند که توسعه دهندگان برای سازمان دهی کدی که می خواهند به اشتراک بگذارند از آن ها استفاده می کنند. @@ -117,6 +132,9 @@ print(np.__file__) #### زیرپکیج ها (Subpackages) +```{index} single: Python; Subpackages +``` + به خط حاوی `ϵ_values = np.random.randn(100)` در کد توجه کنید. در این دستور، `np` به پکیج NumPY اشاره دارد، و `random` یک زیرپکیج از NumPY است. @@ -165,15 +183,15 @@ plt.show() ## روش های دیگر پیاده سازی برنامه -بیایید چندتا نسخه ی جایگزین برای اولین برنامه مان بنویسیم؛ برنامه ای که مقادیر تصادفی مستقل و با توزیع یکسان (IID) از توزیع نرمال استاندارد را رسم می کرد. +بیایید چندتا نسخه ی جایگزین برای {ref}`اولین برنامه مان ` بنویسیم؛ برنامه ای که مقادیر تصادفی مستقل و با توزیع یکسان (IID) از توزیع نرمال استاندارد را رسم می کرد. برنامه هایی که در ادامه می بینید، نسبت به نسخه اصلی کارایی کمتری دارند و از این نظر کمی غیرطبیعی هستند. اما آنها به ما کمک می کنند تا برخی از سینتکس ها و معانی مهم پایتون را در یک محیط آشنا نشان دهیم. ### یک نسخه با حلقه تکرار For -(firstloopprog)= -این نسخه حلقه های `For` و لیست های پایتون را نشان می دهد. +در اینجا نسخه ای آمده که حلقه های `for` و لیست های پایتون را نشان می دهد. +(firstloopprog)= ```{code-cell} python3 ts_length = 100 ϵ_values = [] # empty list @@ -205,6 +223,9 @@ plt.show() (lists_ref)= ### لیست ها +```{index} single: Python; Lists +``` + دستور `ϵ_values = []` را در نظر بگیرید، این دستور یک لیست خالی ایجاد می کند. لیست ها یک ساختار داده داخلی در پایتون هستند که برای گروه بندی مجموعه ای از اشیا استفاده می شوند. @@ -265,7 +286,10 @@ x[1] # second element of x ### حلقه For -حالا بیایید حلقه `for` از برنامه ای که قبلا نوشتیم را دوباره بررسی کنیم: +```{index} single: Python; For loop +``` + +حالا بیایید حلقه `for` از {ref}`برنامه ای که قبلا نوشتیم ` را دوباره بررسی کنیم: ```{code-cell} python3 for i in range(ts_length): @@ -302,8 +326,12 @@ for variable_name in sequence: * برای هر عنصر از دنباله `sequence`، نام متغیر `variable_name` را به آن عنصر متصل (blind) می کند و سپس بلوک کد را اجرا می کند. + ### یادداشتی درباره تورفتگی (Indentation) +```{index} single: Python; Indentation +``` + در بحث درباره حلقه `for` توضیح دادیم که بلوک های کدی که در حلقه تکرار می شوند با تورفتگی (indentation) مشخص می شوند. در واقع در پایتون، **همه** بلوک های کد (شامل آن هایی که درون حلقه ها، شروط if، تعریف توابع و موارد مشابه قرار دارند) با تورفتگی از یکدیگر متمایز می شوند. @@ -324,18 +352,22 @@ for variable_name in sequence: * `for i in range(10):` * `if x > y:` * `while x < 100:` + * و غیره. * همه ی خطوط داخل یک بلوک کد باید مقدار یکسانی تورفتگی داشته باشند. * استاندارد پایتون برای تورفتگی، 4 فاصله (space) است و شما هم باید از همین مقدار استقاده کنید. -(whileloopprog)= ### حلقه های While +```{index} single: Python; While loop +``` + حلقه `for` رایج ترین تکنیک برای تکرار در پایتون است. -اما برای توضیح بهتر، اجازه دهید برنامه ای را که قبلا نوشتیم، تغییر دهیم و از یک حلقه `while` به جای آن استقاده کنیم. +اما برای توضیح بهتر، اجازه دهید {ref}`برنامه ای را که قبلا نوشتیم ` تغییر دهیم و از یک حلقه `while` به جای آن استقاده کنیم. +(whileloopprog)= ```{code-cell} python3 ts_length = 100 ϵ_values = [] @@ -454,6 +486,7 @@ plt.show() ```{solution-end} ``` + ```{exercise-start} :label: pbe_ex2 @@ -546,6 +579,7 @@ plt.show() ```{solution-end} ``` + ```{exercise-start} :label: pbe_ex4 ``` diff --git a/lectures/status.md b/lectures/status.md index 7bfe4f0..5ae03dc 100644 --- a/lectures/status.md +++ b/lectures/status.md @@ -31,4 +31,18 @@ kernelspec: ```{code-cell} ipython :tags: [hide-output] !conda list +``` + +این مجموعه سخنرانی‌ها به GPU زیر دسترسی دارد + +```{code-cell} ipython +!nvidia-smi +``` + +می‌توانید backend مورد استفاده توسط JAX را با استفاده از دستور زیر بررسی کنید: + +```{code-cell} ipython3 +import jax +# Check if JAX is using GPU +print(f"JAX backend: {jax.devices()[0].platform}") ``` \ No newline at end of file From 6435701722d12d9ceb139b0e96050a3d84532894 Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Fri, 20 Mar 2026 16:14:01 +1100 Subject: [PATCH 2/3] Update heading-maps to full-text key format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 4 files: new heading-maps generated (about_py, functions, getting_started, python_by_example) - 19 files: updated from slug-based to full heading text with :: nesting - 2 files: unchanged (intro, status — section-less) - Fix YAML quoting for heading containing colon (python_essentials.md) --- lectures/about_py.md | 17 +++++++++ lectures/debugging.md | 22 +++++------ lectures/functions.md | 17 +++++++++ lectures/getting_started.md | 27 +++++++++++++ lectures/jax_intro.md | 52 +++++++++++++------------ lectures/matplotlib.md | 28 +++++++------- lectures/names.md | 20 +++++----- lectures/need_for_speed.md | 57 ++++++++++++++-------------- lectures/numba.md | 24 ++++++------ lectures/numpy.md | 38 +++++++++---------- lectures/numpy_vs_numba_vs_jax.md | 27 ++++++------- lectures/oop_intro.md | 20 +++++----- lectures/pandas.md | 24 ++++++------ lectures/pandas_panel.md | 12 +++--- lectures/python_advanced_features.md | 48 +++++++++++------------ lectures/python_by_example.md | 18 +++++++++ lectures/python_essentials.md | 42 ++++++++++---------- lectures/python_oop.md | 28 +++++++------- lectures/scipy.md | 34 ++++++++--------- lectures/sympy.md | 36 +++++++++--------- lectures/troubleshooting.md | 4 +- lectures/workspace.md | 19 +++++----- lectures/writing_good_code.md | 22 +++++------ 23 files changed, 360 insertions(+), 276 deletions(-) diff --git a/lectures/about_py.md b/lectures/about_py.md index 4c4e4c4..628c2d0 100644 --- a/lectures/about_py.md +++ b/lectures/about_py.md @@ -7,6 +7,23 @@ kernelspec: display_name: Python 3 language: python name: python3 +heading-map: + Overview: مقدمه + Overview::Can't I Just Use LLMs?: آیا نمیتوانم فقط از مدل های زبانی بزرگ (LLM) استفاده کنم؟ + Overview::Isn't MATLAB Better?: آیا Matlab بهتر نیست؟ + Introducing Python: برنامه نویسی پایتون چیست؟ + Introducing Python::Common Uses: کاربردهای رایج پایتون + Introducing Python::Relative Popularity: جایگاه محبوبیت + Introducing Python::Features: ویژگی ها + Introducing Python::Syntax and Design: نحو و طراحی + Introducing Python::The AI Connection: ارتباط با هوش مصنوعی + Scientific Programming with Python: برنامه نویسی علمی با پایتون + Scientific Programming with Python::NumPy: NumPy + Scientific Programming with Python::NumPy Alternatives: جایگزین های NumPy + Scientific Programming with Python::SciPy: SciPy + Scientific Programming with Python::Graphics: گرافیک + Scientific Programming with Python::Networks and Graphs: شبکه ها و نمودارها + Scientific Programming with Python::Other Scientific Libraries: سایرکتابخانه های علمی --- # درباره ی این دوره diff --git a/lectures/debugging.md b/lectures/debugging.md index 456dd10..96ae0be 100644 --- a/lectures/debugging.md +++ b/lectures/debugging.md @@ -8,17 +8,17 @@ kernelspec: language: python name: python3 heading-map: - overview: مرور کلی - debugging: اشکال‌زدایی - the-debug-magic: دستور جادویی `debug` - setting-a-break-point: تنظیم یک نقطه توقف - other-useful-magics: دستورات جادویی مفید دیگر - handling-errors: مدیریت خطاها - errors-in-python: خطاها در Python - assertions: ادعاها - handling-errors-during-runtime: مدیریت خطاها در حین اجرا - catching-exceptions: گرفتن استثناها - exercises: تمرین‌ها + Overview: مرور کلی + Debugging: اشکال‌زدایی + Debugging::The `debug` Magic: دستور جادویی `debug` + Debugging::Setting a Break Point: تنظیم یک نقطه توقف + Debugging::Other Useful Magics: دستورات جادویی مفید دیگر + Handling Errors: مدیریت خطاها + Handling Errors::Errors in Python: خطاها در Python + Handling Errors::Assertions: ادعاها + Handling Errors::Handling Errors During Runtime: مدیریت خطاها در حین اجرا + Handling Errors::Handling Errors During Runtime::Catching Exceptions: گرفتن استثناها + Exercises: تمرین‌ها --- (debugging)= diff --git a/lectures/functions.md b/lectures/functions.md index b3fda59..6ebe704 100644 --- a/lectures/functions.md +++ b/lectures/functions.md @@ -7,6 +7,23 @@ kernelspec: display_name: Python 3 language: python name: python3 +heading-map: + Overview: مقدمه + Function Basics: اصول اولیه توابع + Function Basics::Built-In Functions: توابع داخلی(Built-In) + Function Basics::Third Party Functions: توابع خارجی(Third Party) + Defining Functions: تعریف توابع + Defining Functions::Basic Syntax: نحو پایه + Defining Functions::Keyword Arguments: آرگومان‌های کلیدواژه‌ای + Defining Functions::The Flexibility of Python Functions: انعطاف‌پذیری توابع پایتون + 'Defining Functions::One-Line Functions: `lambda`': 'توابع یک خطی: `lambda`' + Defining Functions::Why Write Functions?: چرا تابع بنویسیم؟ + Applications: کاربردها + Applications::Random Draws: نمونه‌برداری تصادفی + Applications::Adding Conditions: اضافه کردن شرط‌ها + Recursive Function Calls (Advanced): فراخوانی‌ توابع بازگشتی (پیشرفته) + Exercises: تمرینات + Advanced Exercises: تمرینات پیشرفته --- (functions)= diff --git a/lectures/getting_started.md b/lectures/getting_started.md index fc51c35..f427fd3 100644 --- a/lectures/getting_started.md +++ b/lectures/getting_started.md @@ -7,6 +7,33 @@ kernelspec: display_name: Python 3 language: python name: python3 +heading-map: + Overview: مقدمه + Python in the Cloud: پایتون در فضای ابری + Local Install: نصب محلی + Local Install::The Anaconda Distribution: توزیع آناکوندا + Local Install::Installing Anaconda: نصب آناکوندا + Local Install::Updating `conda`: به روزرسانی آناکوندا + '{index}`Jupyter Notebooks `': '{index}`Jupyter Notebooks `' + '{index}`Jupyter Notebooks `::Starting the Jupyter Notebook': راه اندازی ژوپیتر نوت بوک + '{index}`Jupyter Notebooks `::Notebook Basics': اصول اولیه نوت بوک + '{index}`Jupyter Notebooks `::Notebook Basics::Running Cells': اجرای سلول ها + '{index}`Jupyter Notebooks `::Notebook Basics::Modal Editing': ویرایش در حالت های مختلف + '{index}`Jupyter Notebooks `::Notebook Basics::Inserting Unicode (e.g., Greek Letters)': وارد کردن یونیکد (مثلا حروف یونانی) + '{index}`Jupyter Notebooks `::Notebook Basics::A Test Program': یک برنامه ی آزمایشی + '{index}`Jupyter Notebooks `::Working with the Notebook': کارکردن با نوت بوک + '{index}`Jupyter Notebooks `::Working with the Notebook::Tab Completion': تکمیل خودکار با کلید Tab + '{index}`Jupyter Notebooks `::Working with the Notebook::On-Line Help': راهنمای آنلاین + '{index}`Jupyter Notebooks `::Working with the Notebook::Other Content': سایر محتواها + '{index}`Jupyter Notebooks `::Debugging Code': اشکال زدایی کد + '{index}`Jupyter Notebooks `::Sharing Notebooks': اشتراک گذاری نوت بوک ها + '{index}`Jupyter Notebooks `::QuantEcon Notes': سایت QuantEcon Note + Installing Libraries: نصب کتابخانه ها + Working with Python Files: کار با فایل های پایتون + Working with Python Files::Editing and Execution: ویرایش و اجرا + 'Working with Python Files::Editing and Execution::Option 1: {index}`JupyterLab `': 'گزینه اول: JupyterLab' + 'Working with Python Files::Editing and Execution::Option 2: Using a Text Editor': 'گزینه دوم: استفاده از یک ویرایشگر متن' + Exercises: تمرینات --- (getting_started)= diff --git a/lectures/jax_intro.md b/lectures/jax_intro.md index 50846b8..8a0bb4c 100644 --- a/lectures/jax_intro.md +++ b/lectures/jax_intro.md @@ -10,31 +10,33 @@ kernelspec: language: python name: python3 heading-map: - jax-as-a-numpy-replacement: JAX به عنوان جایگزین NumPy - similarities: شباهت‌ها - differences: تفاوت‌ها - precision: دقت - immutability: تغییرناپذیری - a-workaround: راه‌حل جایگزین - functional-programming: برنامه‌نویسی تابعی - pure-functions: توابع خالص - examples: مثال‌ها - random-numbers: اعداد تصادفی - random-number-generation: تولید اعداد تصادفی - why-explicit-random-state: چرا وضعیت تصادفی صریح؟ - numpys-approach: رویکرد NumPy - jaxs-approach: رویکرد JAX - jit-compilation: کامپایل JIT - a-simple-example: یک مثال ساده - with-numpy: با NumPy - with-jax: با JAX - changing-array-sizes: تغییر اندازه آرایه‌ها - evaluating-a-more-complicated-function: ارزیابی یک تابع پیچیده‌تر - compiling-the-whole-function: کامپایل کل تابع - compiling-non-pure-functions: کامپایل توابع غیرخالص - summary: خلاصه - gradients: گرادیان‌ها - exercises: تمرین‌ها + JAX as a NumPy Replacement: JAX به عنوان جایگزین NumPy + JAX as a NumPy Replacement::Similarities: شباهت‌ها + JAX as a NumPy Replacement::Differences: تفاوت‌ها + JAX as a NumPy Replacement::Differences::Precision: دقت + JAX as a NumPy Replacement::Differences::Immutability: تغییرناپذیری + JAX as a NumPy Replacement::Differences::A workaround: راه‌حل جایگزین + Functional Programming: برنامه‌نویسی تابعی + Functional Programming::Pure functions: توابع خالص + Functional Programming::Examples: مثال‌ها + Random numbers: اعداد تصادفی + Random numbers::Random number generation: تولید اعداد تصادفی + Random numbers::Why explicit random state?: چرا وضعیت تصادفی صریح؟ + Random numbers::Why explicit random state?::NumPy's approach: رویکرد NumPy + Random numbers::Why explicit random state?::JAX's approach: رویکرد JAX + JIT compilation: کامپایل JIT + JIT compilation::A simple example: یک مثال ساده + JIT compilation::A simple example::With NumPy: با NumPy + JIT compilation::A simple example::With JAX: با JAX + JIT compilation::A simple example::Changing array sizes: تغییر اندازه آرایه‌ها + JIT compilation::Evaluating a more complicated function: ارزیابی یک تابع پیچیده‌تر + JIT compilation::Evaluating a more complicated function::With NumPy: با NumPy + JIT compilation::Evaluating a more complicated function::With JAX: با JAX + JIT compilation::Compiling the Whole Function: کامپایل کل تابع + JIT compilation::Compiling non-pure functions: کامپایل توابع غیرخالص + JIT compilation::Summary: خلاصه + Gradients: گرادیان‌ها + Exercises: تمرین‌ها --- # JAX diff --git a/lectures/matplotlib.md b/lectures/matplotlib.md index 3ca9995..641c263 100644 --- a/lectures/matplotlib.md +++ b/lectures/matplotlib.md @@ -8,20 +8,20 @@ kernelspec: language: python name: python3 heading-map: - overview: مروری کلی - matplotlibs-split-personality: شخصیت دوگانه Matplotlib - the-apis: APIها - the-matlab-style-api: API به سبک MATLAB - the-object-oriented-api: API شی‌گرا - tweaks: تنظیمات ریز - more-features: ویژگی‌های بیشتر - multiple-plots-on-one-axis: نمودارهای چندگانه روی یک محور - multiple-subplots: زیرنمودارهای چندگانه - 3d-plots: نمودارهای سه بعدی - a-customizing-function: یک تابع سفارشی‌سازی - style-sheets: برگه‌های سبک - further-reading: مطالعه بیشتر - exercises: تمرین‌ها + Overview: مروری کلی + Overview::Matplotlib's Split Personality: شخصیت دوگانه Matplotlib + The APIs: APIها + The APIs::The MATLAB-style API: API به سبک MATLAB + The APIs::The Object-Oriented API: API شی‌گرا + The APIs::Tweaks: تنظیمات ریز + More Features: ویژگی‌های بیشتر + More Features::Multiple Plots on One Axis: نمودارهای چندگانه روی یک محور + More Features::Multiple Subplots: زیرنمودارهای چندگانه + More Features::3D Plots: نمودارهای سه بعدی + More Features::A Customizing Function: یک تابع سفارشی‌سازی + More Features::Style Sheets: برگه‌های سبک + Further Reading: مطالعه بیشتر + Exercises: تمرین‌ها --- (matplotlib)= diff --git a/lectures/names.md b/lectures/names.md index e9e3a61..635c3e5 100644 --- a/lectures/names.md +++ b/lectures/names.md @@ -8,16 +8,16 @@ kernelspec: language: python name: python3 heading-map: - overview: مقدمه - variable-names-in-python: نام‌های متغیر در پایتون - namespaces: فضاهای نام - viewing-namespaces: مشاهده فضاهای نام - interactive-sessions: محیط تعاملی - the-global-namespace: فضای نام سراسری - local-namespaces: فضاهای نام محلی - the-__builtins__-namespace: فضای نام داخلی (The `__builtins__` Namespace ) - name-resolution: Name Resolution - indexmutable-single-mutable-versus-indeximmutable-single-immutable-parameters: 'پارامترهای {index}`تغییرپذیر ` در مقابل {index}`تغییرناپذیر `' + Overview: مقدمه + Variable Names in Python: نام‌های متغیر در پایتون + Namespaces: فضاهای نام + Viewing Namespaces: مشاهده فضاهای نام + Interactive Sessions: محیط تعاملی + The Global Namespace: فضای نام سراسری یا جهانی(The Global Namespace) + Local Namespaces: فضای نام محلی(Local Namespaces) + The `__builtins__` Namespace: فضای نام داخلی (The `__builtins__` Namespace ) + Name Resolution: Name Resolution + 'Name Resolution::{index}`Mutable ` Versus {index}`Immutable ` Parameters': 'پارامترهای {index}`تغییرپذیر ` در مقابل {index}`تغییرناپذیر `' --- (oop_names)= diff --git a/lectures/need_for_speed.md b/lectures/need_for_speed.md index c10e291..f9b18dc 100644 --- a/lectures/need_for_speed.md +++ b/lectures/need_for_speed.md @@ -8,34 +8,35 @@ kernelspec: language: python name: python3 heading-map: - overview: مرور کلی - major-scientific-libraries: کتابخانه‌های علمی اصلی - why-do-we-need-them: چرا به آنها نیاز داریم؟ - pythons-scientific-ecosystem: اکوسیستم علمی پایتون - pure-python-is-slow: پایتون خالص کند است - high-vs-low-level-code: کد سطح بالا در مقابل سطح پایین - where-are-the-bottlenecks: گلوگاه‌ها کجا هستند؟ - dynamic-typing: تایپ کردن پویا - static-types: انواع ایستا - data-access: دسترسی به داده - summing-with-compiled-code: جمع کردن با کد کامپایل شده - summing-in-pure-python: جمع کردن در پایتون خالص - summary: خلاصه - accelerating-python: تسریع پایتون - indexvectorization-single-vectorization: '{index}`برداری‌سازی `' - vectorization-vs-for-pure-python-loops: برداری‌سازی در مقابل حلقه‌های پایتون خالص - jit-compilers: کامپایلرهای JIT - parallelization: موازی‌سازی - parallelization-on-cpus: موازی‌سازی بر روی CPUها - multiprocessing: چندپردازشی - multithreading: چندرشته‌ای - advantages-and-disadvantages: مزایا و معایب - hardware-accelerators: شتاب‌دهنده‌های سخت‌افزاری - gpus-and-tpus: GPUها و TPUها - why-tpusgpus-matter-: چرا TPU/GPU مهم هستند - single-gpus-vs-gpu-servers: GPUهای تکی در مقابل سرورهای GPU - single-gpu-systems: سیستم‌های GPU تکی - multi-gpu-servers: سرورهای چند GPU + Overview: مرور کلی + Major Scientific Libraries: کتابخانه‌های علمی اصلی + Major Scientific Libraries::Why do we need them?: چرا به آنها نیاز داریم؟ + Major Scientific Libraries::Python's Scientific Ecosystem: اکوسیستم علمی پایتون + Pure Python is slow: پایتون خالص کند است + Pure Python is slow::High vs low level code: کد سطح بالا در مقابل سطح پایین + Pure Python is slow::Where are the bottlenecks?: گلوگاه‌ها کجا هستند؟ + Pure Python is slow::Where are the bottlenecks?::Dynamic typing: تایپ کردن پویا + Pure Python is slow::Where are the bottlenecks?::Static types: انواع ایستا + Pure Python is slow::Data Access: دسترسی به داده + Pure Python is slow::Data Access::Summing with Compiled Code: جمع کردن با کد کامپایل شده + Pure Python is slow::Data Access::Summing in Pure Python: جمع کردن در پایتون خالص + Pure Python is slow::Summary: خلاصه + Accelerating Python: تسریع پایتون + 'Accelerating Python::{index}`Vectorization `': '{index}`برداری‌سازی `' + Accelerating Python::Vectorization vs for pure Python loops: برداری‌سازی در مقابل حلقه‌های پایتون خالص + Accelerating Python::JIT compilers: کامپایلرهای JIT + Parallelization: موازی‌سازی + Parallelization::Parallelization on CPUs: موازی‌سازی بر روی CPUها + Parallelization::Parallelization on CPUs::Multiprocessing: چندپردازشی + Parallelization::Parallelization on CPUs::Multithreading: چندرشته‌ای + Parallelization::Parallelization on CPUs::Advantages and Disadvantages: مزایا و معایب + Parallelization::Hardware Accelerators: شتاب‌دهنده‌های سخت‌افزاری + Parallelization::Hardware Accelerators::GPUs and TPUs: GPUها و TPUها + Parallelization::Hardware Accelerators::Why TPUs/GPUs Matter: چرا TPU/GPU مهم هستند + Parallelization::Single GPUs vs GPU Servers: GPUهای تکی در مقابل سرورهای GPU + Parallelization::Single GPUs vs GPU Servers::Single GPU Systems: سیستم‌های GPU تکی + Parallelization::Single GPUs vs GPU Servers::Multi-GPU Servers: سرورهای چند GPU + Parallelization::Summary: خلاصه --- (speed)= diff --git a/lectures/numba.md b/lectures/numba.md index fb8eec4..db47681 100644 --- a/lectures/numba.md +++ b/lectures/numba.md @@ -10,18 +10,18 @@ kernelspec: language: python name: python3 heading-map: - overview: مروری کلی - indexcompiling-functions-single-compiling-functions: '{index}`کامپایل توابع `' - an-example: یک مثال - how-and-when-it-works: چگونه و چه زمانی کار می‌کند - decorator-notation: نماد Decorator - type-inference: استنتاج نوع - compiling-classes: کامپایل کلاس‌ها - dangers-and-limitations: خطرات و محدودیت‌ها - limitations: محدودیت‌ها - a-gotcha-global-variables: 'یک مشکل: متغیرهای سراسری' - multithreaded-loops-in-numba: حلقه‌های چندنخی در Numba - exercises: تمرین‌ها + Overview: مروری کلی + '{index}`Compiling Functions `': '{index}`کامپایل توابع `' + '{index}`Compiling Functions `::An Example': یک مثال + '{index}`Compiling Functions `::How and When it Works': چگونه و چه زمانی کار می‌کند + Decorator Notation: نماد Decorator + Type Inference: استنتاج نوع + Compiling Classes: کامپایل کلاس‌ها + Dangers and Limitations: خطرات و محدودیت‌ها + Dangers and Limitations::Limitations: محدودیت‌ها + 'Dangers and Limitations::A Gotcha: Global Variables': 'یک مشکل: متغیرهای سراسری' + Multithreaded Loops in Numba: حلقه‌های چندنخی در Numba + Exercises: تمرین‌ها --- (speed)= diff --git a/lectures/numpy.md b/lectures/numpy.md index 1cf4671..670805e 100644 --- a/lectures/numpy.md +++ b/lectures/numpy.md @@ -8,25 +8,25 @@ kernelspec: language: python name: python3 heading-map: - overview: مروری کلی - numpy-arrays: آرایه‌های NumPy - basics: مبانی - shape-and-dimension: شکل و بعد - creating-arrays: ایجاد آرایه‌ها - array-indexing: نمایه‌گذاری آرایه - array-methods: متدهای آرایه - arithmetic-operations: عملیات حسابی - matrix-multiplication: ضرب ماتریسی - broadcasting: Broadcasting - mutability-and-copying-arrays: قابلیت تغییر و کپی کردن آرایه‌ها - mutability: قابلیت تغییر - making-copies: ایجاد کپی - additional-features: ویژگی‌های اضافی - universal-functions: توابع جهانی - comparisons: مقایسه‌ها - sub-packages: بسته‌های فرعی - implicit-multithreading-: چندنخی ضمنی - exercises: تمرین‌ها + Overview: مروری کلی + NumPy Arrays: آرایه‌های NumPy + NumPy Arrays::Basics: مبانی + NumPy Arrays::Shape and Dimension: شکل و بعد + NumPy Arrays::Creating Arrays: ایجاد آرایه‌ها + NumPy Arrays::Array Indexing: نمایه‌گذاری آرایه + NumPy Arrays::Array Methods: متدهای آرایه + Arithmetic Operations: عملیات حسابی + Matrix Multiplication: ضرب ماتریسی + Broadcasting: Broadcasting + Mutability and Copying Arrays: قابلیت تغییر و کپی کردن آرایه‌ها + Mutability and Copying Arrays::Mutability: قابلیت تغییر + Mutability and Copying Arrays::Making Copies: ایجاد کپی + Additional Features: ویژگی‌های اضافی + Additional Features::Universal Functions: توابع جهانی + Additional Features::Comparisons: مقایسه‌ها + Additional Features::Sub-packages: بسته‌های فرعی + Additional Features::Implicit Multithreading: چندنخی ضمنی + Exercises: تمرین‌ها --- (np)= diff --git a/lectures/numpy_vs_numba_vs_jax.md b/lectures/numpy_vs_numba_vs_jax.md index 389eb1e..d4be5ed 100644 --- a/lectures/numpy_vs_numba_vs_jax.md +++ b/lectures/numpy_vs_numba_vs_jax.md @@ -8,19 +8,20 @@ kernelspec: language: python name: python3 heading-map: - vectorized-operations: عملیات برداری شده - problem-statement: بیان مسئله - numpy-vectorization: برداری‌سازی NumPy - a-comparison-with-numba: مقایسه با Numba - parallelized-numba: Numba موازی شده - vectorized-code-with-jax: کد برداری شده با JAX - jax-plus-vmap: JAX به علاوه vmap - version-1: نسخه 1 - vmap-version-2: نسخه 2 vmap - summary: خلاصه - sequential-operations: عملیات ترتیبی - numba-version: نسخه Numba - jax-version: نسخه JAX + Vectorized operations: عملیات برداری شده + Vectorized operations::Problem Statement: بیان مسئله + Vectorized operations::NumPy vectorization: برداری‌سازی NumPy + Vectorized operations::A Comparison with Numba: مقایسه با Numba + Vectorized operations::Parallelized Numba: Numba موازی شده + Vectorized operations::Vectorized code with JAX: کد برداری شده با JAX + Vectorized operations::JAX plus vmap: JAX به علاوه vmap + Vectorized operations::JAX plus vmap::Version 1: نسخه 1 + Vectorized operations::vmap version 2: نسخه 2 vmap + Vectorized operations::Summary: خلاصه + Sequential operations: عملیات ترتیبی + Sequential operations::Numba Version: نسخه Numba + Sequential operations::JAX Version: نسخه JAX + Sequential operations::Summary: خلاصه --- (parallel)= diff --git a/lectures/oop_intro.md b/lectures/oop_intro.md index 9eb761a..f2be06e 100644 --- a/lectures/oop_intro.md +++ b/lectures/oop_intro.md @@ -8,16 +8,16 @@ kernelspec: language: python name: python3 heading-map: - overview: مقدمه - objects: اشیاء - type: نوع - identity: شناسه - object-content-data-and-attributes: 'محتوای شیء: داده‌ها و ویژگی‌ها' - methods: متدها - inspection-using-rich: بازرسی با استفاده از Rich - a-little-mystery: یک معمای کوچک - summary: خلاصه - exercises: تمرین‌ها + Overview: مقدمه + Objects: اشیاء + Objects::Type: نوع (Type) + Objects::Identity: شناسه (Unique Identity) + 'Objects::Object Content: Data and Attributes': 'محتوای شیء: داده‌ها و ویژگی‌ها' + Objects::Methods: متدها + Inspection Using Rich: بازرسی با استفاده از Rich + A Little Mystery: یک معمای کوچک + Summary: خلاصه + Exercises: تمرین‌ها --- (oop_intro)= diff --git a/lectures/pandas.md b/lectures/pandas.md index b71848b..d37b025 100644 --- a/lectures/pandas.md +++ b/lectures/pandas.md @@ -10,18 +10,18 @@ kernelspec: language: python name: python3 heading-map: - overview: مرور کلی - series: Series - dataframes: DataFrames - select-data-by-position: انتخاب داده بر اساس موقعیت - select-data-by-conditions: انتخاب داده بر اساس شرایط - apply-method: متد Apply - make-changes-in-dataframes: ایجاد تغییرات در DataFrames - standardization-and-visualization: استانداردسازی و بصری‌سازی - on-line-data-sources: منابع داده آنلاین - accessing-data-with-indexrequests-single-requests: 'دسترسی به داده با {index}`requests `' - using-indexwbgapi-single-wbgapi-and-indexyfinance-single-yfinance-to-access-data: 'استفاده از {index}`wbgapi ` و {index}`yfinance ` برای دسترسی به داده' - exercises: تمرین‌ها + Overview: مرور کلی + Series: Series + DataFrames: DataFrames + DataFrames::Select Data by Position: انتخاب داده بر اساس موقعیت + DataFrames::Select Data by Conditions: انتخاب داده بر اساس شرایط + DataFrames::Apply Method: متد Apply + DataFrames::Make Changes in DataFrames: ایجاد تغییرات در DataFrames + DataFrames::Standardization and Visualization: استانداردسازی و بصری‌سازی + On-Line Data Sources: منابع داده آنلاین + 'On-Line Data Sources::Accessing Data with {index}`requests `': 'دسترسی به داده با {index}`requests `' + 'On-Line Data Sources::Using {index}`wbgapi ` and {index}`yfinance ` to Access Data': 'استفاده از {index}`wbgapi ` و {index}`yfinance ` برای دسترسی به داده' + Exercises: تمرین‌ها --- (pd)= diff --git a/lectures/pandas_panel.md b/lectures/pandas_panel.md index 35bb682..cc59358 100644 --- a/lectures/pandas_panel.md +++ b/lectures/pandas_panel.md @@ -10,12 +10,12 @@ kernelspec: language: python name: python3 heading-map: - overview: مروری کلی - slicing-and-reshaping-data: برش و تغییر شکل داده‌ها - merging-dataframes-and-filling-nans: ادغام Dataframe ها و پر کردن NaN ها - grouping-and-summarizing-data: گروه‌بندی و خلاصه کردن داده‌ها - final-remarks: نکات پایانی - exercises: تمرین‌ها + Overview: مروری کلی + Slicing and Reshaping Data: برش و تغییر شکل داده‌ها + Merging Dataframes and Filling NaNs: ادغام Dataframe ها و پر کردن NaN ها + Grouping and Summarizing Data: گروه‌بندی و خلاصه کردن داده‌ها + Final Remarks: نکات پایانی + Exercises: تمرین‌ها --- ```{raw} jupyter diff --git a/lectures/python_advanced_features.md b/lectures/python_advanced_features.md index b916f9a..2633664 100644 --- a/lectures/python_advanced_features.md +++ b/lectures/python_advanced_features.md @@ -8,30 +8,30 @@ kernelspec: language: python name: python3 heading-map: - overview: مروری کلی - iterables-and-iterators: Iterableها و Iteratorها - iterators: Iteratorها - iterators-in-for-loops: Iteratorها در حلقه‌های For - iterables: Iterableها - iterators-and-built-ins: Iteratorها و توابع داخلی - '-and-operators': عملگرهای `*` و `**` - unpacking-arguments: باز کردن آرگومان‌ها - arbitrary-arguments: آرگومان‌های دلخواه - decorators-and-descriptors: Decoratorها و Descriptorها - decorators: Decoratorها - an-example: یک مثال - enter-decorators: Decoratorها وارد می‌شوند - descriptors: Descriptorها - a-solution: یک راه‌حل - how-it-works: چگونه کار می‌کند - decorators-and-properties: Decoratorها و Propertyها - generators: Generatorها - generator-expressions: عبارات Generator - generator-functions: توابع Generator - example-1: مثال 1 - example-2: مثال 2 - advantages-of-iterators: مزایای Iteratorها - exercises: تمرین‌ها + Overview: مروری کلی + Iterables and Iterators: Iterableها و Iteratorها + Iterables and Iterators::Iterators: Iteratorها + Iterables and Iterators::Iterators in For Loops: Iteratorها در حلقه‌های For + Iterables and Iterators::Iterables: Iterableها + Iterables and Iterators::Iterators and built-ins: Iteratorها و توابع داخلی + '`*` and `**` Operators': عملگرهای `*` و `**` + '`*` and `**` Operators::Unpacking Arguments': باز کردن آرگومان‌ها + '`*` and `**` Operators::Arbitrary Arguments': آرگومان‌های دلخواه + Decorators and Descriptors: Decoratorها و Descriptorها + Decorators and Descriptors::Decorators: Decoratorها + Decorators and Descriptors::Decorators::An Example: یک مثال + Decorators and Descriptors::Decorators::Enter Decorators: Decoratorها وارد می‌شوند + Decorators and Descriptors::Descriptors: Descriptorها + Decorators and Descriptors::Descriptors::A Solution: یک راه‌حل + Decorators and Descriptors::Descriptors::How it Works: چگونه کار می‌کند + Decorators and Descriptors::Descriptors::Decorators and Properties: Decoratorها و Propertyها + Generators: Generatorها + Generators::Generator Expressions: عبارات Generator + Generators::Generator Functions: توابع Generator + Generators::Generator Functions::Example 1: مثال 1 + Generators::Generator Functions::Example 2: مثال 2 + Generators::Advantages of Iterators: مزایای Iteratorها + Exercises: تمرین‌ها --- (python_advanced_features)= diff --git a/lectures/python_by_example.md b/lectures/python_by_example.md index 54219df..e101784 100644 --- a/lectures/python_by_example.md +++ b/lectures/python_by_example.md @@ -7,6 +7,24 @@ kernelspec: display_name: Python 3 language: python name: python3 +heading-map: + Overview: مقدمه + 'The Task: Plotting a White Noise Process': هدف:رسم یک فرآیند نویز سفید + Version 1: روش اول + Version 1::Imports: Imports + Version 1::Imports::Why So Many Imports?: چرا در برنامه نویسی پایتون، از Importهای متعددی استفاده می شود؟ + Version 1::Imports::Packages: پکیج ها(Packages) + Version 1::Imports::Subpackages: زیرپکیج ها (Subpackages) + Version 1::Importing Names Directly: وارد کردن مستقیم توابع یا متغیرها از یک پکیج + Version 1::Random Draws: نمونه گیری تصادفی + Alternative Implementations: روش های دیگر پیاده سازی برنامه + Alternative Implementations::A Version with a For Loop: یک نسخه با حلقه تکرار For + Alternative Implementations::Lists: لیست ها + Alternative Implementations::The For Loop: حلقه For + Alternative Implementations::A Comment on Indentation: یادداشتی درباره تورفتگی (Indentation) + Alternative Implementations::While Loops: حلقه های While + Another Application: یک کاربرد دیگر + Exercises: تمرینات --- (python_by_example)= diff --git a/lectures/python_essentials.md b/lectures/python_essentials.md index 9708581..4437430 100644 --- a/lectures/python_essentials.md +++ b/lectures/python_essentials.md @@ -8,27 +8,27 @@ kernelspec: language: python name: python3 heading-map: - overview: مقدمه - data-types: انواع داده - primitive-data-types: انواع داده ابتدایی - boolean-values: مقادیر Boolean - numeric-types: انواع داده عددی - containers: ظرف ها - slice-notation: نشانه‌گذاری Slice - sets-and-dictionaries: مجموعه‌ها و دیکشنری ها - input-and-output: ورودی و خروجی - paths: مسیرها - iterating: تکرار - looping-over-different-objects: حلقه تکرار اشیاء مختلف - looping-without-indices: حلقه تکرار بدون ایندکس‌ها - list-comprehensions: خلاصه لیست‌ها - comparisons-and-logical-operators: عملگرهای مقایسه‌ای و منطقی - comparisons: عملگرهای مقایسه‌ای - combining-expressions: ترکیب عبارات - coding-style-and-documentation: سبک کدنویسی و مستندسازی - python-style-guidelines-pep8: راهنمای سبک کدنویسی پایتون: PEP8 - docstrings: داک‌استرینگ‌ها (docstring) - exercises: تمرین‌ها + Overview: مقدمه + Data Types: انواع داده + Data Types::Primitive Data Types: انواع داده اولیه (Primitive Data Types) + Data Types::Primitive Data Types::Boolean Values: مقادیر بولی (Boolean) + Data Types::Primitive Data Types::Numeric Types: انواع داده‌های عددی + Data Types::Containers: ظرف ها یا ساختارهای نگه دارنده(Containers) + Data Types::Containers::Slice Notation: نشانه گذاری برش (Slice Notation) + Data Types::Containers::Sets and Dictionaries: مجموعه‌ها و دیکشنری‌ها (Sets and Dictionaries) + Input and Output: ورودی و خروجی (Input and Output) + Input and Output::Paths: مسیرها (Paths) + Iterating: تکرار(Iteration) + Iterating::Looping over Different Objects: حلقه تکرار روی اشیاء مختلف + Iterating::Looping without Indices: حلقه تکرار بدون ایندکس‌ها + Iterating::List Comprehensions: ‌خلاصه لیست (List Comprehension) + Comparisons and Logical Operators: عملگرهای مقایسه‌ای و منطقی + Comparisons and Logical Operators::Comparisons: عملگرهای مقایسه‌ای + Comparisons and Logical Operators::Combining Expressions: ترکیب عبارات + Coding Style and Documentation: سبک کدنویسی و مستندسازی + 'Coding Style and Documentation::Python Style Guidelines: PEP8': 'راهنمای سبک کدنویسی پایتون: PEP8' + Coding Style and Documentation::Docstrings: داک‌استرینگ‌ها (docstring) + Exercises: تمرین‌ها --- (python_done_right)= diff --git a/lectures/python_oop.md b/lectures/python_oop.md index 8f26dd4..3344235 100644 --- a/lectures/python_oop.md +++ b/lectures/python_oop.md @@ -8,20 +8,20 @@ kernelspec: language: python name: python3 heading-map: - overview: مرور کلی - oop-review: مرور OOP - key-concepts: مفاهیم کلیدی - why-is-oop-useful: چرا OOP مفید است؟ - defining-your-own-classes: تعریف کلاس‌های خودتان - example-a-consumer-class: 'مثال: کلاس مصرف‌کننده' - usage: استفاده - self: Self - details: جزئیات - example-the-solow-growth-model: 'مثال: مدل رشد سولو' - example-a-market: 'مثال: یک بازار' - example-chaos: 'مثال: آشوب' - special-methods: متدهای ویژه - exercises: تمرین‌ها + Overview: مرور کلی + OOP Review: مرور OOP + OOP Review::Key Concepts: مفاهیم کلیدی + OOP Review::Why is OOP Useful?: چرا OOP مفید است؟ + Defining Your Own Classes: تعریف کلاس‌های خودتان + 'Defining Your Own Classes::Example: A Consumer Class': 'مثال: کلاس مصرف‌کننده' + 'Defining Your Own Classes::Example: A Consumer Class::Usage': استفاده + 'Defining Your Own Classes::Example: A Consumer Class::Self': Self + 'Defining Your Own Classes::Example: A Consumer Class::Details': جزئیات + 'Defining Your Own Classes::Example: The Solow Growth Model': 'مثال: مدل رشد سولو' + 'Defining Your Own Classes::Example: A Market': 'مثال: یک بازار' + 'Defining Your Own Classes::Example: Chaos': 'مثال: آشوب' + Special Methods: متدهای ویژه + Exercises: تمرین‌ها --- (python_oop)= diff --git a/lectures/scipy.md b/lectures/scipy.md index 758fa9a..876a869 100644 --- a/lectures/scipy.md +++ b/lectures/scipy.md @@ -8,23 +8,23 @@ kernelspec: language: python name: python3 heading-map: - overview: مروری کلی - indexscipy-single-scipy-versus-indexnumpy-single-numpy: '{index}`SciPy ` در مقابل {index}`NumPy `' - statistics: آمار - random-variables-and-distributions: متغیرهای تصادفی و توزیع‌ها - alternative-syntax: نحو جایگزین - other-goodies-in-scipystats: چیزهای مفید دیگر در scipy.stats - roots-and-fixed-points: ریشه‌ها و نقاط ثابت - indexbisection-single-bisection: '{index}`Bisection `' - the-indexnewton-raphson-method-single-newton-raphson-method: 'روش {index}`Newton-Raphson Method `' - hybrid-methods: روش‌های ترکیبی - multivariate-root-finding: یافتن ریشه چند متغیره - fixed-points: نقاط ثابت - indexoptimization-single-optimization: '{index}`Optimization `' - multivariate-optimization: بهینه‌سازی چند متغیره - indexintegration-single-integration: '{index}`Integration `' - indexlinear-algebra-single-linear-algebra: '{index}`Linear Algebra `' - exercises: تمرین‌ها + Overview: مروری کلی + '{index}`SciPy ` versus {index}`NumPy `': '{index}`SciPy ` در مقابل {index}`NumPy `' + Statistics: آمار + Statistics::Random Variables and Distributions: متغیرهای تصادفی و توزیع‌ها + Statistics::Alternative Syntax: نحو جایگزین + Statistics::Other Goodies in scipy.stats: چیزهای مفید دیگر در scipy.stats + Roots and Fixed Points: ریشه‌ها و نقاط ثابت + 'Roots and Fixed Points::{index}`Bisection `': '{index}`Bisection `' + 'Roots and Fixed Points::The {index}`Newton-Raphson Method `': 'روش {index}`Newton-Raphson Method `' + Roots and Fixed Points::Hybrid Methods: روش‌های ترکیبی + Roots and Fixed Points::Multivariate Root-Finding: یافتن ریشه چند متغیره + Roots and Fixed Points::Fixed Points: نقاط ثابت + '{index}`Optimization `': '{index}`Optimization `' + '{index}`Optimization `::Multivariate Optimization': بهینه‌سازی چند متغیره + '{index}`Integration `': '{index}`Integration `' + '{index}`Linear Algebra `': '{index}`Linear Algebra `' + Exercises: تمرین‌ها --- (sp)= diff --git a/lectures/sympy.md b/lectures/sympy.md index 9fc566d..421c6e6 100644 --- a/lectures/sympy.md +++ b/lectures/sympy.md @@ -10,24 +10,24 @@ kernelspec: language: python name: python3 heading-map: - overview: مروری کلی - getting-started: شروع به کار - symbolic-algebra: جبر نمادین - symbols: نمادها - expressions: عبارات - equations: معادلات - example-fixed-point-computation: 'مثال: محاسبه نقطه ثابت' - inequalities-and-logic: نامساوی‌ها و منطق - series: سری‌ها - example-bank-deposits: 'مثال: سپرده‌های بانکی' - example-discrete-random-variable: 'مثال: متغیر تصادفی گسسته' - symbolic-calculus: حساب دیفرانسیل و انتگرال نمادین - limits: حدها - derivatives: مشتقات - integrals: انتگرال‌ها - plotting: ترسیم نمودار - application-two-person-exchange-economy: 'کاربرد: اقتصاد مبادله دو نفره' - exercises: تمرینات + Overview: مروری کلی + Getting Started: شروع به کار + Symbolic algebra: جبر نمادین + Symbolic algebra::Symbols: نمادها + Symbolic algebra::Expressions: عبارات + Symbolic algebra::Equations: معادلات + 'Symbolic algebra::Equations::Example: fixed point computation': 'مثال: محاسبه نقطه ثابت' + Symbolic algebra::Inequalities and logic: نامساوی‌ها و منطق + Symbolic algebra::Series: سری‌ها + 'Symbolic algebra::Series::Example: bank deposits': 'مثال: سپرده‌های بانکی' + 'Symbolic algebra::Series::Example: discrete random variable': 'مثال: متغیر تصادفی گسسته' + Symbolic Calculus: حساب دیفرانسیل و انتگرال نمادین + Symbolic Calculus::Limits: حدها + Symbolic Calculus::Derivatives: مشتقات + Symbolic Calculus::Integrals: انتگرال‌ها + Plotting: ترسیم نمودار + 'Application: Two-person Exchange Economy': 'کاربرد: اقتصاد مبادله دو نفره' + Exercises: تمرینات --- (sympy)= diff --git a/lectures/troubleshooting.md b/lectures/troubleshooting.md index f179cab..385592f 100644 --- a/lectures/troubleshooting.md +++ b/lectures/troubleshooting.md @@ -8,8 +8,8 @@ kernelspec: language: python name: python3 heading-map: - fixing-your-local-environment: اصلاح محیط محلی شما - reporting-an-issue: گزارش یک مشکل + Fixing Your Local Environment: اصلاح محیط محلی شما + Reporting an Issue: گزارش یک مشکل --- (troubleshooting)= diff --git a/lectures/workspace.md b/lectures/workspace.md index 394806f..204a93f 100644 --- a/lectures/workspace.md +++ b/lectures/workspace.md @@ -10,15 +10,16 @@ kernelspec: display_name: Python 3 (ipykernel) language: python heading-map: - overview: مروری کلی - working-with-python-files-: کار با فایل‌های Python - development-environments: محیط‌های توسعه - a-step-forward-from-jupyter-notebooks-jupyterlab: 'یک قدم جلوتر از Jupyter Notebooks: JupyterLab' - using-magic-commands: استفاده از دستورات جادویی - using-the-terminal: استفاده از ترمینال - a-walk-through-visual-studio-code: گشت و گذاری در Visual Studio Code - using-the-run-button: استفاده از دکمه run - git-your-hands-dirty: Git را امتحان کنید + Overview: مروری کلی + Working with Python files: کار با فایل‌های Python + Development environments: محیط‌های توسعه + 'A step forward from Jupyter Notebooks: JupyterLab': 'یک قدم جلوتر از Jupyter Notebooks: JupyterLab' + 'A step forward from Jupyter Notebooks: JupyterLab::Using magic commands': استفاده از دستورات جادویی + 'A step forward from Jupyter Notebooks: JupyterLab::Using the terminal': استفاده از ترمینال + A walk through Visual Studio Code: گشت و گذاری در Visual Studio Code + A walk through Visual Studio Code::Using the run button: استفاده از دکمه run + A walk through Visual Studio Code::Using the terminal: استفاده از ترمینال + Git your hands dirty: Git را امتحان کنید --- (workspace)= diff --git a/lectures/writing_good_code.md b/lectures/writing_good_code.md index e23a482..c74de5f 100644 --- a/lectures/writing_good_code.md +++ b/lectures/writing_good_code.md @@ -8,17 +8,17 @@ kernelspec: language: python name: python3 heading-map: - overview: مرور کلی - an-example-of-poor-code: نمونه‌ای از کد ضعیف - good-coding-practice: شیوه‌های کدنویسی خوب - dont-use-magic-numbers: از اعداد جادویی استفاده نکنید - dont-repeat-yourself: خودتان را تکرار نکنید - minimize-global-variables: متغیرهای سراسری را به حداقل برسانید - jit-compilation: کامپایل JIT - use-functions-or-classes: از توابع یا کلاس‌ها استفاده کنید - which-one-functions-or-classes: کدام یک، توابع یا کلاس‌ها؟ - revisiting-the-example: بازبینی مثال - exercises: تمرین‌ها + Overview: مرور کلی + An Example of Poor Code: نمونه‌ای از کد ضعیف + Good Coding Practice: شیوه‌های کدنویسی خوب + Good Coding Practice::Don't Use Magic Numbers: از اعداد جادویی استفاده نکنید + Good Coding Practice::Don't Repeat Yourself: خودتان را تکرار نکنید + Good Coding Practice::Minimize Global Variables: متغیرهای سراسری را به حداقل برسانید + Good Coding Practice::Minimize Global Variables::JIT Compilation: کامپایل JIT + Good Coding Practice::Use Functions or Classes: از توابع یا کلاس‌ها استفاده کنید + Good Coding Practice::Use Functions or Classes::Which One, Functions or Classes?: کدام یک، توابع یا کلاس‌ها؟ + Revisiting the Example: بازبینی مثال + Exercises: تمرین‌ها --- (writing_good_code)= From 4b4fd511af27847c768905c4c405a2ef5d806521 Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Fri, 20 Mar 2026 16:15:59 +1100 Subject: [PATCH 3/3] Bootstrap .translate/ metadata and add review workflow - .translate/config.yml: source=en, target=fa, docs=lectures, tool-version=0.11.0 - .translate/state/: 25 state files tracking source commit SHAs - .github/workflows/review-translations.yml: Claude quality review on translation PRs State verified via --check-sync before --write-state (v0.11.0 safeguard) --- .github/workflows/review-translations.yml | 28 +++++++++++++++++++ .translate/config.yml | 4 +++ .translate/state/about_py.md.yml | 6 ++++ .translate/state/debugging.md.yml | 6 ++++ .translate/state/functions.md.yml | 6 ++++ .translate/state/getting_started.md.yml | 6 ++++ .translate/state/intro.md.yml | 6 ++++ .translate/state/jax_intro.md.yml | 6 ++++ .translate/state/matplotlib.md.yml | 6 ++++ .translate/state/names.md.yml | 6 ++++ .translate/state/need_for_speed.md.yml | 6 ++++ .translate/state/numba.md.yml | 6 ++++ .translate/state/numpy.md.yml | 6 ++++ .translate/state/numpy_vs_numba_vs_jax.md.yml | 6 ++++ .translate/state/oop_intro.md.yml | 6 ++++ .translate/state/pandas.md.yml | 6 ++++ .translate/state/pandas_panel.md.yml | 6 ++++ .../state/python_advanced_features.md.yml | 6 ++++ .translate/state/python_by_example.md.yml | 6 ++++ .translate/state/python_essentials.md.yml | 6 ++++ .translate/state/python_oop.md.yml | 6 ++++ .translate/state/scipy.md.yml | 6 ++++ .translate/state/status.md.yml | 6 ++++ .translate/state/sympy.md.yml | 6 ++++ .translate/state/troubleshooting.md.yml | 6 ++++ .translate/state/workspace.md.yml | 6 ++++ .translate/state/writing_good_code.md.yml | 6 ++++ 27 files changed, 182 insertions(+) create mode 100644 .github/workflows/review-translations.yml create mode 100644 .translate/config.yml create mode 100644 .translate/state/about_py.md.yml create mode 100644 .translate/state/debugging.md.yml create mode 100644 .translate/state/functions.md.yml create mode 100644 .translate/state/getting_started.md.yml create mode 100644 .translate/state/intro.md.yml create mode 100644 .translate/state/jax_intro.md.yml create mode 100644 .translate/state/matplotlib.md.yml create mode 100644 .translate/state/names.md.yml create mode 100644 .translate/state/need_for_speed.md.yml create mode 100644 .translate/state/numba.md.yml create mode 100644 .translate/state/numpy.md.yml create mode 100644 .translate/state/numpy_vs_numba_vs_jax.md.yml create mode 100644 .translate/state/oop_intro.md.yml create mode 100644 .translate/state/pandas.md.yml create mode 100644 .translate/state/pandas_panel.md.yml create mode 100644 .translate/state/python_advanced_features.md.yml create mode 100644 .translate/state/python_by_example.md.yml create mode 100644 .translate/state/python_essentials.md.yml create mode 100644 .translate/state/python_oop.md.yml create mode 100644 .translate/state/scipy.md.yml create mode 100644 .translate/state/status.md.yml create mode 100644 .translate/state/sympy.md.yml create mode 100644 .translate/state/troubleshooting.md.yml create mode 100644 .translate/state/workspace.md.yml create mode 100644 .translate/state/writing_good_code.md.yml diff --git a/.github/workflows/review-translations.yml b/.github/workflows/review-translations.yml new file mode 100644 index 0000000..33c503b --- /dev/null +++ b/.github/workflows/review-translations.yml @@ -0,0 +1,28 @@ +# Review Translations — Quality check on translation PRs +# When a PR is opened/updated that carries the 'action-translation' label, +# this workflow runs a quality review and posts a comment. +name: Review Translations + +on: + pull_request: + types: [opened, synchronize, labeled, reopened] + +jobs: + review: + if: contains(github.event.pull_request.labels.*.name, 'action-translation') + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 2 + + - uses: QuantEcon/action-translation@v0.11.0 + with: + mode: review + source-repo: QuantEcon/lecture-python-programming + source-language: en + target-language: fa + docs-folder: lectures + anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }} + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.translate/config.yml b/.translate/config.yml new file mode 100644 index 0000000..dbf411c --- /dev/null +++ b/.translate/config.yml @@ -0,0 +1,4 @@ +source-language: en +target-language: fa +docs-folder: lectures +tool-version: 0.11.0 diff --git a/.translate/state/about_py.md.yml b/.translate/state/about_py.md.yml new file mode 100644 index 0000000..feb5f4c --- /dev/null +++ b/.translate/state/about_py.md.yml @@ -0,0 +1,6 @@ +source-sha: 9490497982787a5b0eb54ee1dcd73ac326d5ae04 +synced-at: "2026-03-20" +model: unknown +mode: RESYNC +section-count: 3 +tool-version: 0.11.0 diff --git a/.translate/state/debugging.md.yml b/.translate/state/debugging.md.yml new file mode 100644 index 0000000..1eb495b --- /dev/null +++ b/.translate/state/debugging.md.yml @@ -0,0 +1,6 @@ +source-sha: 678d8ffa60705071883c1e5d98ef37ba5a1e139f +synced-at: "2026-03-20" +model: unknown +mode: RESYNC +section-count: 4 +tool-version: 0.11.0 diff --git a/.translate/state/functions.md.yml b/.translate/state/functions.md.yml new file mode 100644 index 0000000..6c975e7 --- /dev/null +++ b/.translate/state/functions.md.yml @@ -0,0 +1,6 @@ +source-sha: 1f13005646e1f9241baccf1f6e79dff1924043dd +synced-at: "2026-03-20" +model: unknown +mode: RESYNC +section-count: 7 +tool-version: 0.11.0 diff --git a/.translate/state/getting_started.md.yml b/.translate/state/getting_started.md.yml new file mode 100644 index 0000000..88f8b8d --- /dev/null +++ b/.translate/state/getting_started.md.yml @@ -0,0 +1,6 @@ +source-sha: 6d0df81899e042268a0081b71af2cedc438613b5 +synced-at: "2026-03-20" +model: unknown +mode: RESYNC +section-count: 7 +tool-version: 0.11.0 diff --git a/.translate/state/intro.md.yml b/.translate/state/intro.md.yml new file mode 100644 index 0000000..1a9bc93 --- /dev/null +++ b/.translate/state/intro.md.yml @@ -0,0 +1,6 @@ +source-sha: a2a37636bb525ddcad0c82f6825bcd3287807c4b +synced-at: "2026-01-29" +model: unknown +mode: RESYNC +section-count: 0 +tool-version: 0.11.0 diff --git a/.translate/state/jax_intro.md.yml b/.translate/state/jax_intro.md.yml new file mode 100644 index 0000000..1e57ca4 --- /dev/null +++ b/.translate/state/jax_intro.md.yml @@ -0,0 +1,6 @@ +source-sha: c4c03c80c1eb4318f627d869707d242d19c8cf09 +synced-at: "2026-03-20" +model: unknown +mode: RESYNC +section-count: 6 +tool-version: 0.11.0 diff --git a/.translate/state/matplotlib.md.yml b/.translate/state/matplotlib.md.yml new file mode 100644 index 0000000..73c1a6c --- /dev/null +++ b/.translate/state/matplotlib.md.yml @@ -0,0 +1,6 @@ +source-sha: 678d8ffa60705071883c1e5d98ef37ba5a1e139f +synced-at: "2026-03-20" +model: unknown +mode: RESYNC +section-count: 5 +tool-version: 0.11.0 diff --git a/.translate/state/names.md.yml b/.translate/state/names.md.yml new file mode 100644 index 0000000..4607bbc --- /dev/null +++ b/.translate/state/names.md.yml @@ -0,0 +1,6 @@ +source-sha: fe42b933280691390a2a4741b7bcbccaa86a5c2b +synced-at: "2026-03-20" +model: unknown +mode: RESYNC +section-count: 9 +tool-version: 0.11.0 diff --git a/.translate/state/need_for_speed.md.yml b/.translate/state/need_for_speed.md.yml new file mode 100644 index 0000000..c503a79 --- /dev/null +++ b/.translate/state/need_for_speed.md.yml @@ -0,0 +1,6 @@ +source-sha: cc9c3256dc35bd277cb25d0089f0a0452c0fa94e +synced-at: "2026-03-20" +model: unknown +mode: RESYNC +section-count: 5 +tool-version: 0.11.0 diff --git a/.translate/state/numba.md.yml b/.translate/state/numba.md.yml new file mode 100644 index 0000000..bdeabd4 --- /dev/null +++ b/.translate/state/numba.md.yml @@ -0,0 +1,6 @@ +source-sha: cc9c3256dc35bd277cb25d0089f0a0452c0fa94e +synced-at: "2026-03-20" +model: unknown +mode: RESYNC +section-count: 8 +tool-version: 0.11.0 diff --git a/.translate/state/numpy.md.yml b/.translate/state/numpy.md.yml new file mode 100644 index 0000000..bdeabd4 --- /dev/null +++ b/.translate/state/numpy.md.yml @@ -0,0 +1,6 @@ +source-sha: cc9c3256dc35bd277cb25d0089f0a0452c0fa94e +synced-at: "2026-03-20" +model: unknown +mode: RESYNC +section-count: 8 +tool-version: 0.11.0 diff --git a/.translate/state/numpy_vs_numba_vs_jax.md.yml b/.translate/state/numpy_vs_numba_vs_jax.md.yml new file mode 100644 index 0000000..fa0c534 --- /dev/null +++ b/.translate/state/numpy_vs_numba_vs_jax.md.yml @@ -0,0 +1,6 @@ +source-sha: c4c03c80c1eb4318f627d869707d242d19c8cf09 +synced-at: "2026-03-20" +model: unknown +mode: RESYNC +section-count: 2 +tool-version: 0.11.0 diff --git a/.translate/state/oop_intro.md.yml b/.translate/state/oop_intro.md.yml new file mode 100644 index 0000000..7055e2b --- /dev/null +++ b/.translate/state/oop_intro.md.yml @@ -0,0 +1,6 @@ +source-sha: 126eb49056ad1b685638c1820ebb7b4c89cabf89 +synced-at: "2026-03-20" +model: unknown +mode: RESYNC +section-count: 6 +tool-version: 0.11.0 diff --git a/.translate/state/pandas.md.yml b/.translate/state/pandas.md.yml new file mode 100644 index 0000000..cf604aa --- /dev/null +++ b/.translate/state/pandas.md.yml @@ -0,0 +1,6 @@ +source-sha: 9490497982787a5b0eb54ee1dcd73ac326d5ae04 +synced-at: "2026-03-20" +model: unknown +mode: RESYNC +section-count: 5 +tool-version: 0.11.0 diff --git a/.translate/state/pandas_panel.md.yml b/.translate/state/pandas_panel.md.yml new file mode 100644 index 0000000..7055e2b --- /dev/null +++ b/.translate/state/pandas_panel.md.yml @@ -0,0 +1,6 @@ +source-sha: 126eb49056ad1b685638c1820ebb7b4c89cabf89 +synced-at: "2026-03-20" +model: unknown +mode: RESYNC +section-count: 6 +tool-version: 0.11.0 diff --git a/.translate/state/python_advanced_features.md.yml b/.translate/state/python_advanced_features.md.yml new file mode 100644 index 0000000..565ebad --- /dev/null +++ b/.translate/state/python_advanced_features.md.yml @@ -0,0 +1,6 @@ +source-sha: 1a87942398e15e03539083cc944a78653c532607 +synced-at: "2026-03-20" +model: unknown +mode: RESYNC +section-count: 6 +tool-version: 0.11.0 diff --git a/.translate/state/python_by_example.md.yml b/.translate/state/python_by_example.md.yml new file mode 100644 index 0000000..565ebad --- /dev/null +++ b/.translate/state/python_by_example.md.yml @@ -0,0 +1,6 @@ +source-sha: 1a87942398e15e03539083cc944a78653c532607 +synced-at: "2026-03-20" +model: unknown +mode: RESYNC +section-count: 6 +tool-version: 0.11.0 diff --git a/.translate/state/python_essentials.md.yml b/.translate/state/python_essentials.md.yml new file mode 100644 index 0000000..88f8b8d --- /dev/null +++ b/.translate/state/python_essentials.md.yml @@ -0,0 +1,6 @@ +source-sha: 6d0df81899e042268a0081b71af2cedc438613b5 +synced-at: "2026-03-20" +model: unknown +mode: RESYNC +section-count: 7 +tool-version: 0.11.0 diff --git a/.translate/state/python_oop.md.yml b/.translate/state/python_oop.md.yml new file mode 100644 index 0000000..3b38266 --- /dev/null +++ b/.translate/state/python_oop.md.yml @@ -0,0 +1,6 @@ +source-sha: 8973c2e03fe820f44b841b2e13ed4107500a1226 +synced-at: "2026-03-20" +model: unknown +mode: RESYNC +section-count: 5 +tool-version: 0.11.0 diff --git a/.translate/state/scipy.md.yml b/.translate/state/scipy.md.yml new file mode 100644 index 0000000..2c87eef --- /dev/null +++ b/.translate/state/scipy.md.yml @@ -0,0 +1,6 @@ +source-sha: cfedc1a06bbefe20d23924d26aef437a968ab2da +synced-at: "2026-03-20" +model: unknown +mode: RESYNC +section-count: 8 +tool-version: 0.11.0 diff --git a/.translate/state/status.md.yml b/.translate/state/status.md.yml new file mode 100644 index 0000000..6df4a86 --- /dev/null +++ b/.translate/state/status.md.yml @@ -0,0 +1,6 @@ +source-sha: 9045b9f1cdfade87ba16f5b0bc530fe9a4b71e74 +synced-at: "2026-03-20" +model: unknown +mode: RESYNC +section-count: 0 +tool-version: 0.11.0 diff --git a/.translate/state/sympy.md.yml b/.translate/state/sympy.md.yml new file mode 100644 index 0000000..86a24a8 --- /dev/null +++ b/.translate/state/sympy.md.yml @@ -0,0 +1,6 @@ +source-sha: 5b5e342a8bbb24f4b1a1b4c7d6b0140aff4771b6 +synced-at: "2026-03-20" +model: unknown +mode: RESYNC +section-count: 7 +tool-version: 0.11.0 diff --git a/.translate/state/troubleshooting.md.yml b/.translate/state/troubleshooting.md.yml new file mode 100644 index 0000000..65d7c8a --- /dev/null +++ b/.translate/state/troubleshooting.md.yml @@ -0,0 +1,6 @@ +source-sha: 6d0df81899e042268a0081b71af2cedc438613b5 +synced-at: "2026-03-20" +model: unknown +mode: RESYNC +section-count: 2 +tool-version: 0.11.0 diff --git a/.translate/state/workspace.md.yml b/.translate/state/workspace.md.yml new file mode 100644 index 0000000..b71c9ee --- /dev/null +++ b/.translate/state/workspace.md.yml @@ -0,0 +1,6 @@ +source-sha: b4ebdd49fbe75f99571b4c798d7379c542a63681 +synced-at: "2026-03-20" +model: unknown +mode: RESYNC +section-count: 6 +tool-version: 0.11.0 diff --git a/.translate/state/writing_good_code.md.yml b/.translate/state/writing_good_code.md.yml new file mode 100644 index 0000000..b0bfa2f --- /dev/null +++ b/.translate/state/writing_good_code.md.yml @@ -0,0 +1,6 @@ +source-sha: 6d0df81899e042268a0081b71af2cedc438613b5 +synced-at: "2026-03-20" +model: unknown +mode: RESYNC +section-count: 5 +tool-version: 0.11.0