tidy3d.web.api.container.BatchData#
- class BatchData[source]#
Bases:
Tidy3dBaseModel,MappingHolds a collection of
SimulationDatareturned byBatch.- 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,
attrsare mutable. For example, the following is allowed for setting anattrobj.attrs['foo'] = bar. Also note that Tidy3D will raise aTypeErrorifattrscontain objects that can not be serialized. One can check ifattrsare serializable by callingobj.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.
lazy (bool = False) β Whether to load the actual data (lazy=False) or return a proxy that loads the data when accessed (lazy=True).
Notes
When the batch is completed, the output is not a
SimulationDatabut rather aBatchData. The data within thisBatchDataobject can either be indexed directlybatch_results[task_name]or can be looped throughbatch_results.items()to get theSimulationDatafor each task.See also
Batch:Interface for submitting several
Simulationobjects to sever.SimulationData:Stores data from a collection of
Monitorobjects in aSimulation.- Notebooks
Attributes
Methods
load([path_dir,Β replace_existing])Load
Batchfrom 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#
- lazy#
- classmethod load(path_dir='.', replace_existing=False)[source]#
Load
Batchfrom 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.
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] inBatch.- Return type:
- __hash__()#
Hash method.