Skip to content

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

Open

Description

@thc1006

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 9bf63a0, 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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions