tidy3d.web.BatchData#

class BatchData[source]#

Bases: Tidy3dBaseModel, Mapping

Holds a collection of SimulationData returned by Batch.

Parameters:
  • task_paths (dict[str, str]) – Mapping of task_name to path to corresponding data for each task in batch.

  • task_ids (dict[str, str]) – Mapping of task_name to task_id for each task in batch.

  • verbose (bool = True) – Whether to print info messages and progressbars.

  • cached_tasks (Optional[dict[str, bool]] = None) – Whether the data of a task came from the cache.

  • lazy (bool = False) – Whether to load the actual data (lazy=False) or return a proxy that loads the data when accessed (lazy=True).

  • is_downloaded (Optional[bool] = False) – Whether the simulation data was downloaded before.

Notes

When the batch is completed, the output is not a SimulationData but rather a BatchData. The data within this BatchData object can either be indexed directly batch_results[task_name] or can be looped through batch_results.items() to get the SimulationData for each task. Converting with dict(batch_results.items()) eagerly touches all tasks and can load all results.

See also

Batch:

Interface for submitting several Simulation objects to sever.

SimulationData:

Stores data from a collection of Monitor objects in a Simulation.

Notebooks

Attributes

Methods

load([path_dir, replace_existing])

Load Batch from file, download results, and load them.

load_sim_data(task_name)

Load a simulation data object from file by task name.

task_paths#
task_ids#
verbose#
cached_tasks#
lazy#
is_downloaded#
load_sim_data(task_name)[source]#

Load a simulation data object from file by task name.

When config.batch_data_cache.enabled is True and the total size of all task files stays under the configured threshold, the loaded object is cached in memory for subsequent accesses.

classmethod load(path_dir='.', replace_existing=False)[source]#

Load Batch from file, download results, and load them.

Parameters:
  • path_dir (PathLike = './') – Base directory where data will be downloaded, by default current working directory. A batch.hdf5 file must be present in the directory.

  • replace_existing (bool = False) – Downloads the data even if path exists (overwriting the existing).

Returns:

Contains Union[SimulationData, HeatSimulationData, EMESimulationData] for each Union[Simulation, HeatSimulation, EMESimulation] in Batch.

Return type:

BatchData