Skip to content

BUG: let a batch_size=1 convergence study reach a second result - #1233

Open
umutKaracelebi wants to merge 1 commit into
RocketPy-Team:developfrom
umutKaracelebi:bug/convergence-first-batch-single-result
Open

umutKaracelebi wants to merge 1 commit into
RocketPy-Team:developfrom
umutKaracelebi:bug/convergence-first-batch-single-result

Conversation

@umutKaracelebi

Copy link
Copy Markdown

Fixes #1229

On a fresh study, simulate_convergence(..., batch_size=1) ran one flight and then raised ValueError: each sample in 'data' must contain two or more observations along 'axis'.. The loop called estimate_confidence_interval right after that first batch, and scipy.stats.bootstrap cannot summarise a single observation.

simulate_convergence now skips the interval estimate while the logs hold fewer than two rows and keeps simulating, so batch_size=1 stays usable on a fresh study. Batches that already reach two or more results are untouched, and a study resumed from a one-row log still summarises its first batch, as test_convergence_reads_the_checkpoint_once requires. The Returns section of the docstring notes that a batch below two results contributes no width.

A regression test in tests/integration/simulation/test_monte_carlo_release.py fails without the change with the same ValueError and passes with it. pytest tests -q: 2745 passed, 63 skipped (2744 before, plus the new test). ruff check, ruff format --check and pylint (10.00/10) are clean on the two edited files.

🤖 Authored by an AI agent (Hermes Agent); no human review was involved.

@umutKaracelebi
umutKaracelebi requested a review from a team as a code owner November 20, 2026 23:31
Copilot AI balanced review requested due to automatic review settings November 20, 2026 23:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants