Skip to content

Commit 1a0290e

Browse files
committed
Setting 'visualize' status directly to 'success'
1 parent 4c0afb8 commit 1a0290e

File tree

5 files changed

+12
-4
lines changed

5 files changed

+12
-4
lines changed

tidy3d/components/data.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,8 @@ def at_centers(self, field_monitor_name: str) -> xr.Dataset:
848848

849849
@equal_aspect
850850
@add_ax_if_none
851-
def plot_field( # pylint:disable=too-many-arguments, too-many-locals, too-many-branches
851+
# pylint:disable=too-many-arguments, too-many-locals, too-many-branches, too-many-statements
852+
def plot_field(
852853
self,
853854
field_monitor_name: str,
854855
field_name: str,
@@ -956,7 +957,7 @@ def plot_field( # pylint:disable=too-many-arguments, too-many-locals, too-many-
956957
elif val == "abs":
957958
field_data = abs(field_data)
958959

959-
if val=="abs" or field_name=="int":
960+
if val == "abs" or field_name == "int":
960961
cmap = "magma"
961962
else:
962963
cmap = "RdBu"

tidy3d/components/mode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class ModeSpec(Tidy3dBaseModel):
5656
description="Index into the first two non-propagating axes defining the normal to the "
5757
"plane in which the bend lies. This must be provided if ``bend_radius`` is not ``None``. "
5858
"For example, for a ring in the global xy-plane, and a mode plane in either the xz or the "
59-
"yz plane, the ``bend_axis`` is always 1 (the global z axis)."
59+
"yz plane, the ``bend_axis`` is always 1 (the global z axis).",
6060
)
6161

6262
@pd.validator("bend_axis", always=True)

tidy3d/components/simulation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
import numpy as np
77
import xarray as xr
88
import matplotlib.pylab as plt
9+
910
try:
1011
import matplotlib as mpl
1112
from mpl_toolkits.axes_grid1 import make_axes_locatable
12-
except Exception: # pylint: disable=broad-except
13+
except Exception: # pylint: disable=broad-except
1314
print("Could not import matplotlib!")
1415
from descartes import PolygonPatch
1516

tidy3d/web/container.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ def monitor(self) -> None:
138138

139139
while status not in ("success", "error", "diverged", "deleted", "draft"):
140140
new_status = self.status
141+
if new_status == "visualize":
142+
new_status = "success"
141143
if new_status != status:
142144
console.log(f"status = {new_status}")
143145
status = new_status
@@ -324,6 +326,8 @@ def pbar_description(task_name: str, status: str) -> str:
324326
for status_index, (task_name, job) in enumerate(self.jobs.items()):
325327
current_status = statuses[status_index]
326328
new_status = job.status
329+
if new_status == "visualize":
330+
new_status = "success"
327331
if new_status != current_status:
328332
completed = run_statuses.index(new_status)
329333
pbar = pbar_tasks[task_name]

tidy3d/web/webapi.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,8 @@ def monitor(task_id: TaskId) -> None:
196196

197197
while status not in ("success", "error", "diverged", "deleted", "draft"):
198198
new_status = get_info(task_id).status
199+
if new_status == "visualize":
200+
new_status = "success"
199201
if new_status != status:
200202
console.log(f"status = {new_status}")
201203
status = new_status

0 commit comments

Comments
 (0)