Skip to content

Commit

Permalink
Show cost for EME, HEAT, and MODE. Remove URL from EME webapi.
Browse files Browse the repository at this point in the history
  • Loading branch information
caseyflex committed Apr 24, 2024
1 parent 95919b8 commit 3339b39
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions tidy3d/web/api/webapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,9 @@ def upload(
"Tidy3D's EME solver is currently in the beta stage. Cost of EME simulations "
"is subject to change in the future."
)
url = _get_url(task.task_id)
console.log(f"View task using web UI at [link={url}]'{url}'[/link].")
if task_type == "FDTD" or task_type == "MODE_SOLVER" or task_type == "HEAT":
url = _get_url(task.task_id)
console.log(f"View task using web UI at [link={url}]'{url}'[/link].")

task.upload_simulation(stub=stub, verbose=verbose, progress_callback=progress_callback)

Expand Down Expand Up @@ -366,6 +367,19 @@ def monitor(task_id: TaskId, verbose: bool = True) -> None:
# Wait for task to finish
prev_status = "draft"
status = get_status(task_id)
if verbose:
console.log(
"To cancel the simulation, use 'web.abort(task_id)' or 'web.delete(task_id)' "
"or abort/delete the task in the web "
"UI. Terminating the Python script will not stop the job running on the cloud."
)
est_flex_unit = task_info.estFlexUnit
if est_flex_unit is not None and est_flex_unit > 0:
console.log(
f"Maximum FlexCredit cost: {est_flex_unit:1.3f}. Use 'web.real_cost(task_id)'"
f" to get the billed FlexCredit cost after a simulation run."
)

while status not in ("success", "error", "diverged", "deleted"):
if status != prev_status:
log.log(log_level, f"{solver_name} solver status: {status}")
Expand Down

0 comments on commit 3339b39

Please sign in to comment.