Skip to content

Commit

Permalink
Setting 'visualize' status directly to 'success'
Browse files Browse the repository at this point in the history
  • Loading branch information
momchil-flex authored and tylerflex committed Jan 31, 2022
1 parent 27d5029 commit ce246ed
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
5 changes: 3 additions & 2 deletions tidy3d/components/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,8 @@ def at_centers(self, field_monitor_name: str) -> xr.Dataset:

@equal_aspect
@add_ax_if_none
def plot_field( # pylint:disable=too-many-arguments, too-many-locals, too-many-branches
# pylint:disable=too-many-arguments, too-many-locals, too-many-branches, too-many-statements
def plot_field(
self,
field_monitor_name: str,
field_name: str,
Expand Down Expand Up @@ -956,7 +957,7 @@ def plot_field( # pylint:disable=too-many-arguments, too-many-locals, too-many-
elif val == "abs":
field_data = abs(field_data)

if val=="abs" or field_name=="int":
if val == "abs" or field_name == "int":
cmap = "magma"
else:
cmap = "RdBu"
Expand Down
2 changes: 1 addition & 1 deletion tidy3d/components/mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class ModeSpec(Tidy3dBaseModel):
description="Index into the first two non-propagating axes defining the normal to the "
"plane in which the bend lies. This must be provided if ``bend_radius`` is not ``None``. "
"For example, for a ring in the global xy-plane, and a mode plane in either the xz or the "
"yz plane, the ``bend_axis`` is always 1 (the global z axis)."
"yz plane, the ``bend_axis`` is always 1 (the global z axis).",
)

@pd.validator("bend_axis", always=True)
Expand Down
3 changes: 2 additions & 1 deletion tidy3d/components/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
import numpy as np
import xarray as xr
import matplotlib.pylab as plt

try:
import matplotlib as mpl
from mpl_toolkits.axes_grid1 import make_axes_locatable
except Exception: # pylint: disable=broad-except
except Exception: # pylint: disable=broad-except
print("Could not import matplotlib!")
from descartes import PolygonPatch

Expand Down
4 changes: 4 additions & 0 deletions tidy3d/web/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ def monitor(self) -> None:

while status not in ("success", "error", "diverged", "deleted", "draft"):
new_status = self.status
if new_status == "visualize":
new_status = "success"
if new_status != status:
console.log(f"status = {new_status}")
status = new_status
Expand Down Expand Up @@ -324,6 +326,8 @@ def pbar_description(task_name: str, status: str) -> str:
for status_index, (task_name, job) in enumerate(self.jobs.items()):
current_status = statuses[status_index]
new_status = job.status
if new_status == "visualize":
new_status = "success"
if new_status != current_status:
completed = run_statuses.index(new_status)
pbar = pbar_tasks[task_name]
Expand Down
2 changes: 2 additions & 0 deletions tidy3d/web/webapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ def monitor(task_id: TaskId) -> None:

while status not in ("success", "error", "diverged", "deleted", "draft"):
new_status = get_info(task_id).status
if new_status == "visualize":
new_status = "success"
if new_status != status:
console.log(f"status = {new_status}")
status = new_status
Expand Down

0 comments on commit ce246ed

Please sign in to comment.