Add educational materials, documentation, tests, and performance optimizations#10
Merged
Add educational materials, documentation, tests, and performance optimizations#10
Conversation
Co-authored-by: licm13 <16440941+licm13@users.noreply.github.com>
…mizations - Add beginner-friendly educational notebook (EN/CN bilingual) - Add deep dive technical documentation with math derivations - Add complex test scenarios (missing data, multi-biome, performance) - Add Numba-optimized Perez-Priego implementation (~170x speedup) - Add optimized uWUE implementation with caching and vectorization - Add benchmark utilities for performance profiling - Add AI coding assistant prompts documentation - Add CI/CD workflow for GitHub Actions - Update README with new content links - Update requirements.txt with new dependencies Co-authored-by: licm13 <16440941+licm13@users.noreply.github.com>
- Fix workflow permissions for security (add contents: read) - Improve comment clarity in Numba module - Fix gc.collect() call in benchmark - Vectorize NaN propagation test for efficiency Co-authored-by: licm13 <16440941+licm13@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add educational notebook for ET partitioning methods
Add educational materials, documentation, tests, and performance optimizations
Dec 4, 2025
licm13
approved these changes
Dec 4, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The ET-partition codebase lacked systematic educational materials, in-depth technical documentation, complex test scenarios, and performance-optimized implementations.
Educational Materials
notebooks/ET_Partition_Introduction_For_Beginners.ipynb— Bilingual (EN/CN) tutorial with visualizations, method analogies, hands-on examples, and decision tree for method selectionTechnical Documentation
docs/ET_Partition_Methods_Deep_Dive.md— Mathematical derivations, code architecture diagrams, performance benchmarks, parameter tuning guidesdocs/AI_OPTIMIZATION_PROMPTS.md— Curated prompts for AI coding assistants (optimization, refactoring, testing, documentation)Test Suite
tests/test_complex_scenarios.py— 23 pytest cases covering:Performance Optimizations
methods/perez_priego/et_partitioning_functions_numba.py— Numba JIT-compiled implementation (~170x speedup)methods/uwue/zhou_optimized.py— Vectorized operations with result cachingutils/benchmark.py— Profiling utilities for time/memory comparisonCI/CD
.github/workflows/tests.yml— Python 3.10/3.11/3.12 testing, code quality checks, integration testsUpdates
README.md— Added documentation linksrequirements.txt— Added pytest, tqdm, psutil, emceeOriginal prompt
项目改进需求 / Project Enhancement Requirements
背景 / Background
当前 ET-partition 代码库包含三种蒸散发拆分方法(uWUE, TEA, Perez-Priego),但缺少:
The current ET-partition codebase contains three ET partitioning methods but lacks:
需求1: 教学笔记本 / Educational Notebook
创建
notebooks/ET_Partition_Introduction_For_Beginners.ipynb,面向大一学生:内容结构:
第一部分: 基础概念
第二部分: 三种方法原理(逐步讲解)
第三部分: 动手实践
data/test_site/FLX_FI-Hyy_*)第四部分: 代码库组织
第五部分: 进阶话题
要求:
需求2: 深度技术文档 / In-Depth Technical Documentation
创建
docs/ET_Partition_Methods_Deep_Dive.md:章节:
理论框架对比
数学推导详解
代码实现剖析
性能与优化
应用场景与限制
要求:
需求3: 复杂测试案例 / Complex Test Cases
创建
tests/test_complex_scenarios.py:测试类别:
3.1 缺失数据处理
3.2 多生物群落场景
3.3 性能基准测试
3.4 I/O接口验证
3.5 边界条件测试
要求:
需求4: 性能优化实现 / Performance Optimization
4.1 Numba 加速的 Perez-Priego 实现
创建
methods/perez_priego/et_partitioning_functions_numba.py:优化内容:
calculate_stomatal_conductance: JIT 编译 + 向量化calculate_transpiration: 并行循环(prange)moving_window_optimization: Numba 加速滑动窗口atmospheric_pressure: LRU 缓存性能目标:
4.2 uWUE 优化
在
methods/uwue/zhou.py中添加:quantreg_cached: 缓存重复计算vectorized_daily_aggregation: 向量化日聚合parallel_site_processing: 多站点并行4.3 TEA 优化
在
methods/tea/batch.py中:n_jobs=-1使用所有核心4.4 性能对比工具
创建
utils/benchmark.py:需求5: AI 辅助提示词文档 / AI Coding Assistant Prompts
创建
docs/AI_OPTIMIZATION_PROMPTS.md:包含提示词:
每个提示词包含:
实现要求 / Implementation Requirements
文件清单 / File Checklist
notebooks/ET_Partition_Introduction_For_Beginners.ipynb(新建)docs/ET_Partition_Methods_Deep_Dive.md(新建)tests/test_complex_scenarios.py(新建)methods/perez_priego/et_partitioning_functions_numba.py(新建)methods/uwue/zhou_optimized.py(新建)utils/benchmark.py(新建)docs/AI_OPTIMIZATION_PROMPTS.md(新建)README.md(更新:添加新内容链接)requirements.txt(更新:添加 numba, pytest, tqdm).github/workflows/tests.yml(新建:CI/CD 配置)代码质量标准
文档标准
性能要求
This pull request was created as a result of the following prompt from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.