Skip to content

Commit fd05796

Browse files
committed
Removing restriction for near2far monitors with symmetry
1 parent 5069b6c commit fd05796

File tree

2 files changed

+1
-30
lines changed

2 files changed

+1
-30
lines changed

tests/test_near2far.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -124,20 +124,6 @@ def test_n2f_monitors():
124124
medium=MEDIUM,
125125
)
126126

127-
# Make sure server-side n2f monitors raise an error in the presence of symmetry
128-
with pytest.raises(SetupError):
129-
sim = td.Simulation(
130-
size=sim_size,
131-
grid_spec=grid_spec,
132-
structures=[],
133-
sources=[source],
134-
monitors=all_monitors,
135-
run_time=run_time,
136-
boundary_spec=boundary_spec,
137-
medium=MEDIUM,
138-
symmetry=[1, 0, 0],
139-
)
140-
141127

142128
def test_n2f_data():
143129
"""Make sure all the near-to-far data structures can be created."""

tidy3d/components/simulation.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from .structure import Structure
2323
from .source import SourceType, PlaneWave, GaussianBeam, AstigmaticGaussianBeam
2424
from .monitor import MonitorType, Monitor, FreqMonitor
25-
from .monitor import AbstractFieldMonitor, AbstractNear2FarMonitor
25+
from .monitor import AbstractFieldMonitor
2626
from .viz import add_ax_if_none, equal_aspect
2727

2828
from .viz import MEDIUM_CMAP, PlotParams, plot_params_symmetry
@@ -437,21 +437,6 @@ def _warn_monitor_simulation_frequency_range(cls, val, values):
437437
)
438438
return val
439439

440-
@pydantic.validator("monitors", always=True)
441-
def n2f_monitors_with_symmetry(cls, val, values):
442-
"""Error if a server-side near-to-far monitor is used with symmetry"""
443-
monitors = val
444-
symmetry = values.get("symmetry")
445-
if not any(symmetry):
446-
return val
447-
for monitor in monitors:
448-
if isinstance(monitor, AbstractNear2FarMonitor):
449-
raise SetupError(
450-
"Server-side near-to-far calculation is not available with symmetry. "
451-
"Use the local near-to-far available through the 'RadiationVectors' class."
452-
)
453-
return val
454-
455440
@pydantic.validator("grid_spec", always=True)
456441
def _warn_grid_size_too_small(cls, val, values): # pylint:disable=too-many-locals
457442
"""Warn user if any grid size is too large compared to minimum wavelength in material."""

0 commit comments

Comments
 (0)