scippuncertainty.mc.driver.resample_n#

scippuncertainty.mc.driver.resample_n(*, samplers, rng, n, progress=None, description='Monte-Carlo')[source]#

Draw n samples.

Passes the RNG to samplers in the following order:

for _ in range(n):
    for sampler in samplers.values():
        sampler.sample_once(rng)
Parameters:
  • samplers (dict[str, Sampler]) – dict of samplers to draw from.

  • rng (Generator) – Random number generator to pass to the samplers.

  • n (int) – Number of samples to draw from each sampler.

  • progress (Optional[Progress], default: None) – Progress bar. Disabled if set to None.

  • description (str, default: 'Monte-Carlo') – Message to show on the progress bar.

Yields:

dicts of samples indexed by the keys of samplers.

Return type:

Generator[dict[str, DataArray], None, None]