tidy3d.web.api.webapi.run

Contents

tidy3d.web.api.webapi.run#

class run[source]#

Bases:

Submits a Simulation to server, starts running, monitors progress, downloads, and loads results as a SimulationDataType object.

Parameters:
  • simulation (Union[Simulation, HeatSimulation, EMESimulation]) – Simulation to upload to server.

  • task_name (str) – Name of task.

  • folder_name (str = "default") – Name of folder to store task on web UI.

  • path (str = "simulation_data.hdf5") – Path to download results file (.hdf5), including filename.

  • callback_url (str = None) – Http PUT url to receive simulation finish event. The body content is a json file with fields {'id', 'status', 'name', 'workUnit', 'solverVersion'}.

  • verbose (bool = True) – If True, will print progressbars and status, otherwise, will run silently.

  • simulation_type (str = "tidy3d") – Type of simulation being uploaded.

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

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

  • solver_version (str = None) – target solver version.

  • worker_group (str = None) – worker group

Returns:

Object containing solver results for the supplied simulation.

Return type:

Union[SimulationData, HeatSimulationData, EMESimulationData]

Notes

Submitting a simulation to our cloud server is very easily done by a simple web API call.

sim_data = tidy3d.web.api.webapi.run(simulation, task_name='my_task', path='out/data.hdf5')

The tidy3d.web.api.webapi.run() method shows the simulation progress by default. When uploading a simulation to the server without running it, you can use the tidy3d.web.api.webapi.monitor(), tidy3d.web.api.container.Job.monitor(), or tidy3d.web.api.container.Batch.monitor() methods to display the progress of your simulation(s).

Examples

To access the original Simulation object that created the simulation data you can use:

# Run the simulation.
sim_data = web.run(simulation, task_name='task_name', path='out/sim.hdf5')

# Get a copy of the original simulation object.
sim_copy = sim_data.simulation

See also

tidy3d.web.api.webapi.monitor()

Print the real time task progress until completion.

tidy3d.web.api.container.Job.monitor()

Monitor progress of running Job.

tidy3d.web.api.container.Batch.monitor()

Monitor progress of each of the running tasks.

Inherited Common Usage