`simulate_convergence(batch_size=1)` fails on the first batch of a new study

Offen
#1,229 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 3 Tagen

@umutKaracelebi arbeitet bereits daran.

Seit 20.11.2026.

  • #1233 von @umutKaracelebi — offen

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
72/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
python
Bereich
data, testing-qa

Rechercherichtung

Start with simulate_convergence and estimate_confidence_interval, then read tests/integration/simulation/test_monte_carlo_release.py and its test_convergence_reads_the_checkpoint_once test. Reproduce with the release_study fixture, batch_size=1, and an empty log. Done when a fresh study handles the first batch without passing fewer than two observations to scipy.stats.bootstrap, with a test covering the behavior.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Describe the bug

On a new study, simulate_convergence(..., batch_size=1) stops with an error after its first flight:

ValueError: each sample in `data` must contain two or more observations along `axis`.

The first batch leaves one result, and estimate_confidence_interval passes that single value to scipy.stats.bootstrap, which needs at least two. The input checks accept batch_size=1, so the call runs a simulation before it fails.

To Reproduce

On develop at 9bf63a04, with the release_study fixture from tests/integration/simulation/test_monte_carlo_release.py:

release_study.simulate_convergence(
    target_attribute="max_speed", batch_size=1, max_simulations=4, random_seed=1
)

Expected behavior

Either the study keeps going until there are two results to bootstrap, or batch_size=1 is refused up front while the logs hold fewer than two rows. The first keeps batch_size=1 usable for a fresh study. A study resumed from logs that already hold a row works today, since its first interval sees two results; test_convergence_reads_the_checkpoint_once relies on that.

Additional context

I ran into this while measuring for #1198. It isn't in the #1209 list.

Vorherrschende Sprache
Python
Sterne
1.1k
Forks
280
Ø Merge
3 T. 2 Std.
Gemergte PRs (30 T.)
24

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus RocketPy-Team/RocketPy

Alle Issues in RocketPy-Team/RocketPy

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.