tidy3d.web.BatchData#
- class BatchData[source]#
Bases:
Tidy3dBaseModel,MappingHolds a collection of
SimulationDatareturned byBatch.- 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
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. Converting withdict(batch_results.items())eagerly touches all tasks and can load all results.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.
- 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.enabledisTrueand 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
Batchfrom 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] inBatch.- Return type: