diff --git a/tests/test_components/test_autograd.py b/tests/test_components/test_autograd.py index e079038c17..57ab169b17 100644 --- a/tests/test_components/test_autograd.py +++ b/tests/test_components/test_autograd.py @@ -392,7 +392,7 @@ def make_structures(params: anp.ndarray) -> dict[str, td.Structure]: custom_med_pole_res = td.CustomPoleResidue(eps_inf=eps_inf, poles=[(a1, c1), (a2, c2)]) custom_pole_res = td.Structure(geometry=box, medium=custom_med_pole_res) - radius = 1 + anp.abs(vector @ params) + radius = 0.6 * (1 + anp.abs(vector @ params)) cyl_center_y = vector @ params cyl_center_z = -vector @ params cylinder_geo = td.Cylinder( @@ -599,7 +599,7 @@ def test_polyslab_axis_ops(axis): @pytest.mark.skipif(not RUN_NUMERICAL, reason="Numerical gradient tests runs through web API.") -@pytest.mark.parametrize("structure_key, monitor_key", (("medium", "mode"),)) +@pytest.mark.parametrize("structure_key, monitor_key", (("cylinder", "mode"),)) def test_autograd_numerical(structure_key, monitor_key): """Test an objective function through tidy3d autograd.""" @@ -623,7 +623,7 @@ def objective(*args): assert anp.all(grad != 0.0), "some gradients are 0" # numerical gradients - delta = 1e-1 + delta = 1e-3 sims_numerical = {} params_num = np.zeros((N_PARAMS, N_PARAMS)) diff --git a/tidy3d/components/geometry/primitives.py b/tidy3d/components/geometry/primitives.py index 6015e04b7c..c0a20080e5 100644 --- a/tidy3d/components/geometry/primitives.py +++ b/tidy3d/components/geometry/primitives.py @@ -27,7 +27,7 @@ _N_SHAPELY_QUAD_SEGS = 200 # number of points to discretize polyslab used to represent cylinder in `Cylinder.to_polyslab()` -N_PTS_CYLINDER_POLYSLAB = 101 +N_PTS_CYLINDER_POLYSLAB = 201 class Sphere(base.Centered, base.Circular):