fix(core): 补齐 get_rng 类型校验,set_seed 覆盖 numpy 旧全局
get_rng 的"共享单例生成器"设计由用户本人提出,本提交只在其上修 bug。 - random_state 判断从 isinstance(x, int) 放宽到 (int, np.integer): np.int64 不是 int 的子类,之前会静默退回全局流、种子被无声忽略 - 非预期类型改成抛 TypeError(含 bool / float / str / list),不再静默降级 - get_rng 签名补上 np.integer 与 Generator,与 docstring 的承诺一致 - set_seed 同时调用 np.random.seed:sklearn / statsmodels 走的是 numpy 旧全局状态,不覆盖它们"提交能重跑"就有洞(带 noqa: NPY002 与理由) - 测试:TestRandom 由 4 条增到 7 条(np.integer、非法类型、共享生成器推进) - 新增 docs/dev/personal-pitfalls.md:个人易错点清单,只追加、不通读, 首批记录本轮 4 个点;docs/README.md 补上 05 与该文件的索引 - STATUS.md:L0 进度说明更新,决策 24 改写(共享单例)、新增决策 25 (src/ 实现默认由用户本人写)
This commit is contained in:
1 parent
658b266614
commit
c93810ffb1
6 files changed
+158
-35
No files matched your search
@@ -9,6 +9,8 @@
|
||||
| [03-roadmap.md](03-roadmap.md) | 功能清单分级(L0 / L1 / L2 / 不做)与开发纪律 |
|
||||
| [04-environment.md](04-environment.md) | conda / venv 环境配置、镜像、离线约束 |
|
||||
| [dev/function-card-template.md](dev/function-card-template.md) | S 档算法的「函数卡片」模板 |
|
||||
| [05-git-workflow.md](05-git-workflow.md) | Git 工作流、Gitea 远程(SSH 走 Tailscale)、行尾策略 |
|
||||
| [dev/personal-pitfalls.md](dev/personal-pitfalls.md) | **个人易错点清单:只追加**,追加前不通读 |
|
||||
|
||||
## 阅读顺序
|
||||
|
||||
|
||||
Reference in new issue
Block a user