tidy3d.web.api.container.BatchData#

class BatchData[source]#

Bases: Tidy3dBaseModel

Holds a collection of SimulationData returned by Batch.

Parameters:
  • attrs (dict = {}) – Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields, attrs are mutable. For example, the following is allowed for setting an attr obj.attrs['foo'] = bar. Also note that Tidy3D` will raise a TypeError if attrs contain objects that can not be serialized. One can check if attrs are serializable by calling obj.json().

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

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

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

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.

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

attrs

Methods

items()

Iterate through the simulations for each task_name.

load([path_dir])

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

load_sim_data(task_name)

Load a simulation data object from file by task name.

Inherited Common Usage

task_paths#
task_ids#
verbose#
load_sim_data(task_name)[source]#

Load a simulation data object from file by task name.

items()[source]#

Iterate through the simulations for each task_name.

__getitem__(task_name)[source]#

Get the simulation data object for a given task_name.

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

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

Parameters:

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

Returns:

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

Return type:

BatchData

__hash__()#

Hash method.