-
扫描组件:
component/scan_components.py- 输出:
data/tf_components.jsonl,data/pt_components.jsonl - 扫描 TensorFlow 和 PyTorch 源码中的函数/类定义
- 输出:
-
生成 Embedding:
component/embed_components.py或component/embed_components_ol.py- 输出:
data/tf_vectors.npy,data/pt_vectors.npy ⚠️ 重复文件: 两个文件功能相同,一个用本地模型,一个用在线API
- 输出:
-
检索候选对:
component/gen_candidates.py- 输入:
tf_components.jsonl,pt_components.jsonl,tf_vectors.npy,pt_vectors.npy - 输出:
data/component_candidates.jsonl - 使用 embedding 相似度检索
- 输入:
-
LLM 匹配:
component/match_components_llm.py- 输入:
component_candidates.jsonl - 输出:
data/component_pairs.jsonl - 用 LLM 分析函数对,生成最终映射
- 输入:
-
扫描测试文件:
main.py- 输出:
data/files_tf.jsonl,data/files_pt.jsonl - 输出:
data/norm_tf.jsonl,data/norm_pt.jsonl - 输出:
data/tests_tf.parsed.jsonl,data/tests_pt.parsed.jsonl
- 输出:
-
API 映射:
core/api_mapping.py- 输入:
tests_tf.parsed.jsonl,tests_pt.parsed.jsonl - 输出:
data/tests_tf.mapped.jsonl,data/tests_pt.mapped.jsonl - ✅ 已改进:
parse_py.py现在全面提取所有 TensorFlow 相关 API(不仅限于tf.*开头)
- 输入:
-
识别可迁移测试:
component/migrate_identify_fuzzy.py- 输入:
component_pairs.jsonl,tests_tf.mapped.jsonl - 输出:
data/migration_candidates_fuzzy.jsonl ⚠️ 已修复: 使用tests_tf.mapped.jsonl而不是tf_test_api_usage.jsonl
- 输入:
-
生成迁移测试:
component/migrate_generate_tests.py- 输入:
migration_candidates_fuzzy.jsonl - 输出:
migrated_tests/*.py - 生成模板代码(目前只有占位符)
- 输入:
-
component/embed_components_ol.py- 状态: 与
embed_components.py功能重复 - 建议: 保留一个(根据使用场景选择本地或在线)
- 状态: 与
-
component/migrate_identify.py- 状态: 过时 - 使用
tf_test_api_usage.jsonl(文件级别,无测试函数信息) - 输出:
migration_candidates.jsonl为空(0B) - 建议: 删除或标记为过时,使用
migrate_identify_fuzzy.py替代
- 状态: 过时 - 使用
-
component/scan_api_usage.py- 状态: 生成
tf_test_api_usage.jsonl,但不再被使用 - 建议: 如果不再需要,可以删除
- 状态: 生成
-
component/migrate_generate.py- 状态: 简单字符串替换 API,不够准确
- 与
migrate_generate_tests.py功能不同但可能混淆 - 建议: 如果不用,标记为过时
-
component/migrate_tests.py- 状态: 生成迁移计划
migration_plan.jsonl,但可能不被使用 - 建议: 确认是否被使用,如果不用可以删除
- 状态: 生成迁移计划
-
component/migrate_run.py,migrate_run_tests.py,migrate_run_dynamic.py- 状态: 三个运行脚本,功能重复
- 建议: 统一为一个,或明确各自用途
-
migration_candidates.jsonl- 空文件(0B)- 原因:
migrate_identify.py使用错误的数据源 - 解决: 已修复,使用
migrate_identify_fuzzy.py
- 原因:
-
migrated_tests/*.py- 只有占位符- 原因:
migrate_generate_tests.py只生成模板 - 需要: 实现真正的代码迁移逻辑
- 原因:
core/parse_py.py- 现在只提取tf.*开头的 APIcomponent/migrate_identify_fuzzy.py- 使用正确的数据源tests_tf.mapped.jsonl
-
删除或重命名过时文件:
component/migrate_identify.py→ 标记为_deprecatedcomponent/scan_api_usage.py→ 如果不用,删除component/migrate_generate.py→ 如果不用,标记为过时
-
统一运行脚本:
- 保留
migrate_run_dynamic.py(功能最全) - 删除或标记其他两个
- 保留
-
完善迁移生成:
- 改进
migrate_generate_tests.py,实现真正的代码迁移
- 改进