fix(solve): random_walk 的 start 校验恢复后收尾(文案/空格/测试)
两条口径由用户第二轮改定,Codex 顺手补工程侧。 - 用户:恢复 start 的入口类型校验;n_steps/n_paths 注解放宽为 int | np.integer - Codex:start 报错文案"必须是整数" -> "必须是数值"(这条校验本来就收 float,原文案自相矛盾), 类型名统一 type(x).__name__;n_paths 默认值补空格;docstring 的 start 说明与 Raises 同步 - tests:start="a" 恢复断言 TypeError;补回 np.int64 的 n_steps/n_paths;solve 段 42 条 - 验证:209 收集 / 178 passed / 31 skipped / 0 xfail,ruff 0,pyright 0 - docs:STATUS 决策 55(方阵歧义两条路)+ 验证计数;CHANGELOG
This commit is contained in:
1 parent
6fca82e3fc
commit
cd6f613568
4 files changed
+54
-21
No files matched your search
@@ -484,6 +484,17 @@
|
||||
- `STATUS.md`:新增**决策 54** 与 `random_walk` 的 3 条新口径;4 条待办标记办结;验证计数更新为 177 / 31。
|
||||
- `docs/dev/personal-pitfalls.md`:新增第 **26** 条(`except` 用到的变量在 `try` 里才赋值 —— 每条失败路径都炸)。
|
||||
|
||||
### Changed
|
||||
- `random_walk` 收口 2 条口径(用户第二轮改动):恢复 `start` 的入口类型校验(`isinstance(start, (int, float, np.number))`);
|
||||
签名注解放宽为 `n_steps: int | np.integer` / `n_paths: int | np.integer`(与 §4.7 及 `monte_carlo_integral` 的 `n` 对齐)。
|
||||
- `random_walk` 的 `start` 报错文案(Codex 顺手):原文"start必须是整数"与校验本身矛盾 —— 这条校验**收 float**,
|
||||
改成"start 必须是数值";类型名统一 `{type(start).__name__}`(全模块口径);`n_paths: int | np.integer= 1` 补空格。
|
||||
- `random_walk` 的 docstring 同步:`start` 的说明去掉"入口不校验类型",`Raises` 补回 `start` 的 `TypeError`。
|
||||
- `tests/test_solve.py`:`start="a"` 恢复断言 `TypeError`;补回 `np.int64` 的 `n_steps` / `n_paths`;
|
||||
`solve` 段 41 → **42** 条,全量 **209 收集 / 178 passed / 31 skipped / 0 xfail**(ruff 0 / pyright 0)。
|
||||
- `STATUS.md`:新增**决策 55**(`n_paths == n_steps` 的"方阵歧义"留作已知边界,A 接受 / B 换契约两条路);
|
||||
3 条口径办结 2 条,验证计数更新为 178 / 31。
|
||||
|
||||
## [0.0.1] - 2026-10-01
|
||||
|
||||
### Added
|
||||
|
||||
Reference in new issue
Block a user