pyfracval.batch_runner#

Batch generation of multiple aggregates in parallel using Dask.

This module provides functionality to generate multiple fractal aggregates in parallel via a Dask distributed scheduler — either a local cluster or a remote one (e.g. tcp://host:8786).

Each trial is submitted as an independent Dask task, so workers can be on any machine that is part of the Dask cluster.

Module Contents#

pyfracval.batch_runner.generate_aggregates_parallel(n_aggregates, config, output_base_dir='RESULTS', seed_start=1000, n_workers=None, show_progress=True, scheduler_address=None)[source]#

Generate multiple fractal aggregates in parallel via Dask.

Parameters:
  • n_aggregates – Number of aggregates to generate.

  • config – Simulation configuration dictionary (N, Df, kf, rp_g, rp_gstd, …).

  • output_base_dir – Base directory for output files (default: "RESULTS").

  • seed_start – Starting random seed. Aggregate i uses seed_start + i.

  • n_workers – Workers for a local cluster. Ignored when scheduler_address is set.

  • show_progress – Show a tqdm progress bar while futures complete.

  • scheduler_address – Remote Dask scheduler address (e.g. "tcp://host:8786"). None → start a LocalCluster.

Returns:

One (success, coords, radii) tuple per aggregate, in submission order.

Return type:

list[tuple[bool, np.ndarray | None, np.ndarray | None]]

pyfracval.batch_runner.generate_aggregates_sequential(n_aggregates, config, output_base_dir='RESULTS', seed_start=1000)[source]#

Generate multiple aggregates sequentially (for comparison/debugging).

Parameters:
  • n_aggregates – Number of aggregates to generate.

  • config – Simulation configuration dictionary.

  • output_base_dir – Base directory for output files (default: "RESULTS").

  • seed_start – Starting random seed.

Returns:

One (success, coords, radii) tuple per aggregate.

Return type:

list[tuple[bool, np.ndarray | None, np.ndarray | None]]