simulate_convergence ignores a different random_seed once the study is finished

未关闭
#1,236 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 3 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
半天
新手友好度
66/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
backend

调研方向

Start with the simulate_convergence method and its Returns docstring, then find where it compares the logged seed with random_seed and where Cannot append with a different root seed is raised. Reproduce with the monte_carlo_calisto fixture using the snippet from the issue. Done means a different seed on a finished study raises the same ValueError as the unfinished case, and the docstring and tests are updated to match.

由索引模型根据 Issue 内容生成。

描述

When the logs already hold max_simulations rows, simulate_convergence runs nothing and returns []. The random_seed it was given is never compared with the seed the logs record, so a different one goes unnoticed. One batch short of that, the same call raises.

kwargs = dict(target_attribute="apogee", tolerance=1e-12, batch_size=2)
mc.simulate_convergence(max_simulations=4, random_seed=42, **kwargs)  # 2 widths, 4 rows
mc.simulate_convergence(max_simulations=4, random_seed=7, **kwargs)   # []
mc.simulate_convergence(max_simulations=6, random_seed=7, **kwargs)
# ValueError: Cannot append with a different root seed

Run on develop at 6b2a37fc, with mc the monte_carlo_calisto test fixture.

#1198 describes it in the Returns docstring. Making the finished case raise like the unfinished one came up in its review and was left for a separate change: https://github.com/RocketPy-Team/RocketPy/pull/1198#discussion_r4652615736

主要语言
Python
星标
1.1k
派生
280
平均合并
3 天 2 小时
30 天内合并 PR
24

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

RocketPy-Team/RocketPy 的其他 Issue

查看 RocketPy-Team/RocketPy 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。