tidy3d.web.api.mode.run_batch

Contents

tidy3d.web.api.mode.run_batch#

class run_batch[source]#

Bases:

Submits a batch of ModeSolver to the server concurrently, manages progress, and retrieves results.

Parameters:
  • mode_solvers (List[ModeSolver]) – List of mode solvers to be submitted to the server.

  • task_name (str) – Base name for tasks. Each task in the batch will have a unique index appended to this base name.

  • folder_name (str) – Name of the folder where tasks are stored on the server’s web UI.

  • results_files (List[str], optional) – List of file paths where the results for each ModeSolver should be downloaded. If None, a default path based on the folder name and index is used.

  • verbose (bool) – If True, displays a progress bar. If False, runs silently.

  • max_workers (int) – Maximum number of concurrent workers to use for processing the batch of simulations.

  • max_retries (int) – Maximum number of retries for each simulation in case of failure before giving up.

  • retry_delay (int) – Delay in seconds between retries when a simulation fails.

  • progress_callback_upload (Callable[[float], None], optional) – Optional callback function called when uploading file with bytes_in_chunk as argument.

  • progress_callback_download (Callable[[float], None], optional) – Optional callback function called when downloading file with bytes_in_chunk as argument.

Returns:

A list of ModeSolverData objects containing the results from each simulation in the batch. None is placed in the list for simulations that fail after all retries.

Return type:

List[ModeSolverData]

Inherited Common Usage