simulate_convergence ignores a different random_seed once the study is finished

Đang mở
#1,236 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 3 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
Nửa ngày
Mức phù hợp với người mới
66/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Python
Star
1.1k
Fork
280
Merge trung bình
3 ngày 2 giờ
Pull request đã merge (30 ngày)
24

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của RocketPy-Team/RocketPy

Tất cả issue của RocketPy-Team/RocketPy

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.