mindspore-ai / mindspore-ai/hyper-parallel

代码清理:trainer / models 行为中立的 clean code 整理

Open
#239 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
53
Forks
63
Avg merge
23h 45m
Merged PRs (30d)
63

Description

该问题是怎么引起的?

静态检查门禁在 hyper_parallel/trainerhyper_parallel/modelsscripts/train_{lm,vl}.py 下扫描出一批行为中立的代码风格项(模块 __all__ 与 import 顺序、无需访问实例的方法可声明为 @staticmethodBaseTrainer 实例属性在 __init__ 外定义、dict[key] 未防御取值等),需做 clean code 整理,统一代码风格、提升可读性,不涉及功能逻辑变更

重现步骤

对上述目录跑静态检查门禁即可列出这些代码风格项。

报错信息

均为代码风格类项(import 顺序 / staticmethod / 类属性声明 / dict.get 等),行为中立,无运行期报错。

schema_version: 1
source: gitcode
gitcode_repo: mindspore/hyper-parallel
gitcode_issue: 252
source_url: https://gitcode.com/mindspore/hyper-parallel/issues/252

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Run the static-check gate against hyper_parallel/trainer, hyper_parallel/models, and scripts/train_{lm,vl}.py, then review the reported import, staticmethod, BaseTrainer attribute, and dictionary-access findings. Done means the listed behavior-neutral style issues are resolved, the gate passes, and runtime behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.